This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tools:rtools [2021/12/02 14:53] nperez |
tools:rtools [2024/02/01 12:01] erifarov |
||
---|---|---|---|
Line 6: | Line 6: | ||
A quarterly meeting is taking place in the department to discuss about the plans and priorities of the R tools (or any other topic we need to discuss). Here you can find a document were the minutes are being gathered: | A quarterly meeting is taking place in the department to discuss about the plans and priorities of the R tools (or any other topic we need to discuss). Here you can find a document were the minutes are being gathered: | ||
- | * [[https:// | + | * [[https:// |
+ | * [[https:// | ||
+ | |||
+ | ===== R User Meeting ===== | ||
+ | ====2024==== | ||
+ | * R tools user meeting (Mix Mode, 01/ | ||
+ | ====2023==== | ||
+ | * R tools user meeting (Mix Mode, 14/ | ||
+ | * R tools user meeting (Mix Mode, 02/ | ||
+ | * R tools user meeting (Mix Mode, 05/ | ||
+ | * R tools user meeting (Mix Mode, 07/ | ||
+ | * R tools user meeting (Mix Mode, 06/ | ||
+ | * R tools user meeting (Mix Mode, 01/ | ||
+ | * R tools user meeting (Mix Mode, 04/ | ||
+ | * R tools user meeting (Mix Mode, 06/ | ||
+ | * R tools user meeting (Mix Mode, 02/ | ||
+ | * R tools user meeting (Mix Mode, 02/ | ||
+ | |||
+ | ====2022==== | ||
+ | * R tools user meeting (Mix Mode, 01/ | ||
+ | * R tools user meeting (Mix Mode, 03/ | ||
+ | * R tools user meeting (Mix Mode, 06/ | ||
+ | * R tools user meeting (Mix Mode, 01/ | ||
+ | * R tools user meeting (Mix Mode, 07/ | ||
+ | * R tools user meeting (Mix Mode, 02/ | ||
+ | * R tools user meeting (Mix Mode, 05/ | ||
+ | * R tools user meeting (Mix Mode, 07/ | ||
+ | * R tools user meeting (Mix Mode, 03/ | ||
+ | * R tools user meeting (Mix Mode, 03/ | ||
====2021==== | ====2021==== | ||
Line 29: | Line 57: | ||
* R tools user meeting (BSC, 07/11/2019) {{ : | * R tools user meeting (BSC, 07/11/2019) {{ : | ||
| | ||
- | Please, see specific information for each tool: | + | ===== Packages ===== |
+ | |||
+ | Brief Summary and links to in-house packages: {{ : | ||
+ | |||
+ | See specific information for each tool: | ||
* [[https:// | * [[https:// | ||
Line 39: | Line 71: | ||
* [[https:// | * [[https:// | ||
- | ==== Presentations ==== | ||
- | | + | ===== Presentations ===== |
+ | * {{ : | ||
+ | * {{ : | ||
+ | * {{ : | ||
+ | * {{ : | ||
+ | * {{ : | ||
+ | | ||
* [[https:// | * [[https:// | ||
* {{ : | * {{ : | ||
- | ====How to cite==== | + | ===== How to report an issue ===== |
+ | We use issues to identify and address bugs and propose new developments in the codebase. If you find a problem in our tools, please read this document to see if you should and how to report an issue. [[https:// | ||
- | If you are using any of the R packages being developed at the department, you can include a citation in your research items. | ||
- | | + | ===== How to source a function from GitLab repository ===== |
- | BSC-CNS and Nicolau Manubens | + | |
+ | If we want to test a developing function from GitLab, sourcing the file on GitLab is very useful. Of course, you can save the file and source it locally, but when the file is updated, you need to manually update the local file, which is not convenient. | ||
+ | |||
+ | If the repository is **public**, you can follow these two ways. | ||
+ | |||
+ | 1. If you have the git repo cloned under your personal directory: | ||
+ | | ||
+ | - Open an R session, source the function from the git repo. Source the depended packages as well. You can modify the following lines for your package. | ||
+ | |||
+ | path <- "/ | ||
+ | ff <- lapply(list.files(path), | ||
+ | invisible(lapply(ff, | ||
+ | # load all the depended packages | ||
+ | lib <- c(' | ||
+ | invisible(lapply(lib, | ||
+ | |||
+ | 2. If you don't have a local git repo: | ||
+ | |||
+ | | ||
+ | source(" | ||
+ | |||
+ | Remember that you need to use the raw URL, which can be found in the upper-right corner of the file. | ||
+ | Note that you may need to load other packages or source other functions used in the sourced function. In contrast, by the first method above, all the possible needs are taken care of already. | ||
+ | |||
+ | If the repository is **not public**, see {{ : | ||
+ | |||
+ | ===== How to cite R Tools ===== | ||
+ | |||
+ | If you use any R packages, both developed in or outside of the department, you can include a citation in your research items. | ||
+ | |||
+ | // | ||
+ | |||
+ | ==== Cite R package ==== | ||
+ | To get the most updated citation text, you can simply use R function " | ||
+ | |||
+ | > citation(" | ||
+ | To cite package ' | ||
+ | |||
+ | | ||
+ | Common Tools for Seasonal to Decadal Verification. R package version | ||
+ | | ||
+ | |||
+ | A BibTeX entry for LaTeX users is | ||
+ | |||
+ | @Manual{, | ||
+ | title = {s2dv: A Set of Common Tools for Seasonal to Decadal Verification}, | ||
+ | author = {{BSC-CNS} and An-Chi Ho and Nuria Perez-Zanon}, | ||
+ | year = {2023}, | ||
+ | note = {R package version 2.0.0}, | ||
+ | url = {https://CRAN.R-project.org/package=s2dv}, | ||
+ | } | ||
+ | |||
+ | Notice that you may want to change the version number in case the research is done with a previous version. | ||
+ | |||
+ | ==== Cite R ==== | ||
+ | To cite R software along with its base packages, type citation(). The year varies with the R version you use. | ||
+ | |||
+ | > citation() | ||
+ | To cite R in publications use: | ||
+ | |||
+ | R Core Team (2021). R: A language and environment for statistical | ||
+ | computing. R Foundation for Statistical Computing, Vienna, Austria. | ||
+ | URL https:// | ||
+ | |||
+ | A BibTeX entry for LaTeX users is | ||
+ | |||
+ | @Manual{, | ||
+ | title = {R: A Language and Environment for Statistical Computing}, | ||
+ | author = {{R Core Team}}, | ||
+ | organization = {R Foundation for Statistical Computing}, | ||
+ | address = {Vienna, Austria}, | ||
+ | year = {2021}, | ||
+ | url = {https:// | ||
+ | } | ||
+ | |||
+ | We have invested a lot of time and effort in creating R, please cite it | ||
+ | when using it for data analysis. See also ‘citation(" | ||
+ | citing R packages. | ||
+ | |||
+ | |||
+ | ==== Package publication ==== | ||
+ | |||
+ | Some packages have their own publication, | ||
- | * **ClimProjDiags** | ||
- | N. Pérez-Zanón, | ||
* **CSTools** | * **CSTools** | ||
- | | + | Pérez-Zanón, |
* **CSIndicators** | * **CSIndicators** | ||
- | Pérez-Zanón, | + | Pérez-Zanón, |
- | + | ||
* **s2dverification** | * **s2dverification** | ||
Nicolau Manubens, Louis-Philippe Caron, Alasdair Hunter, Omar Bellprat, Eleftheria Exarchou, Neven S. Fučkar, Javier Garcia-Serrano, | Nicolau Manubens, Louis-Philippe Caron, Alasdair Hunter, Omar Bellprat, Eleftheria Exarchou, Neven S. Fučkar, Javier Garcia-Serrano, | ||
- | * **s2dv** | ||
- | BSC-CNS, An-Chi Ho and Núria Pérez-Zanón (2020). s2dv: A Set of Common Tools for Seasonal to Decadal Verification. R package version 0.1.0. https:// | ||
- | |||
- | * Given that these packages are using **R environment**, | ||
- | R Core Team (2019). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https:// | ||
- | //**Note** that the version of R and packages can be updated, you can check the latest reference by open a terminal and running `citation()` for the R version and `citation(" | + | ==== Acknowlegement ==== |
- | Finally, it is recommended | + | You can also choose |
//We acknowledge the use of the s2dverification (Manubens et al. 2018), startR (BSC/CNS and Manubens 2020), SpecsVerification (Siegert 2017), CSTools (Pérez-Zanón et al. 2019), ClimProjDiags (BSC/CNS et al. 2020), and boot (Davison and Hinkley 1997; Canty and Ripley 2020) R (R Core Team 2013) software packages.// | //We acknowledge the use of the s2dverification (Manubens et al. 2018), startR (BSC/CNS and Manubens 2020), SpecsVerification (Siegert 2017), CSTools (Pérez-Zanón et al. 2019), ClimProjDiags (BSC/CNS et al. 2020), and boot (Davison and Hinkley 1997; Canty and Ripley 2020) R (R Core Team 2013) software packages.// | ||
- | ====R Tips==== | + | |
+ | ==== Manuscript ==== | ||
+ | |||
+ | It is recommended to add some sentences in the manuscripts where readers can check the full list of software used. For example, | ||
+ | |||
+ | //All analyses were performed using R Statistical Software (v4.1.2; R Core Team 2021). Temperature data was processed via the R packages: startR (v2.3.0; BSC-CNS etc. 2023), s2dv (v2.0.0; BSC-CNS etc. 2023). The indices were calculated using the R package: CSIndicators (v1.0.1; N. Perez etc. 2023).// | ||
+ | |||
+ | ===== RStudio-server ===== | ||
+ | |||
+ | You can launch RStudio-server on workstation or on Nord3v2. It opens RStudio IDE as a webpage. Please follow the instruction: | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== R Tips ===== | ||
General R solutions that are useful in the department but doesn' | General R solutions that are useful in the department but doesn' | ||
Line 104: | Line 230: | ||
in your terminal | in your terminal | ||
- | **3. How to load dependencies of R package sf** | + | **3. How to load dependencies of R package sf, terra, and mapview** |
- | This package could be used by loading the following modules | + | This package could be used by loading the following modules |
- | | + | (on workstation) |
- | module load GDAL/ | + | |
- | module load PROJ/6.1.1-foss-2015a | + | module load GDAL/ |
- | module load GEOS/3.8.0-foss-2015a | + | module load PROJ/4.8.0-foss-2015a |
+ | module load GEOS/3.7.2-foss-2015a-Python-2.7.9 | ||
+ | |||
+ | (on nord3v2) | ||
+ | module load R/ | ||
+ | module load GDAL/3.3.2-foss-2019b-Python-3.7.4 | ||
+ | module load PROJ/7.2.1-foss-2019b | ||
+ | module load GEOS/3.7.2-foss-2019b-Python-3.7.4 | ||
+ | |||
+ | (on hub) | ||
+ | module load R/ | ||
+ | module load GDAL/ | ||
+ | module load PROJ/9.1.0-foss-2021b | ||
+ | module load GEOS/ | ||
+ | |||
+ | Note: Avoid to include them in your bashrc, just load them when it is a requirement. | ||
- | Note: Avoid to include them in your bashrc, just load them when it is a requirement. | ||
Note2: to use library RNetCDF `module load HDF5/ | Note2: to use library RNetCDF `module load HDF5/ | ||
Line 119: | Line 259: | ||
This package could be used by loading the following modules in this specific order: | This package could be used by loading the following modules in this specific order: | ||
- | |||
- | - for R 3.2.0: | ||
- | module load R/ | ||
- | module load GDAL/ | ||
- | module load PROJ/ | ||
- for R 3.6.1: | - for R 3.6.1: | ||
module load R/ | module load R/ | ||
module load GDAL/ | module load GDAL/ | ||
- | # if necessary add: module load PROJ/5.0.1-foss-2015a | + | # if necessary add: module load PROJ/6.1.1-foss-2015a |
+ | |||
+ | - for R 4.1.2: | ||
+ | module load R/ | ||
+ | module load GDAL/ | ||
+ | # if necessary add: module load PROJ/6.1.1-foss-2015a | ||
- | Note: Avoid to include | + | Note: Avoid including |
**5. How to avoid Load error in R 3.6.1: | **5. How to avoid Load error in R 3.6.1: | ||
Line 140: | Line 280: | ||
The same requirement also applies to s2dv:: | The same requirement also applies to s2dv:: | ||
- | **6. How to use ' | + | **6. How to use ' |
- | To correctly use the R library rmapshaper | + | To correctly use the R library rmapshaper, |
- | | + | - On workstation: |
+ | | ||
+ | module load libprotobuf/ | ||
+ | |||
+ | - On Nord3v2: | ||
+ | module load R/ | ||
+ | module load protobuf/ | ||
Line 177: | Line 323: | ||
If the error persists, **check your code with a smaller data sample** to discard a problem with your code since this error message indicates that you are requesting more memory than the available. | If the error persists, **check your code with a smaller data sample** to discard a problem with your code since this error message indicates that you are requesting more memory than the available. | ||
+ | |||
+ | **9. Special characters ** | ||
+ | |||
+ | In case of problems with accents or special characters, try to change the R session language to the most convenient: `Sys.setlocale(" | ||
+ | |||
+ | **10. Test the development on Git** | ||
+ | |||
+ | There are several ways to source the functions under development. Depending on the attributes of the function and the use case, the most suitable way can vary. Check the slides: {{ : | ||
+ | |||
+ | **11. How to load dependencies of R package RNetCDF** | ||
+ | |||
+ | This package could be used by loading the following modules (note that order may affect): | ||
+ | |||
+ | (on workstation) | ||
+ | module load R/ | ||
+ | module load HDF5/ | ||
+ | |||
+ | (on nord3v2) | ||
+ | module load R/ | ||
+ | module load HDF5/ | ||
+ |