Articles

Options for svg graphics in RMarkdown

 These options seem to be ok: ```{r setup, include=TRUE} knitr::opts_chunk$set(fig.path='figs/xxx_',                        dev='svg',                        concordance=TRUE,                        echo=TRUE,                        fig.width=12, fig.height=8,                        dev.args=list(pointsize=16)) ```

Error when gfortran is used for package installation from source

 MacOSX 15.3 gcc installed using MacBrew I get this error: ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0' not found ld: warning: search path '/opt/gfortran/lib' not found ld: library 'gfortran' not found I solve it by creating a  ~/.R/Makevars  file like this: FC      = /opt/homebrew/opt/gfortran/bin/gfortran F77     = /opt/homebrew/opt/gfortran/bin/gfortran FLIBS   = -L/opt/homebrew/opt/gfortran/lib Now I can compile package with gfortran

optimx error in MacOsX

 Since this morning (5/2/2025), I get an error when I try to load optimx package: > library("optimx") Erreur : le chargement du package ou de l'espace de noms a échoué pour ‘optimx’ in dyn.load(file, DLLpath = DLLpath, ...) : impossible de charger l'objet partagé '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/nloptr/libs/nloptr.so' :   dlopen(/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/nloptr/libs/nloptr.so, 0x0006): Library not loaded: /opt/homebrew/opt/nlopt/lib/libnlopt.0.dylib   Referenced from: <2A7DAFE2-8123-3555-9569-F28214328E47> /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/nloptr/libs/nloptr.so   Reason: tried: '/opt/homebrew/opt/nlopt/lib/libnlopt.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/nlopt/lib/libnlopt.0.dylib' (no such file), '/opt/homebrew/opt/nlopt/lib/libnlopt.0.dylib' (no such file), '/Libra...

Degree symbol in plot

main = expression("Temperature ("*~degree*C*")") main = "Temperature (°C)" main = "Temperature (\u00B0C)" with expression format, the font is lighter. I don't know why.

Install package strex in ubuntu

To update this package, I have been forced to remove it and to install it again. Otherwise, I get an error like this one: Erreur : le chargement du package ou de l'espace de noms a échoué pour ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...) : impossible de charger l'objet partagé '/usr/lib/R/site-library/stringi/libs/stringi.so' :   libicuuc.so.70: cannot open shared object file: No such file or directory

update raster package

Ubuntu 24.01  You must first install terra package before install raster package.

Speed to extract vector element by name with or without returning name: ["x"], [["x"]], [n] or unname()

The speed is higher using [[n]] then [["x"]]. unname(["x"]) is the slowest.   > Growth        alpha         beta            M            S            K           x0   0.007984356  0.018129643 81.782205061  2.978223538 13.309442413  5.072000000  > system.time({for(i in 1:1E6) K <- Growth[[1]]})    user  system elapsed    0.035   0.000   0.035  > system.time({for(i in 1:1E6) K <- Growth[["alpha"]]})    user  system elapsed    0.083   0.002   0.086  > system.time({for(i in 1:1E6) K <- Growth[1]})    user  system elapsed    0.145   0.004   0.150  > system.time({for(i in 1:1E6) K <- Growth["alpha"]})    user  system elapsed    0.150 ...