[Rd] Why is R in Japanese (only in Mac terminal)?
Since a while ago, R on my Mac terminal is being started in Japanese: R version 3.5.2 (2018-12-20) -- "Eggshell Igloo" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit) R は、自由なソフトウェアであり、「完全に無保証」です。 一定の条件に従えば、自由にこれを再配布することができます。 配布条件の詳細に関しては、'license()' あるいは 'licence()' と入力してください。 Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. 'demo()' と入力すればデモをみることができます。 'help()' とすればオンラインヘルプが出ます。 'help.start()' で HTML ブラウザによるヘルプがみられます。 'q()' と入力すれば R を終了します。 I never gave it too much mind since I understand Japanese and am mostly working in RStudio anyway (RStudio is in English). But I found a "bug" in testthat's is_english (which tests whether the current session is reporting base messages in English) and reported here: https://github.com/r-lib/testthat/issues/879 I say "bug" because as near as I can tell is_english is built assuming the logic laid out in ?gettext, ?locales. So even though my machine appears to have none of the "symptoms" of a non-English locale, nevertheless I get Japanese. My session info: R version 3.5.2 (2018-12-20) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib locale: [1] C/UTF-8/C/C/C/C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.5.2 My Sys.getenv() and "Languages & Region" settings are in the issue link. Where else should I be looking in my R session or terminal to figure out why it's in Japanese? Mike C [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Converting non-32-bit integers from python to R to use bit64: reticulate
Dear R Developers, There is an interesting issue related to "reticulate" R package which discusses how to convert Python's non-32 bit integers to R, which has had quite an exhaustive discussion: https://github.com/rstudio/reticulate/issues/323 Python seems to handle integers differently from R, and is dependant on the system arquitecture: On 32 bit systems uses 32-bit integers, and on 64-bit systems uses 64-bit integers. So my question is: As regards R's C Interface, how costly would it be to convert INTSXP from 32 bits to 64 bits using C, on 64 bits Systems? Do the benefits surpass the costs? And should such development be handled from within R Core / Ordinary Members , or it shall be left to package maintainers? Thank you! :) [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Converting non-32-bit integers from python to R to use bit64: reticulate
Hi Juan, Comments inline. On Wed, May 29, 2019 at 12:48 PM Juan Telleria Ruiz de Aguirre < jtelleria.rproj...@gmail.com> wrote: > Dear R Developers, > > There is an interesting issue related to "reticulate" R package which > discusses how to convert Python's non-32 bit integers to R, which has had > quite an exhaustive discussion: > > https://github.com/rstudio/reticulate/issues/323 > > Python seems to handle integers differently from R, and is dependant on the > system arquitecture: On 32 bit systems uses 32-bit integers, and on 64-bit > systems uses 64-bit integers. > > So my question is: > > As regards R's C Interface, how costly would it be to convert INTSXP from > 32 bits to 64 bits using C, on 64 bits Systems? Do the benefits surpass the > costs? And should such development be handled from within R Core / Ordinary > Members , or it shall be left to package maintainers? > Well, I am not an R-core member, but I can mention a few things: 1. This seems like it would make the results of R code non-reproducible between 32 and 64bit versions of R; at least some code would give different results (at the very least in terms of when integer values overflow to NA, which is documented behavior). 2. Obviously all integer data would take twice as much memory, memory bandwidth, space in caches, etc, even when it doesn't need it. 3. Various places treat data /data pointers coming out of INTSXP and LGLSXP objects the same within the internal R sources (as currently they're both int/int*). Catching and fixing all those wouldn't be impossible, but it would take at least some doing. For me personally 1 seems like a big problem, and 3 makes the conversion more work than it might have seemed initially. As a related side note, as far as I understand what I've heard from R-core members directly, the choice to not have multiple types of integers is intentional and unlikely to change. Best, ~G > > Thank you! :) > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Making a package CITATION file from BibTeX
Dear Colleagues, I would like to provide a CITATION file for my package nat.nblast [1]. I have the correct citation in BibTeX format [2]. How can I convert this BibTeX to the format needed by R for a package CITATION file (I have a lot of other packages needing citations ...). I think what I need is the opposite of RefManageR::toBiblatex [3]. This seems like it should be a common need, so I feel sure I must be missing something, but I can't seem to google up any hints. With many thanks, Greg Jefferis. [1] http://github.com/jefferislab/nat.nblast https://cran.r-project.org/package=nat.nblast [2] @article{Costa:2016aa, Author = {Costa, Marta and Manton, James D and Ostrovsky, Aaron D and Prohaska, Steffen and Jefferis, Gregory S X E}, Doi = {10.1016/j.neuron.2016.06.012}, Journal = {Neuron}, Month = {Jul}, Number = {2}, Pages = {293-311}, Title = {NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases}, Volume = {91}, Year = {2016}} [3] https://rdrr.io/github/ropensci/RefManageR/man/toBiblatex.html -- Gregory Jefferis Division of Neurobiology MRC Laboratory of Molecular Biology Francis Crick Avenue Cambridge Biomedical Campus Cambridge, CB2 OQH, UK http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://jefferislab.org http://www.zoo.cam.ac.uk/departments/connectomics __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Making a package CITATION file from BibTeX
On Thu, 30 May 2019, Dr Gregory Jefferis wrote: Dear Colleagues, I would like to provide a CITATION file for my package nat.nblast [1]. I have the correct citation in BibTeX format [2]. How can I convert this BibTeX to the format needed by R for a package CITATION file (I have a lot of other packages needing citations ...). (1) You can use read.bib() from the "bibtex" package to read the .bib file containing the relevant reference. (2) This gives you a "bibentry" object that can be turned into the R code generating it with format(..., style = "R") from the basic "utils" package. (3) Then you can writeLines() this R code on the console or writeLines(..., "CITATION") to a CITATION file. (4) Optionally you can also include a $header in your bibentry with a short introductory sentence. Or if you have multiple references to go into the same CITATION you might want to include a $header for each and an $mheader for everything. A worked example is included below. Background information is given in: https://doi.org/10.32614/RJ-2012-009 Let's assume that your BibTeX entry [2] is the first entry in a file called "my.bib". Then you can do: ## read first item from BibTeX as "bibentry" object b <- bibtex::read.bib("my.bib")[[1]] ## delete the bib key and add a header for the citation b$key <- NULL b$header <- "To cite nat.nblast in publications use:" ## turn the "bibentry" into the R code generating it b <- format(b, style = "R") ## write the R code to the console writeLines(b) bibentry(bibtype = "Article", header = "To cite nat.nblast in publications use:", author = c(person(given = "Marta", family = "Costa"), person(given = c("James", "D"), family = "Manton"), person(given = c("Aaron", "D"), family = "Ostrovsky"), person(given = "Steffen", family = "Prohaska"), person(given = c("Gregory", "S", "X", "E"), family = "Jefferis")), doi = "10.1016/j.neuron.2016.06.012", journal = "Neuron", month = "Jul", number = "2", pages = "293-311", title = "NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases", volume = "91", year = "2016") I think what I need is the opposite of RefManageR::toBiblatex [3]. This seems like it should be a common need, so I feel sure I must be missing something, but I can't seem to google up any hints. With many thanks, Greg Jefferis. [1] http://github.com/jefferislab/nat.nblast https://cran.r-project.org/package=nat.nblast [2] @article{Costa:2016aa, Author = {Costa, Marta and Manton, James D and Ostrovsky, Aaron D and Prohaska, Steffen and Jefferis, Gregory S X E}, Doi = {10.1016/j.neuron.2016.06.012}, Journal = {Neuron}, Month = {Jul}, Number = {2}, Pages = {293-311}, Title = {NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases}, Volume = {91}, Year = {2016}} [3] https://rdrr.io/github/ropensci/RefManageR/man/toBiblatex.html -- Gregory Jefferis Division of Neurobiology MRC Laboratory of Molecular Biology Francis Crick Avenue Cambridge Biomedical Campus Cambridge, CB2 OQH, UK http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://jefferislab.org http://www.zoo.cam.ac.uk/departments/connectomics __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Making a package CITATION file from BibTeX
I believe r-package-devel is the proper list for this. Now in CC. On Thu, 30 May 2019 at 00:16, Dr Gregory Jefferis wrote: > > Dear Colleagues, > > I would like to provide a CITATION file for my package nat.nblast [1]. > > I have the correct citation in BibTeX format [2]. How can I convert this > BibTeX to the format needed by R for a package CITATION file (I have a > lot of other packages needing citations ...). > > I think what I need is the opposite of RefManageR::toBiblatex [3]. This > seems like it should be a common need, so I feel sure I must be missing > something, but I can't seem to google up any hints. There's a specific section in the manual about this (1.9 CITATION files), and lots of examples out there. Here's one: https://github.com/r-simmer/simmer/blob/master/inst/CITATION Iñaki __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] R pkg install should fail for unsuccessful DLL copy on windows?
Hi all, I am having an issue related to installing packages on windows with R-3.6.0. When installing a package that is in use, I expected R to stop with an error. However I am getting a warning that the DLL copy was not successful, but the overall package installation IS successful. This is quite dangerous because the old DLL and the new R code could be incompatible. I am definitely not the first person to have this issue. * Matt Dowle reported https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478 which was never addressed. * Jim Hester reported https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17453 which was apparently addressed in R-3.5.1, via https://github.com/wch/r-source/commit/828a04f9c428403e476620b1905a1d8ca41d0bcd But I am now having the same issue in R-3.6.0 -- is this a regression in R? or is there another fix that I can use? Below is the minimal R code that I used to reproduce the issue. Essentially, * I start R with --vanilla and set options repos=cloud and warn=2 (which I expect should convert warnings to errors). * I do library(penaltyLearning) and then install the package from source, which results in the warnings. I expected there should be an error. th798@cmp2986 MINGW64 ~/R $ R --vanilla -e "options(repos='https://cloud.r-project.org', warn=2);library(penaltyLearning);install.packages('penaltyLearning', type='source');getOption('warn');sessionInfo()" R version 3.6.0 (2019-04-26) -- "Planting of a Tree" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > options(repos='https://cloud.r-project.org', warn=2);library(penaltyLearning);install.packages('penaltyLearning', type='source');getOption('warn');sessionInfo() Loading required package: data.table Registered S3 methods overwritten by 'ggplot2': method from [.quosures rlang c.quosures rlang print.quosures rlang trying URL ' https://cloud.r-project.org/src/contrib/penaltyLearning_2018.09.04.tar.gz' Content type 'application/x-gzip' length 2837289 bytes (2.7 MB) == downloaded 2.7 MB * installing *source* package 'penaltyLearning' ... ** package 'penaltyLearning' successfully unpacked and MD5 sums checked ** using staged installation ** libs c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -O2 -Wall -mtune=generic -c interface.cpp -o interface.o c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -O2 -Wall -mtune=generic -c largestContinuousMinimum.cpp -o largestContinuousMinimum.o largestContinuousMinimum.cpp: In function 'int largestContinuousMinimum(int, double*, double*, int*)': largestContinuousMinimum.cpp:38:27: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized] index_vec[0] = start; ^ c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" -DNDEBUG -O2 -Wall -mtune=generic -c modelSelection.cpp -o modelSelection.o /usr/bin/sed: -e expression #1, char 1: unknown command: `C' c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o penaltyLearning.dll tmp.def interface.o largestContinuousMinimum.o modelSelection.o -LC:/PROGRA~1/R/R-36~1.0/bin/x64 -lR installing to C:/Program Files/R/R-3.6.0/library/00LOCK-penaltyLearning/00new/penaltyLearning/libs/x64 ** R ** data ** byte-compile and prepare package for lazy loading ** help *** installing help indices converting help for package 'penaltyLearning' finding HTML links ... done GeomTallRecthtml IntervalRegressionCVhtml IntervalRegressionCVmargin html IntervalRegressionInternal html IntervalRegressionRegularized html IntervalRegressionUnregularized html ROChangehtml change.colors html change.labels html changeLabel html check_features_targets html check_target_pred html coef.IntervalRegression html demo8 html featureMatrix html featureVector html geom_tallrect html labelError html largestContinuousMinimumC html
Re: [Rd] Making a package CITATION file from BibTeX
Dear Achim, Thank you so much for taking the time to write out a perfect response to my question. I hope it will soon be available for others to google! @Inaki: Thank you. You are quite right. I intended to write to r-package-devel. Achim's reply is still copied below for users of that list. All the best, Greg. On 29 May 2019, at 23:46, Achim Zeileis wrote: On Thu, 30 May 2019, Dr Gregory Jefferis wrote: Dear Colleagues, I would like to provide a CITATION file for my package nat.nblast [1]. I have the correct citation in BibTeX format [2]. How can I convert this BibTeX to the format needed by R for a package CITATION file (I have a lot of other packages needing citations ...). (1) You can use read.bib() from the "bibtex" package to read the .bib file containing the relevant reference. (2) This gives you a "bibentry" object that can be turned into the R code generating it with format(..., style = "R") from the basic "utils" package. (3) Then you can writeLines() this R code on the console or writeLines(..., "CITATION") to a CITATION file. (4) Optionally you can also include a $header in your bibentry with a short introductory sentence. Or if you have multiple references to go into the same CITATION you might want to include a $header for each and an $mheader for everything. A worked example is included below. Background information is given in: https://doi.org/10.32614/RJ-2012-009 Let's assume that your BibTeX entry [2] is the first entry in a file called "my.bib". Then you can do: ## read first item from BibTeX as "bibentry" object b <- bibtex::read.bib("my.bib")[[1]] ## delete the bib key and add a header for the citation b$key <- NULL b$header <- "To cite nat.nblast in publications use:" ## turn the "bibentry" into the R code generating it b <- format(b, style = "R") ## write the R code to the console writeLines(b) bibentry(bibtype = "Article", header = "To cite nat.nblast in publications use:", author = c(person(given = "Marta", family = "Costa"), person(given = c("James", "D"), family = "Manton"), person(given = c("Aaron", "D"), family = "Ostrovsky"), person(given = "Steffen", family = "Prohaska"), person(given = c("Gregory", "S", "X", "E"), family = "Jefferis")), doi = "10.1016/j.neuron.2016.06.012", journal = "Neuron", month = "Jul", number = "2", pages = "293-311", title = "NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases", volume = "91", year = "2016") I think what I need is the opposite of RefManageR::toBiblatex [3]. This seems like it should be a common need, so I feel sure I must be missing something, but I can't seem to google up any hints. With many thanks, Greg Jefferis. [1] http://github.com/jefferislab/nat.nblast https://cran.r-project.org/package=nat.nblast [2] @article{Costa:2016aa, Author = {Costa, Marta and Manton, James D and Ostrovsky, Aaron D and Prohaska, Steffen and Jefferis, Gregory S X E}, Doi = {10.1016/j.neuron.2016.06.012}, Journal = {Neuron}, Month = {Jul}, Number = {2}, Pages = {293-311}, Title = {NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases}, Volume = {91}, Year = {2016}} [3] https://rdrr.io/github/ropensci/RefManageR/man/toBiblatex.html -- Gregory Jefferis Division of Neurobiology MRC Laboratory of Molecular Biology Francis Crick Avenue Cambridge Biomedical Campus Cambridge, CB2 OQH, UK http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://jefferislab.org http://www.zoo.cam.ac.uk/departments/connectomics __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Gregory Jefferis, PhD Tel: +44 1223 267048 Division of Neurobiology MRC Laboratory of Molecular Biology Francis Crick Avenue Cambridge Biomedical Campus Cambridge, CB2 OQH, UK http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis http://jefferislab.org http://www.zoo.cam.ac.uk/departments/connectomics __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R pkg install should fail for unsuccessful DLL copy on windows?
Hi Toby, AFAIK it has not been addressed in R. You can handle the problem on your package side, see https://github.com/Rdatatable/data.table/pull/3237 Regards, Jan On Thu, May 30, 2019 at 4:46 AM Toby Hocking wrote: > > Hi all, > > I am having an issue related to installing packages on windows with > R-3.6.0. When installing a package that is in use, I expected R to stop > with an error. However I am getting a warning that the DLL copy was not > successful, but the overall package installation IS successful. This is > quite dangerous because the old DLL and the new R code could be > incompatible. > > I am definitely not the first person to have this issue. > * Matt Dowle reported > https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478 which was never > addressed. > * Jim Hester reported > https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17453 which was > apparently addressed in R-3.5.1, via > https://github.com/wch/r-source/commit/828a04f9c428403e476620b1905a1d8ca41d0bcd > > But I am now having the same issue in R-3.6.0 -- is this a regression in R? > or is there another fix that I can use? > > Below is the minimal R code that I used to reproduce the issue. Essentially, > * I start R with --vanilla and set options repos=cloud and warn=2 (which I > expect should convert warnings to errors). > * I do library(penaltyLearning) and then install the package from source, > which results in the > warnings. I expected there should be an error. > > th798@cmp2986 MINGW64 ~/R > $ R --vanilla -e "options(repos='https://cloud.r-project.org', > warn=2);library(penaltyLearning);install.packages('penaltyLearning', > type='source');getOption('warn');sessionInfo()" > > R version 3.6.0 (2019-04-26) -- "Planting of a Tree" > Copyright (C) 2019 The R Foundation for Statistical Computing > Platform: x86_64-w64-mingw32/x64 (64-bit) > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for an HTML browser interface to help. > Type 'q()' to quit R. > > > options(repos='https://cloud.r-project.org', > warn=2);library(penaltyLearning);install.packages('penaltyLearning', > type='source');getOption('warn');sessionInfo() > Loading required package: data.table > Registered S3 methods overwritten by 'ggplot2': > method from > [.quosures rlang > c.quosures rlang > print.quosures rlang > trying URL ' > https://cloud.r-project.org/src/contrib/penaltyLearning_2018.09.04.tar.gz' > Content type 'application/x-gzip' length 2837289 bytes (2.7 MB) > == > downloaded 2.7 MB > > * installing *source* package 'penaltyLearning' ... > ** package 'penaltyLearning' successfully unpacked and MD5 sums checked > ** using staged installation > ** libs > c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" > -DNDEBUG -O2 -Wall -mtune=generic -c interface.cpp -o interface.o > c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" > -DNDEBUG -O2 -Wall -mtune=generic -c largestContinuousMinimum.cpp > -o largestContinuousMinimum.o > largestContinuousMinimum.cpp: In function 'int > largestContinuousMinimum(int, double*, double*, int*)': > largestContinuousMinimum.cpp:38:27: warning: 'start' may be used > uninitialized in this function [-Wmaybe-uninitialized] >index_vec[0] = start; >^ > c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-36~1.0/include" > -DNDEBUG -O2 -Wall -mtune=generic -c modelSelection.cpp -o > modelSelection.o > /usr/bin/sed: -e expression #1, char 1: unknown command: `C' > c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o penaltyLearning.dll > tmp.def interface.o largestContinuousMinimum.o modelSelection.o > -LC:/PROGRA~1/R/R-36~1.0/bin/x64 -lR > installing to C:/Program > Files/R/R-3.6.0/library/00LOCK-penaltyLearning/00new/penaltyLearning/libs/x64 > ** R > ** data > ** byte-compile and prepare package for lazy loading > ** help > *** installing help indices > converting help for package 'penaltyLearning' > finding HTML links ... done > GeomTallRecthtml > IntervalRegressionCVhtml > IntervalRegressionCVmargin html > IntervalRegressionInternal html > IntervalRegressionRegularized html > IntervalRegressionUnregularized html > ROChangehtml > change.colors html > change.labels html > changeLabel html > check_features_tar