1. Configuració d'R i associats a Ubuntu
- 1. Configuració d'R i associats a Ubuntu
- 1.1. Afegir repositori R 3.x a Ubuntu (rRutteR)
- 1.2. Install usual R packages
- 1.3. Instal·lar BioConductor
- 1.4. Instal·lar tots els paquets d'anotacions d'organisme
- 1.5. Actualitzar paquets de BioConductor (update.packages)
- 1.6. Llibreries GNU/Linux necessàries per a instal·lar alguns paquets de R i Bioconductor
- 1.7. Java
- 1.8. Altres llibreries GNU/Linux necessàries per a instal·lar altres paquets d'R
- 1.9. Rstudio
- 1.10. Instal.lació de R conservant versions anteriors
- 1.11. Install R devel (sources) from subversion
- 1.12. Check devel Bioconductor packages corresponding to the R devel version
- 1.13. Eclipse Visual Debugger for R (StatEt)
- 1.14. Darrera versió estable de RKward
- 1.15. Solventar temporalment el problema del proxy amb Sys.setenv
- 1.16. Afegir els menus contextuals de Bazaar a RKward i altres KDE apps
- 2. renv
- 3. Using Multiple Versions of R in Linux
- 4. Us segur de contrasenyes via .Renviron
- 5. Errades i Solucions
- 6. Modern Geospatial Data analysis
- 7. Trobar coordenades d'una adreça
- 8. Conversions coordenades geo
- 9. Instal.lar paquets darrera proxy firewall GlobalProtect a Windows - metode wininet
1.1. Afegir repositori R 3.x a Ubuntu (rRutteR)
Si no tenim tot l'R 3.x instal·lat encara, afegir aquest repositori. Si ja tens una versió prèvia de R 3.x instal.lada, pots anar directament a l'apartat 1.2 i fer el sudo "apt-get update" i desde consola de R "update.packages(ask = F, checkBuilt = T)")
https://launchpad.net/~marutter/+archive/rrutter?field.series_filter=xenial
1.1.1. Ubuntu 16.04 i R 3.6
En Ubuntu 16.04, per poder disposar de R 3.5/3.6, cal afegir les claus gpg:
I afegir aquestses linies a /etc/apt/sources.list
1.1.2. Actualitzar la llista de paquets i l'R
Ara ja podem fer actualitzar la llista de paquets i actualitzar R:
Users who need to compile R packages from source e.g. package maintainers, or anyone installing packages with install.packages() should also install the r-base-dev package:
O via Synaptic Package Manager cercant la versió desitjada d'R-base..., marcant per instal·lar i clicant Apply
Si vols instal·lar els paquets complementaris de R per a tot l'ordinador (instala·lació de sistema), cal que donis permisos a la carpeta que s'empra per omissió /usr/lib/R/site-library
, per exemple executant això en una consola:
I si ja tens paquets instal·lats, i se't queixa R de que no pot actualitzar-los, cal que canviïs els permisos dels paquets ja instal·lats en aquestes dues carpetes, i la de la documentació en html ( /usr/share/R/doc/html/
). Pots fer les dues coses (canviar permisos de la carpeta mare, els seus arxius i de les carpetes filles de forma recurrent amb:
If using Ubuntu-mate, you seem to need to change perms on this folder also:
If using RRO, you have to change permissions here instead:
Alternativament, R et demanarà de crear una carpeta personal on deixar els paquets que instal·laran per al teu usuari, tot i que més endavant, és molt possible que se't queixi igualment que algun paquet de sistema no el pot actualitzar perque no té prous permisos per fer-ho, etc. Així que potser millor donar permisos d'una vegada a que es puguin instal·lar o actualitzar els paquets d'R del sistema, amb les instruccions anteriors.
Per actualitzar els paquets d'R que no són a repositoris d'Ubuntu, cal obrir R i actualitzar paquets associats des de dins de la consola d'R:
Si s'ha instal·lat algun paquet a la carpeta de paquets d'R de l'usuari, i es vol actualitzar el mateix paquet antic que hi ha a la carpeta del sistema, cal indicar-ho explicitament amb la instrucció:
1.2. Install usual R packages
Usual R packages that are useful in many cases in the Bioinformatics world. You can install them in an R console in a terminal (Type "R" in the terminal to launch the R console), or through RStudio command line.
1.3. Instal·lar BioConductor
1.3.1. Via bioCLite
Open the R console, and type inside:
1.3.2. Instal·lar paquets bàsics de BioConductor (via Debian Med Ubuntu repository)
Alternativament, sembla que hi ha un repositori de paquets de biomedicina i bioinformàtica anomenat Debian Med, que té alguns paquets .deb de paquets de Bioconductor, per a algunes versions d'Ubuntu (no totes). El total de paquets és:
- r-bioc-biobase
- r-bioc-cummerbund
- r-bioc-edger
- r-bioc-limma
A part, hi ha altres versions de paquets útils (bwa, bowtie, etc). De totes formes, sembla que a 12.04 no hi ha paquets actualitzats de Debian-Med. En qualsevol cas, si es vol afegir, aquestes són les dues línies a afegir a /etc/apt/sources.list
(canviar precise per la distro d'ubuntu)
1.3.3. Instal·lar paquets NO bàsics de BioConductor (via Debian Med Ubuntu repository)
Mirar secció 5 d'aquesta mateixa pàgina
1.4. Instal·lar tots els paquets d'anotacions d'organisme
List available at:
http://bioconductor.org/packages/release/data/annotation/
Open the R console, and type inside:
This is useful, for instance, to use the goProfiles package.
Other usually needed annotation db packages for our pipeline include installing these oher (big) packages:
1.5. Actualitzar paquets de BioConductor (update.packages)
That is needed, for insatance, once you upgrade to a new version of R (from 2.13 to 2.14, for instance).
Open the R console, and type inside:
If you have some issues related to some packages (such as cairoDevice) not installing because they can't be tested (due to missing some X11 programs or others), try this other command, which prevents from attempting to test the installation of the remaining packages to install:
In recent Bioconductors (at least as of 2013), you can also use:
(Ricardo) Jo per aconseguir instal·lar el "affycoretools" ho he hagut de fer així:
Alternatively, here you have some other tips (from Bioconductor email list):
Hi John,
On 11/8/2011 9:33 AM, John Coulthard wrote:
Hi
I'm trying to install Rsamtools and getting errors! I've tried...
install.packages("/home/ann/downloads/Rsamtools_1.6.0.tar.gz")
and
biocLite("Rsamtools")
(see below)
Why doesn't biocLite() install the current version?
I'm almost sure the dependencies are all up-to-date using install.packages().
So if it's not an out of date dependent what could the problem be?
If is it an out of date dependent how do I get R to tell me which one?
You appear to be going rogue here. You should not be using install.packages() at all, and should not be using an outdated version of biocLite().
You want
source("http://www.bioconductor.org/biocLite.R")
which will install the BiocInstaller package (and load it for you this time)
then in future, you should
library(BiocInstaller)
biocLite("Rsamtools")
which will
biocLite("Rsamtools")
BioC_mirror: 'http://www.bioconductor.org'
Using R version 2.14, BiocInstaller version 1.2.0.
Installing package(s) 'Rsamtools'
trying URL 'http://www.bioconductor.org/packages/2.9/bioc/src/contrib/Rsamtools_1.6.0.tar.gz'
Content type 'application/x-gzip' length 2088510 bytes (2.0 Mb)
Note the message I get compared to what you got.
Best,
Jim
1.6. Llibreries GNU/Linux necessàries per a instal·lar alguns paquets de R i Bioconductor
Copiar i enganxar aquesta comanda a un terminal:
Paquet en R | Paquet en Fedora / Red Hat | Paquet en Debian / Ubuntu | Comentaris
|
rgl | r-cran-rgl | Llibreries de desenvolupament de software per X | |
r-cran-misc3d | Miscelanea progs for rgl and 3d plots (on Ubuntu 11.04) | ||
libX11-devel, libXt-devel | libx11-dev, libxt-dev | (OpenGl: freeglut3, freeglut3-dev) | |
Rglpk | libglpk-dev | r-cran-rglpk (on Ubuntu 14.04) | |
RCurl | curl-devel | libcurl3-dev ó libcurl4-gnutls-dev | Per processar algunes urls des de paquets d'R. En Actualitzar a R 2.14, vaig haver de re-instalar el paquet 'bitops' de bioconductor primer per tal que RCurl es pogués instal·lar bé (Xavi). |
XML | libxml2-dev | libxml2-dev r-cran-xml | |
Rgraphviz | libgraphviz4 libgraphviz-dev | Té a veure amb la llibreria "graphviz" però no la he trobat a la Red Hat Network. Caldrà anar-la a cercar directament a altres repositoris. Jo no la tinc instal·lada (data 2008/06/05) | |
SNPassoc | Instal·lat directament a R | ||
MSnbase o ncdf | libnetcdf-dev | Instal·lar-lo via synaptic. Afegeix capçaleres netcdf.h | |
RNetCDF | udunits-bin, libudunits2-dev | Instal·lar-lo via synaptic. Afegir a l'anterior | |
GWASTools | netcdf-bin netcdf-doc | Instal·lar via synaptic, per a ncdf i GWASTools | |
cairo | libcairo2-dev | Instal·lar via gestor de paquets | |
r-cran-cairodevice | Instal·lar via gestor de paquets | ||
libxt-dev | Instal·lar via gestor de paquets | ||
libgtk2.0-dev | Sembla que podria ser necessari per al cairoDevice en R 2.14+ | ||
Si tot i haver posat aquests paquets, es continua mostrant un prolema d'instal·lació, veure la "Nota sobre cairoDevice" de més avall. | |||
affylmGUI | bwidgets tk-table | necessita tcl/tk, que necessita aquests paquets de sistema. | |
affycoretools | libc6-i386 r-cran-rjava | Sembla que necessita rjava també, i unes llibreries de 32 bits (que són a libc6-i386) per a que rJava funcioni. | |
RCmdr | libv8-dev r-cran-rjava libmpfr-dev | sembla que ho necessita el RCmdr, via els paquets d'R de dependènies "XLConnect" i "sem" | |
devtools | libssl-dev | seems to be needed by git2r, which is a dependency from devtools |
You can solve this issue by passing a extra argument to install.packages in which you require R not to test the installation of cairo, since you are in a headless server with (eventually) some X11 libs (or *whatever*) missing.
Instruccions sobre com trobar quin paquet de l'Ubuntu/Debian té les llibreries o paquets que li fan falta a l'R per poder instal·lar/compilar un paquet d'R:
so the header file "asm/errno.h" cannot be found on your system, but is needed
to compile the Hmisc package sources. it's not a file from an R package, so
you can't fix it by installing other R packages. you need to find out which
ubuntu package provides it. run this on a console:
it will search for "asm/errno.h" in all available packages, and show you that
it's found in the package linux-libc-dev and linux header packages. once
you've installed what you need (e.g. "sudo aptitude install ",
i'd go for the linux-libc-dev package first), try the R installation again.
1.7. Java
Com arreglar problemes relacionats amb rJava, java, libjvm.so, rJava.so, ...
2024+: veure documentació a Posit:
https://solutions.posit.co/envs-pkgs/using-rjava/
1.7.1. Add Java 7-8-9 (JRE) from Sun/Oracle
If for some reason you need Java (jre) from Sun (currently Oracle), because the openjdk doesn't work for you (if you want to share your desktop with BigBlueButton, for instance, that doesn't seem to like the openjdk, or IPA requiring it), you can add the proprietary java through external repositories.
For JRE 7-8-9 from Oracle, you can add the webupd8 repos (ppa:webupd8team/java ; it was added in a previous step through the proxy, etc), and install the installer package:
Source:
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
- http://www.webupd8.org/2014/03/oracle-java-8-stable-released-install.html
- https://launchpad.net/~webupd8team/+archive/ubuntu/java
If you need the earlier sun JRE 6 (keep in mind that you need a version like or higher than 1.6.0_23, because there were some known security holes with earlier versions):
If you are behind a proxy, see the trick above to start a bash session as root and export the http_proxy and https_proxy variables.
Source http://www.ubuntuupdates.org/ppa/flexiondotorg_java_?dist=precise
1.7.2. Afegir Java per a R
Necessari per exemple per al paquet "xlsx", o "tabulizer".
1.7.3. Afegir rJava en projectes amb renv
Hi ha casos en que podem tenir rJava instal.lat bé a nivell de sistema (amb r-cran-rjava, per exemple) però no se'ns instal.la bé dins de projecte de R amb renv (malgrat indicar-li d'emprar la mateixa versió de rJava que tenim a nivell de sistema global fora del projecte amb renv).
En aquests casos, la documentació de posit ens ajuda a trobar la sol.lució:
Derivat de:
https://solutions.posit.co/envs-pkgs/using-rjava/
1.7.4. Change the Java used by default
If you need to change the Java used by default, between OpenJDK & Sun/Oracle JRE, you must run:
Then you can choose among the installed versions:
1.7.5. Fix the issue with rJava.so & libjvm.so
When installing rJava under Rstudio or other GUI programs (at least), you may see this type of error in some cases, at the R console:
If you have oracle-java (7/8) installed. It'll be at this location /usr/lib/jvm and sudo access is required.
Solution:
Create the file /etc/ld.so.conf.d/java.conf
...with the following entries:
(Replace java-8-oracle with java-7-oracle depending on your java version)
Then:
Then, restart RStudio or whichever GUI program you use on top of R, and install rJava again.
1.8. Altres llibreries GNU/Linux necessàries per a instal·lar altres paquets d'R
1.8.1. Thematic maps - tmap
1.8.2. RMySQL
Per a instal·lar RMySQL, cal afegir aquests dos paquets:
1.8.3. Rgdal
Per a Bioconductor...
Per a instal·lar rgdal, per a bioconductor 2.11 (versió corresponent a R 2.15.2) pot ser necessari haver d'actualitzar el paquet gdal d'ubunu (Geospatial Data Abstraction Library) a una versió igual o superior a 1.7. Hi ha un repositori UbuntuGis stable que en té la versió 1.9.x per a Ubuntu Lucid 10.04:
https://launchpad.net/~ubuntugis/+archive/ppa
A part d'instal·lar la versió actualitzada llavors de gdal, cal eliminar (sembla) manualment el paquet libgdal1-1.6.0 i instal·lar el paquet libgdal1-1.8.0 i les dependències que correspongui.
Per a altres Mapes i GIS...
A Ubuntu 12.04...
A Ubuntu 16.04
Package tmap (for Thematic Maps) in Ubuntu 16.04 seems to require the previous packages to be installed before attempting to install the tmap package in R.
1.9. Rstudio
Install rstudio (download version 0.99.878 or higher, which supports addins)
Add rstudio addins. Run this R code within the R terminal inside R Studio:
For more information, see:
http://rstudio.github.io/rstudioaddins/
1.10. Instal.lació de R conservant versions anteriors
1.10.1. Introducció
Aquest document pretén explicar com instal.lar en Linux noves versions de R, conservant les versions anteriors. Partirem de dues suposicions que no sempre han de ser certes, però ens faran simplificar el problema. La primera suposició (i la més important): el nostre sistema Linux té instal.lats tots els paquets necessaris per a que R i Bioconductor funcionin correctament (i compilin, si pot ser ). Suposarem també, al menys de moment, que no hi ha cap versió anterior de R instal.lada, és a dir, que estem instal.lant R per primer cop (en cas de tenir-la, veure la secció Què fer si ja tenim un R instal.lat).
1.10.2. Consideracions prèvies
R en Linux acostuma a tenir una estructura de directoris bastant clara. Normalment, la instal.lació es fa en un directori de l'estil: <prefix>/<lib>/R, on <prefix> és un directori de l'estil “/usr” o “/usr/local”, i <lib> sol ser “lib64” (“lib” en el cas de Linux de 32-bits). A més, l'arxiu executable de R es sol trobar a <prefix>/bin. El problema ve quan volem instal.lar un altre paquest (.deb, .rpm, etc) amb una nova versió de R, perquè ens sobreescriurà els directoris existents de versions anteriors. Per evitar això, cal que anem un pas més enrera i compilem el codi font. És durant el procés d'instal.lació posterior a la compilació, on podrem especificar si volem un nom de directori diferent.1.10.3. Compilació i instal.lació
Pasos a seguir:- Hem de descarregar el “source code” de R-?.?.? de la pàgina web (R-?.?.?.tar.gz) a un directori diguem-li <downDir>.
- Hem d'obrir una consola, iniciar sessió com a root i anar al directori de descàrrega
- Hem de descomprimir i desempaquetar:
- El pas anterior ha creat un directori R-?.?.?, on hem d'entrar per a compilar i instal.lar.
- El pas següent consisteix en compilar i crear els manuals:
El make check es fa per a comprovar que tot ha anat bé- Si pel que sigui, el
./configure
falla amb quelcom com:
configure: error: --with-readline=yes (default) and headers/libs are not available
com en el cas d'instal·lar un R 2.5.x (necessari per al software Gene Pattern a ma amb opcions per defecte), prova de cridar elconfigure
indicant-li on són els includes i les llibreries de X11:
- Si pel que sigui, el
- Ara cal fer la instal.lació (aquí és on indicarem el nou “rhome”)
- Per últim, cal renombrar el fitxer executable R, que hauria d'estar a <prefix>/bin (en l'exemple anterior: /usr/local/bin)
1.10.4. Què fer si ja tenim un R instal.lat
En cas de tenir una versió de R instal.lada, el procés anterior sobreescriuria el fitxer binari <prefix>/bin/R existent. Per tant caldria, abans de fer la instal.lació del nou R, renombrar aquest fitxer. Per exemple: mv /usr/bin/R /usr/bin/R-2.7.0, i després procedir a la instal.lació de R-2.8.0.1.10.5. Consideracions finals
Aquest document s'ha realitzat a partir de la documentació que es troba a la secció “Installing R under Unix-alikes”, del document <downDir>/R-?.?.?/doc/manual/R-admin.html. Possiblement hi ha maneres millors de fer tot això. Aquesta almenys funciona (al menys a RedHat EL 5.0).1.11. Install R devel (sources) from subversion
Sources are also available via https://svn.R-project.org/R/, the R Subversion repository. If you have a Subversion client (see http://subversion.apache.org/), you can check out and update the current ‘r-devel’ from https://svn.r-project.org/R/trunk/ and the current ‘r-patched’ from ‘https://svn.r-project.org/R/branches/R-x-y-branch/’ (where x and y are the major and minor number of the current released version of R). E.g., use- Note that ‘https:’ is required, and that the SSL certificate for the Subversion server of the R project should be recognized as from a trusted source.
- Note that retrieving the sources by e.g. wget -r or svn export from that URL will not work: the Subversion information is needed to build R.
- The Subversion repository does not contain the current sources for the recommended packages, which can be obtained by rsync or downloaded from CRAN. To use rsync to install the appropriate sources for the recommended packages, run from the top-level of the R sources:
Command on a console - If you need to switch from trunk (devel) to any specific branch (such as from trunk to 2.14 during October 2011, in the 4-week period prior to the official release of branch 2.14.x), you can do so with:
Command on a console - If you want to fetch any specific branch from R directly through svn, you can do it by means of creating a new folder at the location you like (for instance, /home/youruser/r14-svn/), and run this command there:
1.11.1. Simple R compilation
As you are reading this file, you have unpacked the R sources and are presumably in the top directory. Issue the following commands:1.11.2. R Installation
You do not need to install R to run it: you can run R by the script `bin/R' which you can link or copy to any convenient place in your path. For a site-wide installation, use1.12. Check devel Bioconductor packages corresponding to the R devel version
You can check them here: http://bioconductor.org/checkResults/devel/bioc-LATEST/1.13. Eclipse Visual Debugger for R (StatEt)
To install Eclipse & Statet (for the visual debugger), you need to compiple R for yourself after applying a small patch to an R source file, and your need to follow these extra (non fully-intuitive) steps:- Download your copy of R source (from subversion or other means), so that you can compile it later.
- Apply the patches from http://www.walware.de/it/downloads/statet.mframe for your version of R
- build and install R
- Add rj package in your R installation. http://www.walware.de/it/downloads/rj.html
Add rj package in your R installation - Install StatEt by hand (it seems that Eclipse doesn't use theproxy info we provided):
- Latest file from here: http://www.walware.de/it/downloads/statet.html
- In Dec 2012, for Eclipse 3.7 (the one from repos in Ubuntu 12.04): site-statet-03.00.01: 2012-07-19 | stable
http://download.walware.de/eclipse-3.7/site-statet-03.00.01.zip
- Follow the tutorial from Eclipse once the Statet is installed for the configuration, etc.
- Launch the R Console no longer from the Run configurations menu (or favorites), but from the Debug configurations menu (or favorites) in order to have the debugger functionality activated
- set breakpoints in your functions
- use either Ctrl+R, Ctrl+F (submit function) or Ctrl+R, Ctrl+S (source the file) in order to install your breakpoints (the breakpoint icon will have a check in that case)
- run the code and the Debug perspective will be opened with a Variables View, Breakpoints View, a nice overview of the stack etc. You can step through your code using F6. To emulate a step-in, put the cursor on the function want to step into and press Ctrl+F5.
[StatET-user] StatET support for visual/advanced R debugging
Tobias Verbeke tobias.verbeke at openanalytics.eu
Thu Aug 25 08:04:54 CEST 2011
Hi Brian,
On 08/24/2011 03:34 PM, Brian G. Peterson wrote:
On Wed, 2011-08-24 at 16:09 +0300, Jonathan Rosenblatt wrote:
It was presented in UseR2011
Try StatET2.0 from http://www.walware.de/it/statet/installation.mframe
I'm thrilled to hear that, but it appears that the update site:
http://download.walware.de/user2011
is blocked. Perhaps it was only available during UseR!2011 ?
I just tested with a vanilla Indigo (Eclipse for Java developers)
and it installs without hiccups.
You get a 404 when browsing to the URL, but if you enter
the address as an update site (under Help Install New Software
Add) things work out perfectly fine.
Is the StatET presentation from useR available?
There is a small video fragment here:
The short installation instructions are:
1) apply the patches from
http://www.walware.de/it/downloads/statet.mframe
for your version of R
2) build and install R
3) install the latest and greatest StatET from the
above URL
4) launch the R Console no longer from the Run configurations
menu (or favorites), but from the Debug configurations menu
(or favorites) in order to have the debugger functionality
activated
5) set breakpoints in your functions
6) use either Ctrl+R, Ctrl+F (submit function) or Ctrl+R, Ctrl+S (source
the file) in order to install your breakpoints (the breakpoint
icon will have a check in that case)
7) run the code and the Debug perspective will be opened with a
Variables View, Breakpoints View, a nice overview of the stack etc.
You can step through your code using F6. To emulate a step-in, put
the cursor on the function want to step into and press Ctrl+F5.
8) Have fun as never before.
There is some more documentation in the StatET User Guide you
can find under Help Help Contents StatET User Guide R Visual Debugger.
We made some installers for Windows and Mac (with patched R
included), but they are not ready for production yet (working
around some Windows limitations for the moment) — currently
they serve primarily to play with the debugger functionality.
I can send the link privately to interested people.
Don't hesitate if you would have further questions.
Best,
Tobias
1.14. Darrera versió estable de RKward
1.15. Solventar temporalment el problema del proxy amb Sys.setenv
Si ho necessitem per alguna raó, podem configurar una sessió d'R per a emprar el proxy, amb aquesta comanda dins de la consola d'R (via pàgina wiki i pluginR, via RKward, via RStudio, etc):1.16. Afegir els menus contextuals de Bazaar a RKward i altres KDE apps
Veure "QBazaar service menu": http://kde-look.org/content/show.php/QBazaar+service+menu?content=142321Service menu for kde apps (such as Dolphin 1.6.x, rkward 0.5.7., ...) so that you can launch a few actions for QBazaar (program of a distributed version control system)
Merged information from two previous sources (1 & 2, see below) and adapted for the case where there was no folder \"ServiceMenu\" created for the user (under gnome desktop).
Sources:
(1) http://blog.saturnlaboratories.co.za/programs/qbazaar-desktop
(2) http://kde-apps.org/content/show.php/Bazaar-Servicemenu?content=115751
Thanks Thomas Friedrichsmeier for feedback.
2. renv
Veure: renv3. Using Multiple Versions of R in Linux
If using Posit Workbench (former RStudio Server Pro), see: https://docs.posit.co/ide/server-pro/r/using_multiple_versions_of_r.html If using Rstudio Server open source, see: https://docs.posit.co/resources/install-r/#optional-install-multiple-versions-of-r4. Us segur de contrasenyes via .Renviron
Resum del Procés:- Es defineix una variable de sistema que conté la contrasenya d'interés. I des d'R, al nostre codi, no posem la contrasenya a l'arxiu .R o .Rmd, sinó que posem una referència a la variable de sistema que té nostra que ens interessa.Studio-Workbench---Pla-de-Treball?latest=1
- Les parelles
variable=contrasenya
es desen en un arxiu de text pla anomenat.Renviron
en la nostre carpeta d'usuari/home/usuarilinux/.Renviron
Si no veus aquest arxiu amb el navegador d'arxius (habitualment amb el programa Dolphin per omissió del Kubuntu), prova a activar l'opció de mostrar els arxius ocults.- Cal assegurar-se que aquest arxiu té permisos de lectura només per a l'usuari que l'ha creat. Especialment important en màquines en les que hi entrin més usuaris, per evitar que quedin exposades contrasenyes innecessàriament. En GNU/Linux (com Kubuntu) ho podem fer amb la instrucció:
- Cal assegurar-se que aquest arxiu té permisos de lectura només per a l'usuari que l'ha creat. Especialment important en màquines en les que hi entrin més usuaris, per evitar que quedin exposades contrasenyes innecessàriament. En GNU/Linux (com Kubuntu) ho podem fer amb la instrucció:
- Exemples de sintaxi dins d'aquest arxiu
.Renviron
- Un cop afegides noves variables de l'arxiu
.Renviron
, cal reiniciar la sessió de R/RStudio, per que les variables de sistema les llegeix R en iniciar la seva sessió de treball. - Des de l'script d'R emprem aquesta informació amb la crida de sistema a emprar el contingut d'aquesta variable, amb la funció d'R:
Sys.getenv()
.
Exemple de codi:
4.1. Edició Renviron a través de paquet usethis
usethis
:package: has a useful helper function to modify .Renviron :
-
usethis::edit_r_environ()
will open your user .Renviron which is in your home -
usethis::edit_r_environ("project")
will open the one in your project
5. Errades i Solucions
5.1. maximal number of DLLs reached
Si veus aquest problema per la consola d'R i s'atura el procés d'R que estàs executant, pots provar a afegir a l'-+.Renviron+- de l'usuari (per tal que s'incrementi el valor de Dll que es poden obrir a l'hora de 256, que sembla que dona problemes en alguns casos, a 1000, per exemple, si ja n'hi ha prou per esquivar el problema)Ctrl
+ X
per sortir desant canvis.
5.2. Problemes rutes en R a Windows AjBCN
6. Modern Geospatial Data analysis
Zev Ross (@zevross) ha tuitat a les 2:29 p. m. on dt., febr. 04, 2020:
I had the privilege of teaching a two-day workshop, Modern Geospatial Data Analysis with R, at the @rstudio conference with an amazing group of TAs and participants. I've made the slides available here: https://t.co/rSzPTt6VBk, #rstats, #rspatial, #gischat https://t.co/3v7UVd0UT5
(https://twitter.com/zevross/status/1224686455274070017?s=09)
7. Trobar coordenades d'una adreça
Es pot fer a: https://www.coordenadas-gps.com/ O millor encara, a Google Maps, i en apareixer el punt sobre el mapa, clica amb el botó alternatiu del ratolí, apareixen les coordenades lon lat, i en clicar amb el botó esquerra a sobre, les copia les coordenades al portaretalls. O via R, amb el paquettidygeocoder
8. Conversions coordenades geo
Eines manuals Via web https://www.ign.es/WebServiceTransformCoordinates/ Cal canviar les opcions per omissió: O amb https://tool-online.com/es/conversion-coordenadas.php EPSG de projeccions habituals de coordenades en el cas AjBCN:- projecció coordenades ed50 (UTM) fus31, epsg: 23031
- projecció coordenades etrs89 (UTM) fus31, epsg: 25831
- projecció coordenades wgs84 (lon lat), epsg: 4326
9. Instal.lar paquets darrera proxy firewall GlobalProtect a Windows - metode wininet
Lo de definir el proxy via sys.setenv no m'ha funcionat . Ni afegint curl via renvNoms alias d'aquesta pàgina: R | R i associats | ess | statet | eclipse | Configuració d'R i associats | ConfiguracióR | ConfiguracioR | RConf | RConfiguration | Config R | R Config