[R-sig-Geo] RStoolbox loading, Rscript, printing and e acute (é)

Mathieu Rajerison mathieu.rajerison at gmail.com
Thu Jan 21 15:04:31 CET 2016


I forgot to tell it's only when calling the script from Rscript that the e
acute isn't printed correctly.

in my case, I'm under Windows

R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
 LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] RStoolbox_0.1.1 raster_2.3-40   sp_1.0-17

loaded via a namespace (and not attached):
 [1] car_2.0-25         caret_6.0-57       codetools_0.2-9
 colorspace_1.2-6   digest_0.6.8       doParallel_1.0.8
 [7] foreach_1.4.2      geosphere_1.4-3    ggplot2_1.0.1      grid_3.1.2
      gtable_0.1.2       iterators_1.0.7
[13] lattice_0.20-29    lme4_1.1-10        magrittr_1.5       MASS_7.3-35
     Matrix_1.2-2       MatrixModels_0.4-1
[19] mgcv_1.8-3         minqa_1.2.4        munsell_0.4.2      nlme_3.1-118
      nloptr_1.0.4       nnet_7.3-8
[25] parallel_3.1.2     pbkrtest_0.4-2     plyr_1.8.3         proto_0.3-10
      quantreg_5.19      Rcpp_0.12.0
[31] reshape2_1.4.1     rgeos_0.3-8        scales_0.2.5       SparseM_1.7
     splines_3.1.2      stats4_3.1.2
[37] stringi_0.5-5      stringr_1.0.0      tools_3.1.2        XML_3.98-1.3


2016-01-21 14:55 GMT+01:00 Edzer Pebesma <edzer.pebesma at uni-muenster.de>:

> Mathieu, I can't reproduce this on ubuntu 14.04:
>
> >
> > cat("first \U00E9 \n")
> first é
> > cat("--before--\n")
> --before--
> > cat(paste("encoding = ", getOption("encoding"), "\n"))
> encoding =  native.enc
> > cat(paste("locale = ", Sys.getlocale(), "\n"))
> locale =
>
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
>
> > # suppressMessages(suppressWarnings(require("RStoolbox", quietly =
> TRUE)))
> > # provoque erreurs accent e aigu
> > require("RStoolbox")
> Loading required package: RStoolbox
> > cat("\n")
>
> > cat("--after--\n")
> --after--
> > cat(paste("encoding = ", getOption("encoding"),"\n"))
> encoding =  native.enc
> > cat(paste("locale = ", Sys.getlocale(), "\n"))
> locale =
>
> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
>
> > cat(" second \U00E9")
>  second é> sessionInfo()
> R version 3.2.3 (2015-12-10)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 14.04.3 LTS
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] RStoolbox_0.1.3
>
> loaded via a namespace (and not attached):
>  [1] Rcpp_0.12.2        raster_2.5-2       magrittr_1.5
> splines_3.2.3
>  [5] MASS_7.3-44        doParallel_1.0.10  munsell_0.4.2
> geosphere_1.5-1
>  [9] colorspace_1.2-6   lattice_0.20-33    foreach_1.4.3
> minqa_1.2.4
> [13] stringr_1.0.0      car_2.1-0          plyr_1.8.3
> tools_3.2.3
> [17] parallel_3.2.3     nnet_7.3-11        pbkrtest_0.4-2
> caret_6.0-64
> [21] grid_3.2.3         gtable_0.1.2       nlme_3.1-123       mgcv_1.8-7
>
> [25] quantreg_5.19      rgeos_0.3-15       MatrixModels_0.4-1
> iterators_1.0.8
> [29] lme4_1.1-10        Matrix_1.2-3       nloptr_1.0.4
> reshape2_1.4.1
> [33] ggplot2_2.0.0      codetools_0.2-14   sp_1.2-2
> stringi_1.0-1
> [37] scales_0.3.0       XML_3.98-1.3       stats4_3.2.3       SparseM_1.7
>
> On 21/01/16 13:58, Mathieu Rajerison wrote:
> > Hi,
> >
> > This post is not spatially-oriented but deals with an excellent spatial R
> > package named RStoobox for remote sensing.
> >
> > I have a process that prints advancement operations with cat() functions.
> > Some contain e acute as it is for french administrations.
> >
> > I noticed I had problems with the writing of e acutes after loading
> > RStoolbox package. I noticed the same with igraph as well
> >
> > If I write an R file with the following lines :
> >
> > cat("first \U00E9")
> > require("RStoolbox")
> > cat(" second \U00E9")
> >
> > It gives
> >
> > first é
> > second Ú
> >
> > If I load another package like raster, the problem doesn't appear.
> >
> > To see if there was any change relative to encodings, I wrote an R file
> > with the following lines which gives the system encoding before and
> after :
> >
> > cat("first \U00E9 \n")
> > cat("--before--\n")
> > cat(paste("encoding = ", getOption("encoding"), "\n"))
> > cat(paste("locale = ", Sys.getlocale(), "\n"))
> > # suppressMessages(suppressWarnings(require("RStoolbox", quietly =
> TRUE)))
> > # provoque erreurs accent e aigu
> > require("RStoolbox")
> > cat("\n")
> > cat("--after--\n")
> > cat(paste("encoding = ", getOption("encoding"),"\n"))
> > cat(paste("locale = ", Sys.getlocale(), "\n"))
> > cat(" second \U00E9")
> >
> > But there isn't any change :
> >
> > first é
> > --before--
> > encoding =  native.enc
> > locale =
> >  LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=
> > French_France.1252;LC_NUMERIC=C;LC_TIME=French_France.1252
> > Le chargement a nécessité le package : RStoolbox
> > Message d'avis :
> > le package 'RStoolbox' a ÚtÚ compilÚ avec la version R 3.1.3
> >
> > --after--
> > encoding =  native.enc
> > locale =
> >  LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=
> > French_France.1252;LC_NUMERIC=C;LC_TIME=French_France.1252
> >  second Ú
> >
> > So, i wonder where does this come from ? And how to deal with it
> >
> > Thanks in advance for your answers,
> >
> > Mathieu
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics  (ifgi),  University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
> Journal of Statistical Software:   http://www.jstatsoft.org/
> Computers & Geosciences:   http://elsevier.com/locate/cageo/
> Spatial Statistics Society http://www.spatialstatistics.info
>
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list