Re: [R] Problem when trying to install packages
On 16.03.2024 10:48, javad bayat wrote: Dear all; I found a useful video on youtube that has explained how to install Rtools. I followed the instructions and the problem was solved. " Installing R version 4.0 + RTools 4.0 + RStudio For Data Science (#R ?? A recent set of released software would be Rtools43 + R-4.3.3 Best, Uwe Ligges #RTools #RStudio #DataScience) - YouTube <https://www.youtube.com/watch?v=h2IPWVXaUuU> " Sincerely On Sat, Mar 16, 2024 at 10:15 AM Bert Gunter wrote: Though Navigator may mess up any Rtools stuff because it handles the directory trees where packages and dependencies are located, does it not? If so, maybe just reinstall RStudio directly from its website to proceed. Just a guess obviously. Bert On Sat, Mar 16, 2024, 05:09 javad bayat wrote: Dear Rui; Many thanks for your reply. I have installed Rtools (rtools43-5958-5975) on my PC and I have R version 4.3.3 and 4.3.2 to install. Also I have installed Rstudio through Anaconda Navigator. But I do not know how to use Rtools for installing the R packages. I would be more than happy if you help me. Sincerely yours Dear Rui; I hope this email finds you well. I have a problem installing packages in Rstudio and R software. When I try to install a package, the software tries to download but after downloading, it gives some errors and does not work. I would be more than happy if you please help me to solve this issue. Warm regards. install.packages("openair", type = "source")Installing package into ‘C:/R_Libs’ (as ‘lib’ is unspecified)Warning in install.packages : dependencies ‘lattice’, ‘MASS’ are not availablealso installing the dependencies ‘deldir’, ‘RcppEigen’, ‘cli’, ‘glue’, ‘lifecycle’, ‘pillar’, ‘rlang’, ‘tibble’, ‘tidyselect’, ‘vctrs’, ‘png’, ‘jpeg’, ‘interp’, ‘timechange’, ‘maps’, ‘nlme’, ‘Matrix’, ‘cluster’, ‘dplyr’, ‘hexbin’, ‘latticeExtra’, ‘lubridate’, ‘mapproj’, ‘mgcv’, ‘purrr’ trying URL ' https://cran.rstudio.com/src/contrib/deldir_2.0-4.tar.gz'Content type 'application/x-gzip' length 103621 bytes (101 KB)downloaded 101 KB trying URL ' https://cran.rstudio.com/src/contrib/RcppEigen_0.3.4.0.0.tar.gz'Content type 'application/x-gzip' length 1765714 bytes (1.7 MB)downloaded 1.7 MB trying URL ' https://cran.rstudio.com/src/contrib/cli_3.6.2.tar.gz'Content type 'application/x-gzip' length 569771 bytes (556 KB)downloaded 556 KB trying URL ' https://cran.rstudio.com/src/contrib/glue_1.7.0.tar.gz'Content type 'application/x-gzip' length 105420 bytes (102 KB)downloaded 102 KB trying URL ' https://cran.rstudio.com/src/contrib/lifecycle_1.0.4.tar.gz'Content type 'application/x-gzip' length 107656 bytes (105 KB)downloaded 105 KB trying URL ' https://cran.rstudio.com/src/contrib/pillar_1.9.0.tar.gz'Content type 'application/x-gzip' length 444528 bytes (434 KB)downloaded 434 KB trying URL ' https://cran.rstudio.com/src/contrib/rlang_1.1.3.tar.gz'Content type 'application/x-gzip' length 763765 bytes (745 KB)downloaded 745 KB trying URL ' https://cran.rstudio.com/src/contrib/tibble_3.2.1.tar.gz'Content type 'application/x-gzip' length 565982 bytes (552 KB)downloaded 552 KB trying URL ' https://cran.rstudio.com/src/contrib/tidyselect_1.2.1.tar.gz'Content type 'application/x-gzip' length 103591 bytes (101 KB)downloaded 101 KB trying URL ' https://cran.rstudio.com/src/contrib/vctrs_0.6.5.tar.gz'Content type 'application/x-gzip' length 969066 bytes (946 KB)downloaded 946 KB trying URL ' https://cran.rstudio.com/src/contrib/png_0.1-8.tar.gz'Content type 'application/x-gzip' length 24880 bytes (24 KB)downloaded 24 KB trying URL ' https://cran.rstudio.com/src/contrib/jpeg_0.1-10.tar.gz'Content type 'application/x-gzip' length 18667 bytes (18 KB)downloaded 18 KB trying URL ' https://cran.rstudio.com/src/contrib/interp_1.1-6.tar.gz'Content type 'application/x-gzip' length 1112116 bytes (1.1 MB)downloaded 1.1 MB trying URL ' https://cran.rstudio.com/src/contrib/timechange_0.3.0.tar.gz'Content type 'application/x-gzip' length 103439 bytes (101 KB)downloaded 101 KB trying URL ' https://cran.rstudio.com/src/contrib/maps_3.4.2.tar.gz'Content type 'application/x-gzip' length 2278051 bytes (2.2 MB)downloaded 2.2 MB trying URL ' https://cran.rstudio.com/src/contrib/nlme_3.1-164.tar.gz'Content type 'application/x-gzip' length 836832 bytes (817 KB)downloaded 817 KB trying URL ' https://cran.rstudio.com/src/contrib/Matrix_1.6-5.tar.gz'Content type 'application/x-gzip' length 2883851 bytes (2.8 MB)downloaded 2.8 MB trying URL ' https://cran.rstudio.com/src/contrib/cluster_2.1.6.tar.gz'Content type 'application/x-gzip' length 369050 bytes (360 KB)downloaded 360 KB trying URL ' https://cran.rstudio.com/src/contrib/dplyr_1.1.4.tar.gz'Content type 'application/x-gzip' length 1207521 bytes (1.2 MB)downloaded 1.2 MB trying URL ' https://cran.rstudio.com/src/contrib/hexbin_1.28.3.tar.gz'Content type 'application/x-gzip' length 1199967 bytes
Re: [R] anyone having trouble accesing CRAN?
Yes, the sysadmins at WU Vienna are upgrading the CRAN master. The mirrors should not be affected. Best, Uwe Ligges On 15.11.2023 20:25, Rui Barradas wrote: Às 19:13 de 15/11/2023, Christopher W. Ryan via R-help escreveu: at https://cran.r-project.org/ I get this error message: = Secure Connection Failed An error occurred during a connection to cran.r-project.org. PR_END_OF_FILE_ERROR Error code: PR_END_OF_FILE_ERROR The page you are trying to view cannot be shown because the authenticity of the received data could not be verified. === Three different browsers, two different devices, two different networks. (The text of the error messages varies.) Anyone seeing similar? Thanks. --Chris Ryan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Hello, Yes, CRAN is down. I know last week there was an anouncement about a maintenance scheduled but I cannot place that e-mail right now and don't remember the date exactly so I cannot say for sure this is what is happening. But it is probably a scheduled maintenance. Rui Barradas __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Dependency errors for package pracma
On 09.11.2023 06:42, Hans W wrote: I tried to update my package {pracma} on CRAN from 2.4.2 (2022-09-21) to version 2.4.4 (2023-11-08). This package reverse depends / imports / suggests on 350 packages on CRAN and 25 packages on Bioconductor. The only changes are small corrections on some help files, a new function for stereographic projection, and `gcd` and `Lcm` require integer inputs now (these functions are not used in the packages below). I received a dependency report saying that *** Changes to worse in reverse dependencies *** celltrackR, geostatsp, gmvjoint, hypr, randnet Most are from a recent Matrix update, hypr might not, so please check the above and tell us whether pracma casuses one of the issues (hypr?) and whether the maintainer has been informed in advance. Example: geostatsp suggests pracma, but uses only the function 'trapz' that has not changed for years and years. I cannot check this package, as probably other packages (from Bioconductor ?) are needed to install it. Example: gmvjoint imports pracma and uses 'grad', 'hessian', and 'nearest_spd'; these functions have not changed for years. On my system, gmvjoint gets checked without ERRORs ! What should I do? Frankly, I do not have the time to check these packages or to test almost 400 packages before uploading to CRAN. The CRAN policies point you to functionality so that you can simply run these checks autiomatically on your machine. Let me read it for you: "For a package update, please check that any packages depending on this one still pass R CMD check: it is especially expected that you will have checked your own packages. Reverse dependencies can conveniently be checked using tools::check_packages_in_dir(reverse = list()), and changes in check status subsequently be analyzed using tools::check_packages_in_dir_changes(). A listing of the reverse dependencies of the current version can be found on the CRAN web page for the package, or be obtained via tools::package_dependencies(reverse = TRUE). If possible, check reverse strong dependencies, reverse suggests and the recursive strong dependencies of these (by tools::package_dependencies(reverse = TRUE, which = "most", recursive = "strong")). " Best, Uwe Ligges Okay, I can leave it as is and wait until it gets thrown off CRAN (because of some new syntax checks, e.g.). I will not mind much. Are there better alternatives? Thanks, Hans Werner __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Linear discriminant analysis
On 12.10.2023 16:25, Fernando Archuby wrote: Hi. I have successfully performed the discriminant analysis with the lda function, I can classify new individuals with the predict function, but I cannot figure out how the lda results translate into the classification decision. That is, I don't realize how the classification equation for new individuals is constructed from the lda output. I want to understand it but also, I need to communicate it and provide a mechanism for other colleagues to make classifications with their data. Thank you very much, Fernando Do you want to know the principles of the theory behind LDA? That is available in lots of textbooks. Do you want the implementation detials of MASS::lda()? That is hard. It is based (but does not follow in all details) on a paper by Nils Hjort from Norway. A former student of mine, Swetlana Herbrandt, has analysed and reverse engineered the code and wrote down the theory in a German thesis. The implementation uses some nice tricks to get numerically rather stable results that are typically not mentioned in any textbook. Do you really want to do prediction with LDA? I typically look at classificatuion performance of LDA as a reference to compare better and more modern techniques with. I think you should ask some trained local statistician for advise on both, the LDA theory and for prediction in general. Best, Uwe Ligges __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with compatible library versions
No. In 10 years you may have different hardware and a different OS, so that the old R and old packages won't run on the new hardware or produce different results. This may even happen for some sort of containers and virtualizations. To be really safe, you ideally need to keep the whole system as is (but then there are security updates etc). Best, Uwe Ligges On 11.10.2023 14:54, Ebert,Timothy Aaron wrote: Is that a method where a program that I write today would still run without changes in 10 years? Tim -Original Message- From: R-help On Behalf Of Richard O'Keefe Sent: Wednesday, October 11, 2023 8:08 AM To: Uwe Ligges Cc: r-help@r-project.org Subject: Re: [R] Problem with compatible library versions [External Email] There is a fairly straightforward way to load older versions of packages, and that is to use the 'groundhog' package. As the first sentence of https://groundhogr.com/ puts it: Make your R scripts reproducible by replacing library(pkg) with groundhog.library(pkg, date). pkg can be a vector of package names or a single name. On Wed, 11 Oct 2023 at 20:58, Uwe Ligges wrote: On 10.10.2023 17:34, Sabine Braun wrote: On the github website I have reported several bugs with new versions of the tidyverse group (probably dplyr) which prevent me from using R normally. I wanted to go back to older versions but this seems not bo be easy. I downloaded R 4.1.2. and Rtools 40 but the library versions So this is on Windows. Actually, if you install R-4.1.2 and use a clean library and install binaries, then you should get binary installation from CRAN that fit to the R-4.1.x series. If you want to install older package versions, then you have to install these one by one from sources, unfortunately. Best, Uwe Ligges installed are still the newest ones. I was able to install dplyr 1.0.7. manually but there are error messages on incompatibility when loading this version. Is there a possibility to load older library versions which alre compatible ? Thank you very much! Best regards Sabine Braun __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat/ .ethz.ch%2Fmailman%2Flistinfo%2Fr-help=05%7C01%7Ctebert%40ufl.edu %7C86c81ebb0b184971b4eb08dbca52d5b3%7C0d4da0f84a314d76ace60a62331e1b84 %7C0%7C0%7C638326229351781447%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C ta=kEpdr7GlTQwcaKCMfI0NJfWXrgCshp5DVALyiu%2FHG4I%3D=0 PLEASE do read the posting guide http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with compatible library versions
On 10.10.2023 17:34, Sabine Braun wrote: On the github website I have reported several bugs with new versions of the tidyverse group (probably dplyr) which prevent me from using R normally. I wanted to go back to older versions but this seems not bo be easy. I downloaded R 4.1.2. and Rtools 40 but the library versions So this is on Windows. Actually, if you install R-4.1.2 and use a clean library and install binaries, then you should get binary installation from CRAN that fit to the R-4.1.x series. If you want to install older package versions, then you have to install these one by one from sources, unfortunately. Best, Uwe Ligges installed are still the newest ones. I was able to install dplyr 1.0.7. manually but there are error messages on incompatibility when loading this version. Is there a possibility to load older library versions which alre compatible ? Thank you very much! Best regards Sabine Braun __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Gigs
On 07.10.2023 10:45, Dr Eberhard Lisse wrote: LinkedIn is what seems to go these days Well, for those some years older it would certainly help not to use words such as "gigs" (I first assumed gigabytes of data were meant). Apparently the original poster is looking for some employment, but we do not even know the country nor what the capabilities are. Honestly, given that mail message, I would not even offer to supervise any voluntary tasks. My personal classification was "spam", hence not replying to the OP. Best, Uwe Ligges el On 2023-10-06 22:35 , Bert Gunter wrote: May be an age gap here, but I assume "gigs" = freelance jobs. If so, https://stat.ethz.ch/mailman/listinfo/r-sig-jobs might be useful. As well as an online search in all the usual places. Otherwise, please excuse my out-of-date ignorance. [...] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Installing R 3.1.2
See https://cran.r-project.org/bin/windows/base/old/ Version 4.1.3 is the latest that supports 32 bit WIndows, as far as I remember. A passwort is not required. Best, Uwe Ligges On 06.09.2023 05:53, Ali Mahdi wrote: Hi I get trouble in installing R programing language as a newest version but my windows is old version (7-32) so I search in archive for old version( 3.1.2) but when I try to extract the file by peazip I found it demand a password, Can you help me in this trouble please Sent from my iPhone __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Style guide when using "R" in a title
On 26.07.2023 23:48, Wadsworth, Spencer G [STAT] wrote: Hello, I am working on a small booklet to be used with an existing statistics textbook. The purpose of the booklet is to give worked through examples from the textbook using R code and it will be made publicly available with the textbook. The title of the booklet is "R Code Supplement for Basic Engineering Data Collection and Analysis by Vardeman and Jobe". Someone with whom I'm working on the booklet said that the "R" in the title might need to follow a specific style guide given by the R-project. Is this accurate? Is there a particular font I should use? You can simply write the title as is. Best, Uwe Ligges Thanks, Spencer [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] OK, next Q - a sort of factorial on a vector
vf <- function(x){ o <- outer(x, x) as.vector(na.omit(o[lower.tri(o)])) } vf(1:5) vf(c(1,2,NA,4,5)) Best, Uwe Ligges On 20.06.2023 19:13, Philip Rhoades via R-help wrote: People, What I mean is, is there an elegant way to do this: This: !(1,2,3,4,5) would give this: (2,3,4,5, 6,8,10, 12,15, 20) and this: !(1,2,NA,4,5) would give this: (2,4,5, 8,10, 20) ? Thanks! Phil. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help sourcing datasets (.csv)
See ?data On 28.05.2023 10:53, james carrigan wrote: Dear Sir or Madam I’m trying to compile a collection of datasets that require use of the following hypothesis tests. Are there datasets within the R library that I can get access to? Kind regards James Carrigan Hypothesis Testing t.test(X,Y) — performs a two sample t-test between X and Y t.test(X,Y,paired=TRUE) — performs a paired t-test between X and Y prop.test(x = c(a, b), n = c(n1, n2)) — performs a 2-sample test for equality of proportions with continuity correction Sent from my iPad Sent from my iPhone __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package Caret
On 17.04.2023 00:19, Gábor Malomsoki wrote: Many thanks Bert, now is ok, i did not know that "Namensraum" should mean a package Two hints: 1. The NAMESPACE is meant and he trnlsation is very literal here. 2. I typically have LANGUAGE=en set for R to avoid confusion. Best, Uwe Ligges Am So., 16. Apr. 2023 um 23:44 Uhr schrieb Bert Gunter < bgunter.4...@gmail.com>: So update the vctrs package to the latest version first before loading R-tools (or the caret package, specifically)? -- Bert On Sun, Apr 16, 2023 at 1:57 PM Gábor Malomsoki wrote: I have newly installed R, R-tools, RStudio, but still not working: library(caret)Lade nötiges Paket: latticeError: Laden von Paket oder Namensraum für ‘caret’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): fehlgeschlagen Namensraum ‘vctrs’ 0.5.2 ist bereits geladen, aber >= 0.6.0 wird gefordert Error in createDataPartition(hypotezis_df$X, p = 0.75, list = FALSE, times = 1) : could not find function "createDataPartition" R version 4.2.3 (2023-03-15 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044) Matrix products: default locale: [1] LC_COLLATE=German_Austria.utf8 LC_CTYPE=German_Austria.utf8 [3] LC_MONETARY=German_Austria.utf8 LC_NUMERIC=C [5] LC_TIME=German_Austria.utf8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] plotrix_3.8-2rgl_1.1.3scatterplot3d_0.3-43 lattice_0.20-45 [5] knitr_1.42 GGally_2.1.2 fs_1.6.0 lubridate_1.9.2 [9] forcats_1.0.0stringr_1.5.0dplyr_1.1.0 purrr_1.0.1 [13] readr_2.1.4 tidyr_1.3.0 tibble_3.1.8 ggplot2_3.4.2 [17] tidyverse_2.0.0 loaded via a namespace (and not attached): [1] progress_1.2.2 tidyselect_1.2.0 xfun_0.36 colorspace_2.1-0 [5] vctrs_0.5.2generics_0.1.3 htmltools_0.5.4 base64enc_0.1-3 [9] utf8_1.2.2 rlang_1.1.0pillar_1.8.1 glue_1.6.2 [13] withr_2.5.0RColorBrewer_1.1-3 foreach_1.5.2 lifecycle_1.0.3 [17] plyr_1.8.8 timeDate_4022.108 munsell_0.5.0 gtable_0.3.1 [21] ragg_1.2.5 htmlwidgets_1.6.1 codetools_0.2-19 labeling_0.4.2 [25] fastmap_1.1.0 tzdb_0.3.0 fansi_1.0.4Rcpp_1.0.10 [29] scales_1.2.1 jsonlite_1.8.4 farver_2.1.1 systemfonts_1.0.4 [33] textshaping_0.3.6 digest_0.6.31 hms_1.1.2 stringi_1.7.12 [37] grid_4.2.3 cli_3.6.0 tools_4.2.3 magrittr_2.0.3 [41] crayon_1.5.2 pkgconfig_2.0.3ellipsis_0.3.2 Matrix_1.5-3 [45] prettyunits_1.1.1 timechange_0.2.0 gower_1.0.1 reshape_0.8.9 [49] rstudioapi_0.14iterators_1.0.14 R6_2.5.1 nlme_3.1-162 [53] compiler_4.2.3 Am Fr., 14. Apr. 2023 um 11:24 Uhr schrieb Duncan Murdoch < murdoch.dun...@gmail.com>: You should post the result of running sessionInfo(), and tell us how you installed R. Your installation seems very broken. Duncan Murdoch On 14/04/2023 3:45 a.m., Gábor Malomsoki wrote: This is the error then: error in prettyseq(1:ncol(out)) : could not find function "prettyseq" Eric Berger schrieb am Fr., 14. Apr. 2023, 09:06: What happens if you do the following? library(caret) ?caret::createDataPartition i.e. to confirm that caret is loaded, seek help on this function On Fri, Apr 14, 2023 at 9:56 AM Gábor Malomsoki < gmalomsoki1...@gmail.com> wrote: Eric, Yes, i know, i am calling the package, but this is not working. I saw a similar question in Stackoverflow, advising install package Rcpp, but this one i am unable to install. Eric Berger schrieb am Fr., 14. Apr. 2023, 08:47: You first have to load the package using the library command. library(caret) Then you can call createDataPartition. e.g. data(oil) createDataPartition(oilType,2) HTH, Eric On Fri, Apr 14, 2023 at 7:52 AM Gábor Malomsoki < gmalomsoki1...@gmail.com> wrote: Dear all, When i try to use createDataPartition after calling package 'caret', i get the message: "could not find function createDataPartition" I use: R-4.2.3 for Windows RStudio-2023.03.0-386 Do you have any experience with this failure? Thank you! Best regards Gabor [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,
Re: [R] R does not run under latest RStudio
No, but you need to ask on an RStudio mailing list. This one is about R. Best, Uwe Ligges On 06.04.2023 11:28, Steven T. Yen wrote: I updated to latest RStudio (RStudio-2023.03.0-386.exe) but R would not run. Error message: Error Starting R The R session failed to start. RSTUDIO VERSION RStudio 2023.03.0+386 "Cherry Blossom " (3c53477a, 2023-03-09) for Windows [No error available] I also tried RStudio 2022.12.0+353 --- same problem. I then tried another older version of RStudio (not sure version as I changed file name by accident) and R ran. Any clues? Please help. Thanks. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] legend: interplay between title and y.intersp
What about plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"), title="test", y.intersp=c(1,-0.4), lwd=1) (in recent versions of R) Best, Uwe On 06.03.2023 11:34, Sigbert Klinke wrote: Hi, I think you are right, legend cannot do it. I have now created my own legend function where I changed only one line and now it works the way I want it to. But I'm not sure if that might not have other side effects. I have the impression that the legend and the title start at the same y-position (try y.intersp=0). Only if y.intersp is big enough, then it leads to a non-overlap of title and legend. Thanks a lot Sigbert Am 05.03.23 um 16:20 schrieb Bert Gunter: Don't think you can do that. But maybe someone else will show that I'm wrong. -- Bert On Sat, Mar 4, 2023 at 11:39 PM Sigbert Klinke wrote: Hi, thanks, but this does not solve the problem. If I make y.intersp large enough then it works properly. Maybe I was not clear enough: I want to have the small distance between the lines and no overlap between the title and the lines. Sigbert Am 04.03.23 um 17:59 schrieb Bert Gunter: Set the legend position explicitly with x and y values and add xpd = TRUE to the legend call to clip the plot to the figure region and not the plot region (the default). Something like this (you may have to fool around with y.intersp, etc. to allow enough space between the legend lines): plot(c(0,1), c(0,1), type="n") legend(x = .4, y = 1.25, legend=c("", "", "a"), col=c("blue", "red", "green"), xpd = TRUE, lty = 1, y.intersp= .75, title = 'test') Cheers, Bert Cheers, Bert On Sat, Mar 4, 2023 at 7:45 AM Sigbert Klinke wrote: Hi, my MWE is not working as expected: plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "", "a"), col=c("blue", "red", "green"), title="test", y.intersp=0.2, lwd=1) The lines are not below the title. I want (nearby) lines as in the plot, but below the title. Is there a way to achieve this? Thanks Sigbert __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- https://hu.berlin/sk https://www.stat.de/faqs https://hu.berlin/mmstat https://hu.berlin/mmstat-ar __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Extracting data using subset function
I tend not to teach subset() as indexing is needed anyway and hence subset() is just an extra level of cpmplexity that is not needed. Also note what ?subset warns about. Best, Uwe Ligges On 05.02.2023 22:12, avi.e.gr...@gmail.com wrote: A major question is why you ask how to use the subset function rather than asking how to get your job done. As you note, the simple way to get the first N items is to use indexing. If you absolutely positively insist on using subset, place your data into something like a data.frame and add a column and use that. Say you have N items, so that length() or nrow() return N. You can add a column called index whose entries are 1:N and do your subset to get all rows where the condition is "index <= N" or something like that. If you want just the first N (not N at a time in several tries) simply used head(data, N) and that gets you the first N. And if you are interested in learning other packages like dplyr in the tidyverse, it has oodles of ways to select based on row numbers. One example is top_n(...) and another is slice(first, last) and in some contexts such as the filter() function, there is a sort of internal function you can use called n() that contains the index of the entry within any grouping so filter(mydata, n() <= 20) might get what you want. Note that the above requires care as some things work on vectors and others assume a data.frame, albeit you can make a data.frame containing a single vector. -Original Message- From: R-help On Behalf Of Upananda Pani Sent: Sunday, February 5, 2023 2:33 PM To: Andrés González Carmona Cc: r-help Subject: Re: [R] Extracting data using subset function Thank you. It means we can not use the subset function here. Regards On Mon, 6 Feb, 2023, 00:53 Andrés González Carmona, wrote: From ?subset: Warning This is a convenience function intended for use interactively. For programming it is better to use the standard subsetting functions like [ <http://127.0.0.1:21786/library/base/help/%5B>, and in particular the non-standard evaluation of argument subset can have unanticipated consequences. El 05/02/2023 a las 15:07, Upananda Pani escribió: Dear All, I want to create a vector p and extract first 20 observations using subset function based on logical condition. My code is below p <- 0:100 I know i can extract the first 20 observations using the following command. q <- p[1:20] But I want to extract the first 20 observations using subset function which requires a logical condition. I am not able to frame the logical condition. The code should be q <- subset(p, logical condition) I am not able to do it. Please let me know what you think. Best regards, Upananda [[alternative HTML version deleted]] __r-h...@r-project.org mailing list -- To UNSUBSCRIBE and more, seehttps://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r -help__;!!D9dNQwwGXtA!SLdwTGqSfhwUo4CfbUJFeL7hETw64hOG8MQ0FK_o5YdnvVHa Op9Qxs4D7d5e10hj3YQ8EuaFc8qbnkynoP5dEA$ PLEASE do read the posting guide https://urldefense.com/v3/__http://www.R-project.org/posting-guide.htm l__;!!D9dNQwwGXtA!SLdwTGqSfhwUo4CfbUJFeL7hETw64hOG8MQ0FK_o5YdnvVHaOp9Q xs4D7d5e10hj3YQ8EuaFc8qbnkwuss43hA$ and provide commented, minimal, self-contained, reproducible code. -- * Andrés González Carmona * [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Plotmath isn't working for special characters
Yes, and is is fixed in R-4.2.2-pacthed for soe time already. Best, Uwe Ligges On 25.01.2023 15:48, Shawn Way wrote: I see the same thing using 4.2.2 on Windows 10. Thank you kindly, Shawn Way, PE Director of Engineering Phone: (832) 403-0414 Empower Pharmacy Expanding Access. -Original Message- From: R-help On Behalf Of David Stevens Sent: Wednesday, January 25, 2023 8:34 AM To: Bert Gunter Cc: r-help@r-project.org Subject: Re: [R] Plotmath isn't working for special characters External Email: This message originated from outside Empower Pharmacy. Please exercise caution before opening attachments, clicking links, replying, or providing information to the sender. A more extensive test (no=produced an empty box on the plot, yes=produced the intended plotmath result). It appears that plotmath is not producing the special math characters. Greek symbols are produced. I'll try to reinstall R and report back. David plot(1,1, main = parse(text = "x >= y")) - no plot(1,1, main = parse(text = "x == y")) - yes plot(1,1, main = parse(text = "x <= y")) - no plot(1,1, main = parse(text = "x ~ y")) - yes plot(1,1, main = parse(text = "x * y")) - yes plot(1,1, main = parse(text = "x %~~% y")) - no plot(1,1, main = bquote(x %~~% y)) - no plot(1,1, main = bquote(x %prop% y)) - no plot(1,1, main = expression(x %prop% y)) - no plot(1,1, main = expression(x == y)) - yes plot(1,1, main = expression(x %+-% y)) - no plot(1,1, main = expression(integral(f(x)*dx, a, b))) - no plot(1,1, main = expression(sum(x[i], i==1, n))) - no plot(1,1, main = expression(x^(y + z))) - yes plot(1,1, main = expression(inf(x))) - no plot(1,1, main = expression(x[(y + z)])) - yes David K Stevens, PhD, PE, Professor Civil and Environmental Engineering Utah Water Research Laboratory Utah State University 8200 Old Main Hill Logan, UT 84322-8200 david.stev...@usu.edu<mailto:david.stev...@usu.edu> (435) 797-3229 (office) On 1/24/2023 3:33 PM, Bert Gunter wrote: Also works for me on a Mac Ventura in the RStudio graphics device. Just for the heckuva it, does plot(1,1,main= quote( x >= y )) work? I shouldn't think so, but ... Cheers, Bert On Tue, Jan 24, 2023 at 1:43 PM David Stevens mailto:david.stev...@usu.edu>> wrote: Simple expressions on plots, such as parse(text='x >= y') have been resulting in just a placeholder box (x box y and not the symbol) in my R plot labels in windows, R v 4.2.2. I haven't down an exhaustive test but <= and >= have this behavior. plot(1,1,main=parse(text="x >= y")) Has anyone else seen this? best David -- David K Stevens, PhD, PE, Professor Civil and Environmental Engineering Utah Water Research Laboratory Utah State University 8200 Old Main Hill Logan, UT 84322-8200 david.stev...@usu.edu<mailto:david.stev...@usu.edu> (435) 797-3229 (office) __ R-help@r-project.org<mailto:R-help@r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] foreign package: unable to read S-Plus objects
I just checked the header: read.S from foreign expects: readheader <- function(s) { head <- readBin(s, "int", 8L, 1L) all(head == c(0L, 83L, 32L, 100L, 97L, 116L, 97L, 1L)) } but head is [1] 0 83 32 86 52 45 77 3 i.e. similar but not identical, so a different format is used (S-PLUS 6 or later). Likely, it is not too hard to write some import function based on read.S if the file format is documented anywhere. Unfortunately, I do not find any web resources for it. So simplest way would be to install the old S-PLUS version and export all data in a readable format. Best, Uwe Ligges On 17.01.2023 14:21, Viechtbauer, Wolfgang (NP) wrote: @Joe: I have S-Plus 6.0 ("Professional Edition Version 6.0.3 Release 2 for Microsoft Windows : 2001") running here and can't load them there either. Tried simdat and S-Plus apparently thinks it is a script and then you just get a garbled up mess. Tried to change it to simdat.sdd and a few other extensions, but this didn't help. Also tried: data.restore("simdat") but this also didn't work: Warning messages: file "simdat": incomplete last line Problem: in reading invalid mode for data: [again a garbled mess] at line 2 Not sure how else these are supposed to be read into S-Plus (and if they are even compatible with this version, although version 6 was the current version between 2001 and 2005). Best, Wolfgang -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kevin Thorpe Sent: Tuesday, 17 January, 2023 13:07 To: Joseph Voelkel Cc: R Help Mailing List Subject: Re: [R] foreign package: unable to read S-Plus objects I think you may be right about the cause. From the, “R Data Import/Export” document I find, Function read.S which can read binary objects produced by S-PLUS 3.x, 4.x or 2000 on (32-bit) Unix or Windows (and can read them on a different OS). This is able to read many but not all S objects: in particular it can read vectors, matrices and data frames and lists containing those. This suggests that the binary objects you have cannot be read by this function. The next two paragraphs read, Function data.restore reads S-PLUS data dumps (created by data.dump) with the same restrictions (except that dumps from the Alpha platform can also be read). It should be possible to read data dumps from S-PLUS 5.x and later written with data.dump(oldStyle=T). If you have access to S-PLUS, it is usually more reliable to dump the object(s) in S-PLUS and source the dump file in R. For S-PLUS 5.x and later you may need to use dump(..., oldStyle=T), and to read in very large objects it may be preferable to use the dump file as a batch script rather than use the source function. I think this means that if you had dumped versions of the files you could read them back with data.restore() or source(). On Jan 16, 2023, at 5:22 PM, Joseph Voelkel wrote: [You don't often get email from jgv...@rit.edu. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Dear foreign maintainers and others, I am trying to import a number of S-Plus objects into R. The only way I see how to do this is by using the foreign package. However, when I try to do this I receive an error message. A snippet of code and the error message follows: read.S(file.path(Spath, "nrand")) Error in read.S(file.path(Spath, "nrand")) : not an S object I no longer know the version of S-Plus in which these objects were created. I do know that I have printed documentation, dated July 2001, from S-Plus 6; and that all S-Plus objects were created in the 9/2004 -- 5/2005 range. I am afraid that I simply have S-Plus objects that are not the S version 3 files that the foreign package can read, yes? But I am still hoping that it may be possible to read these in. I am not attaching some sample S-Plus objects to this email, because I believe they will be stripped away as binary files. However, a sample of these files may be found at https://drive.google.com/drive/folders/1wFVa972ciP44Ob2YVWfqk8SGIodzAXPv?usp=shar ing (simdat is the largest file, at 469 KB) Thank you for any assistance you may provide. R 4.2.2 Microsoft Windows [Version 10.0.22000.1455] foreign_0.8-83 Joe Voelkel Professor Emeritus RIT __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Pipe operator
R is a functional language, hence the pipe operator is not needed. Also it makes the code unreadable as it is less obvious how a call stack looks like and what the arguments to the function calls are. It is relevant for a shell for piping text streams. If people cannot live without the pipe operator (and I wonder why you want to add a level of complexity, as it is more obfuscated what the actual function calls are), please use R's internal one, as it is known by the parser and hence debugging etc is better integrated. Best, Uwe Ligges On 03.01.2023 17:48, Sorkin, John wrote: I am trying to understand the reason for existence of the pipe operator, %>%, and when one should use it. It is my understanding that the operator sends the file to the left of the operator to the function immediately to the right of the operator: c(1:10) %>% mean results in a value of 5.5 which is exactly the same as the result one obtains using the mean function directly, viz. mean(c(1:10)). What is the reason for having two syntactically different but semantically identical ways to call a function? Is one more efficient than the other? Does one use less memory than the other? P.S. Please forgive what might seem to be a question with an obvious answer. I am a programmer dinosaur. I have been programming for more than 50 years. When I started programming in the 1960s the only pipe one spoke about was a bong. John __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [Rd] I do not want that R CMD build removes temp directory
Ah, before that you wrote "" ERROR: lazy loading failed for package 'prolfqua' * removing 'C:Users " and C:Users without a slash sonds suspicious. Now with the new output I do not see where the issue is from. Does this also happen when you try it on winbuilder? Best, Uwe Ligges On 19.12.2022 10:52, Witold E Wolski wrote: Dear Uwe, Unfortunately there isn't much of an output. This is all what I have: $ R CMD INSTALL --log prolfqua Warning: unknown option '--log' * installing to library 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2' * installing *source* package 'prolfqua' ... ** using staged installation ** R ** data ** inst ** byte-compile and prepare package for lazy loading ERROR: lazy loading failed for package 'prolfqua' * removing 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2/prolfqua' Also with --no-test-load option the install is failing : $ R CMD INSTALL --clean --no-test-load prolfqua * installing to library 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2' * installing *source* package 'prolfqua' ... ** using staged installation ** R ** data ** inst ** byte-compile and prepare package for lazy loading ERROR: lazy loading failed for package 'prolfqua' * removing 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2/prolfqua' And including "--no-clean-on-error" also does not help because the installation directory is empty. Tested the install, on macos M1, linux ARM64, linux x86, Windows 64, and it works everywhere except Parallels Windows 64 on ARM M1. R version 4.2.2 (2022-10-31 ucrt) -- "Innocent and Trusting" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) best regards Witek On Fri, 16 Dec 2022 at 11:24, Uwe Ligges wrote: On 15.12.2022 21:47, Witold E Wolski wrote: Thank you Simon, It seems not to be related to the R package but rather to the OS, (just got the same error when installing the shiny R package from CRAN). I am on an M1 mac running Windows ARM in Parallels. Installed a x86_64-w64 R version. "** byte-compile and prepare package for lazy loading ERROR: lazy loading failed for package 'shiny' * removing 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2/shiny' Warning in install.packages :" Can we please have the full output? Best, Uwe Ligges On Thu, 15 Dec 2022 at 19:09, Simon Urbanek wrote: Yes: $ R CMD INSTALL --help | grep error --no-clean-on-error do not remove installed package on error But probably more commonly used way is to install the package from its unpacked directory as that avoids the use of temporary directories in the first place. In you case you can also use --no-test-load and the non-functional package will still be installed so you can inspect it. Cheers, Simon PS: please don't cross-post On Dec 16, 2022, at 7:01 AM, Witold E Wolski wrote: I am getting a package build error, and can not figure out the problem. The error is " ERROR: lazy loading failed for package 'prolfqua' * removing 'C:/Users/ " However since R CMD build removes the temp directory and does not give any other errors how can I find out what the build problem is? Is there a way to disable the temp directory removal? Best Regards Witek -- Witold Eryk Wolski __ r-de...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Witold Eryk Wolski __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [Rd] I do not want that R CMD build removes temp directory
On 15.12.2022 21:47, Witold E Wolski wrote: Thank you Simon, It seems not to be related to the R package but rather to the OS, (just got the same error when installing the shiny R package from CRAN). I am on an M1 mac running Windows ARM in Parallels. Installed a x86_64-w64 R version. "** byte-compile and prepare package for lazy loading ERROR: lazy loading failed for package 'shiny' * removing 'C:/Users/witoldwolski/AppData/Local/R/win-library/4.2/shiny' Warning in install.packages :" Can we please have the full output? Best, Uwe Ligges On Thu, 15 Dec 2022 at 19:09, Simon Urbanek wrote: Yes: $ R CMD INSTALL --help | grep error --no-clean-on-error do not remove installed package on error But probably more commonly used way is to install the package from its unpacked directory as that avoids the use of temporary directories in the first place. In you case you can also use --no-test-load and the non-functional package will still be installed so you can inspect it. Cheers, Simon PS: please don't cross-post On Dec 16, 2022, at 7:01 AM, Witold E Wolski wrote: I am getting a package build error, and can not figure out the problem. The error is " ERROR: lazy loading failed for package 'prolfqua' * removing 'C:/Users/ " However since R CMD build removes the temp directory and does not give any other errors how can I find out what the build problem is? Is there a way to disable the temp directory removal? Best Regards Witek -- Witold Eryk Wolski __ r-de...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] bgroup not rendering properly
And this has been fixed by Tomas Kalibera on Dec 12 in R-devel already. Shortly to be ported to R-patched. Best, Uwe Ligges On 13.12.2022 16:38, Uwe Ligges wrote: Fascinating: I see it with R-4.2.2 and R-patched with the windows() device. But all works well with R-4.2.1 and R-devel. I'll try to investigate. Best, Uwe Ligges On 13.12.2022 14:59, Derek Ogle wrote: Thank you all for your help. I am using Windows. I ran the following both in R 4.2.2 using RStudio and not using RStudio (but using the R GUI). In both runs, plots within the GUI/RStudio and in the PNG output exhibited the same issue that I reported originally., whereas plots in the PDF output were perfect (no issue). As asked, the first dev.cur() or .Device says "null device" whereas the second says "Windows" when using the R GUI and "RStudioGD" when using RStudio. It sounds like this is likely a windows-related bug that will be fixed in the next version. I can wait for that. dev.cur() .Device plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) png("bgroup_R422.png") plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) dev.off() pdf("bgroup_R422.pdf") plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) dev.off() dev.cur() .Device plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) On Tue, Dec 13, 2022 at 5:48 AM Jinsong Zhao wrote: On 2022/12/13 18:02, Martin Maechler wrote: Jinsong Zhao on Tue, 13 Dec 2022 17:07:00 +0800 writes: > I don > On 2022/12/13 10:13, Derek Ogle wrote: >> bgroup() from plotmath does not render properly for >> me. For example >> >> plot(0,xlim=c(0,1),ylim=c(0,1)) >> text(0.3,0.5,expression(bgroup('(',atop(x,y),')'))) >> text(0.7,0.5,expression(group('(',atop(x,y),')'))) Almost surely a Windows-only problem i.e. bug, See also the bug fixed yesterday, PR#18440, https://bugs.r-project.org/show_bug.cgi?id=18440 I do not observe the problem in that bug report. All works fine. Best, Jinsong __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] bgroup not rendering properly
Fascinating: I see it with R-4.2.2 and R-patched with the windows() device. But all works well with R-4.2.1 and R-devel. I'll try to investigate. Best, Uwe Ligges On 13.12.2022 14:59, Derek Ogle wrote: Thank you all for your help. I am using Windows. I ran the following both in R 4.2.2 using RStudio and not using RStudio (but using the R GUI). In both runs, plots within the GUI/RStudio and in the PNG output exhibited the same issue that I reported originally., whereas plots in the PDF output were perfect (no issue). As asked, the first dev.cur() or .Device says "null device" whereas the second says "Windows" when using the R GUI and "RStudioGD" when using RStudio. It sounds like this is likely a windows-related bug that will be fixed in the next version. I can wait for that. dev.cur() .Device plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) png("bgroup_R422.png") plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) dev.off() pdf("bgroup_R422.pdf") plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) dev.off() dev.cur() .Device plot(0,xlim=c(0,1),ylim=c(0,1)) text(0.5,0.5,expression(bgroup('(',atop(x,y),')'))) On Tue, Dec 13, 2022 at 5:48 AM Jinsong Zhao wrote: On 2022/12/13 18:02, Martin Maechler wrote: Jinsong Zhao on Tue, 13 Dec 2022 17:07:00 +0800 writes: > I don > On 2022/12/13 10:13, Derek Ogle wrote: >> bgroup() from plotmath does not render properly for >> me. For example >> >> plot(0,xlim=c(0,1),ylim=c(0,1)) >> text(0.3,0.5,expression(bgroup('(',atop(x,y),')'))) >> text(0.7,0.5,expression(group('(',atop(x,y),')'))) Almost surely a Windows-only problem i.e. bug, See also the bug fixed yesterday, PR#18440, https://bugs.r-project.org/show_bug.cgi?id=18440 I do not observe the problem in that bug report. All works fine. Best, Jinsong __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to access source code
Or simply get and unpack the package sources. Here you will also find the comments that are typically stripped out otherwise. Best, Uwe Ligges On 08.12.2022 17:26, Martin Morgan wrote: showMethods(LGD, includeDef = TRUE) shows the implementation of all methods on the LGD generic, and can be a useful fast track to getting an overview of what is going on. Martin Morgan From: R-help on behalf of Ivan Krylov Date: Thursday, December 8, 2022 at 11:23 AM To: Christofer Bogaso Cc: r-help Subject: Re: [R] How to access source code � Thu, 8 Dec 2022 20:56:12 +0530 Christofer Bogaso �: showMethods(LGD) Function: LGD (package GCPM) this="GCPM" Almost there! Try getMethod(LGD, signature = 'GCPM'). Not sure if this is going to work as written, but if you need to see an S4 method definition, getMethod is the way. -- Best regards, Ivan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Associate a .R file with the RGui
On 06.11.2022 19:43, Amarjit Chandhial wrote: Hi Uwe, I can do 1. 1. Add the line if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1]) to the Rprofile.site file; and My Rprofile.site file is: "C:/PROGRA~1/R/R-42~1.2/etc/Rprofile.site" How do I do 2, step-by-step? 2. Edit the registry to associate the .R extension with the command C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1" If you have not .R file association yet, you can add the line above when being asked. If you have one, simply change the registry key Computer\HKEY_CLASSES_ROOT\R_auto_file\shell\open\command There is a standard value as extendable string (REG_EXPAND_SZ) and you simply replace its content by "C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe" --args "%1" and in Computer\HKEY_CLASSES_ROOT\.R there shoudl be a standard string (REG_SZ) R_auto_file Best, Uwe Ligges Amarjit ------ Original Message -- From: "Uwe Ligges" To: "Amarjit Chandhial" ; "David Winsemius" ; "Jeff Newmiller" Cc: "Amarjit Chandhial via R-help" Sent: Sunday, 6 Nov, 2022 At 17:19 Subject: Re: [R] Associate a .R file with the RGui On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote: Hi Uwe, RGui does have advantages vs. RStudio, and vice-versa. RStudio is much faster than it used to be. I currently have .R files associated with RStudio, i.e. in File Explorer if I double-click on a .R file it opens in the editor in RStudio as an R script. In File Explorer if I right-click on a .R file, Open with, I get the options: R for Windows GUI Front-end or RStudio or Search the Microsoft Store or choose another app. If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R file, in the editor. If I choose RStudio the .R file opens in the editor in RStudio as an R script. From the adaptation, if I choose R for Windows GUI Front-end, will the .R file open in RGui (64-bit) within the editor? Yes. I have a new Windows PC and maybe, at least for the time being, it's best for me to have them associated with RStudio. Although, yes, I agree, it should be naturally implemented in R, having installed RStudio. I meant to implement that one can choose the internal editor to open .R files. File associations can be set by RStudio, too, but that is not an R(-core) matter. Best, Uwe Ligges thanks, Amarjit -- Original Message -- From: "Uwe Ligges" To: "David Winsemius" ; "Amarjit Chandhial" ; "Jeff Newmiller" Cc: "Amarjit Chandhial via R-help" Sent: Sunday, 6 Nov, 2022 At 15:15 Subject: Re: [R] Associate a .R file with the RGui On 06.11.2022 01:40, David Winsemius wrote: On 11/5/22 09:58, Amarjit Chandhial via R-help wrote: Hi Jeff, Please see my original question. You were told that RGui is not an editor. Are you implying that your initial message contained an implicit request for instructions on how to get R code in an .R file to be opened automagically when double-clicked or to have "open in " appear when right-clicked? (I didn't see that clearly expressed.) If you want something else to happen with a file that has a .R extension when double-clicked or right-clicked in a GUI file manager, then you need to configure your OS to do whatever else it is that you expect. This is not really an R question. It's an OS question. There are many editors that can also bring up R consoles when the right key combo is pressed. They do require some study for their specific actions, but this is not really the place to get guidance on the fine details. Friends, RGui contains an editor. It allows to send lines / code blocks to the R concole. We know users who need braille displays use the RGui internal editor as that apparently cooperates better with braille displays + R as many other editors. And as it does not hide half of R by its own functions, I'd pefer that over some very popular other editors if I had no other choice. To answer the OP's question, R does not have a built in way to get this task directly done, but searching the web suggests a rather simple way (well,m a hack as starting R with other command args may fail now, but you can extend this and look for a specific naming scheme): <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html>>
Re: [R] Associate a .R file with the RGui
On 06.11.2022 17:21, Amarjit Chandhial via R-help wrote: Hi Uwe, RGui does have advantages vs. RStudio, and vice-versa. RStudio is much faster than it used to be. I currently have .R files associated with RStudio, i.e. in File Explorer if I double-click on a .R file it opens in the editor in RStudio as an R script. In File Explorer if I right-click on a .R file, Open with, I get the options: R for Windows GUI Front-end or RStudio or Search the Microsoft Store or choose another app. If I choose R for Windows GUI Front-end, RGui (64-bit) opens, but no .R file, in the editor. If I choose RStudio the .R file opens in the editor in RStudio as an R script. From the adaptation, if I choose R for Windows GUI Front-end, will the .R file open in RGui (64-bit) within the editor? Yes. I have a new Windows PC and maybe, at least for the time being, it's best for me to have them associated with RStudio. Although, yes, I agree, it should be naturally implemented in R, having installed RStudio. I meant to implement that one can choose the internal editor to open .R files. File associations can be set by RStudio, too, but that is not an R(-core) matter. Best, Uwe Ligges thanks, Amarjit -- Original Message -- From: "Uwe Ligges" To: "David Winsemius" ; "Amarjit Chandhial" ; "Jeff Newmiller" Cc: "Amarjit Chandhial via R-help" Sent: Sunday, 6 Nov, 2022 At 15:15 Subject: Re: [R] Associate a .R file with the RGui On 06.11.2022 01:40, David Winsemius wrote: On 11/5/22 09:58, Amarjit Chandhial via R-help wrote: Hi Jeff, Please see my original question. You were told that RGui is not an editor. Are you implying that your initial message contained an implicit request for instructions on how to get R code in an .R file to be opened automagically when double-clicked or to have "open in " appear when right-clicked? (I didn't see that clearly expressed.) If you want something else to happen with a file that has a .R extension when double-clicked or right-clicked in a GUI file manager, then you need to configure your OS to do whatever else it is that you expect. This is not really an R question. It's an OS question. There are many editors that can also bring up R consoles when the right key combo is pressed. They do require some study for their specific actions, but this is not really the place to get guidance on the fine details. Friends, RGui contains an editor. It allows to send lines / code blocks to the R concole. We know users who need braille displays use the RGui internal editor as that apparently cooperates better with braille displays + R as many other editors. And as it does not hide half of R by its own functions, I'd pefer that over some very popular other editors if I had no other choice. To answer the OP's question, R does not have a built in way to get this task directly done, but searching the web suggests a rather simple way (well,m a hack as starting R with other command args may fail now, but you can extend this and look for a specific naming scheme): <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> > let is adapt this for the recent version of R: 1. Add the line if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1]) to the Rprofile.site file; and 2. Edit the registry to associate the .R extension with the command C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1" I think we should implement this in R anyway. Best, Uwe Ligges [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Associate a .R file with the RGui
On 06.11.2022 01:40, David Winsemius wrote: On 11/5/22 09:58, Amarjit Chandhial via R-help wrote: Hi Jeff, Please see my original question. You were told that RGui is not an editor. Are you implying that your initial message contained an implicit request for instructions on how to get R code in an .R file to be opened automagically when double-clicked or to have "open in " appear when right-clicked? (I didn't see that clearly expressed.) If you want something else to happen with a file that has a .R extension when double-clicked or right-clicked in a GUI file manager, then you need to configure your OS to do whatever else it is that you expect. This is not really an R question. It's an OS question. There are many editors that can also bring up R consoles when the right key combo is pressed. They do require some study for their specific actions, but this is not really the place to get guidance on the fine details. Friends, RGui contains an editor. It allows to send lines / code blocks to the R concole. We know users who need braille displays use the RGui internal editor as that apparently cooperates better with braille displays + R as many other editors. And as it does not hide half of R by its own functions, I'd pefer that over some very popular other editors if I had no other choice. To answer the OP's question, R does not have a built in way to get this task directly done, but searching the web suggests a rather simple way (well,m a hack as starting R with other command args may fail now, but you can extend this and look for a specific naming scheme): <https://stat.ethz.ch/pipermail/r-help/2007-August/138064.html> let is adapt this for the recent version of R: 1. Add the line if ( length(z <- commandArgs(TRUE)) ) utils::file.edit(z[1]) to the Rprofile.site file; and 2. Edit the registry to associate the .R extension with the command C:\Program Files\R\R-4.2.2\bin\x64\Rgui.exe --args "%1" I think we should implement this in R anyway. Best, Uwe Ligges __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] shaded area between a curve and a circle
The points on your density curve can be written as (x, f(x)) - well, if you had not divided by its max value which I do not understand why. Now you simply need to find out which of these points have a distance of the circle's radius to the point (0,0). Hmmm, your "circle" has a radius of 2 in x direction but less in y direction? So this is not a circle but an ellipse given the coordinate system used? Assuming you actually want to draw a circle of radius r, then I would simply solve Pythagoras' equation, i.e. sqrt(x^2 + f(x)^2) == r e.g. via uniroot(). But first you need to find out what you actually want to do. Best, Uwe Ligges On 22.10.2022 21:05, L... L... wrote: Dear, I have a picture in which I draw a circle over the standard normal curve. See below the lines used to draw the figure. The figure is ok, but my problem is: How to shade the areas A, B, C, D, E and F? I know I have to find the points of intersection but I don't know how to find them. Suggestions will be welcome. library(plotrix) x <- seq(-3.0, 3.0, 0.01) fy <- dnorm(x) fy <- fy / max(fy) x11() plot(x, fy, ylim = c(-1, 1), col = "white", lwd = 1.5, xlim = c(-3, 3), lty = 1) draw.circle(0.0, 0.0, 2.00, border = 'blue', lty = 1, lwd = 0.8) lines(x, fy, type = 'l', ylim = c(-1,1), col = 'red', ) lines(x,-fy, type = 'l', ylim = c(-1,1), col = 'red') text( 0.0, 0.90, "A"); text( 0.0,-0.90, "B") text(-1.8, 0.25, "C"); text( 1.8, 0.25, "D") text(-1.8,-0.25, "E"); text( 1.8,-0.25, "F") Best regards ML [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] how to enlarge the legend
I'd propose: plot.new() ltext <- "text" lobj <- legend("bottom", "", text.width=strwidth(ltext), fill = "gray", cex = 2) text(lobj$text, ltext) Best, Uwe Ligges On 09.10.2022 16:54, Jinsong Zhao wrote: Hi there, in the following code, I'd like to enlarge the filled box but not the legend text. plot.new() legend("topleft", "text", fill = "gray") # filled box is too small legend("top", "text", fill = "gray", cex = 2) # filled box is ok but text is too large # I can use point to mimic filled box, but can not fill it with pattern legend("left", "text", pch = 22, pt.bg = "gray", pt.cex =3) I'd like to get filled box enlarged but with text not to be changed. Is it possible? Thanks in advance! Best, Jinsong __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [Rd] Problem with accessibility in R 4.2.0 and 4.2.1.
Note that the issues with the Rscript editor have been fixed in R-patched and R-devel. Best, Uwe Ligges On 22.09.2022 23:08, Andrew Hart via R-help wrote: On 22/09/2022 16:42, Toby Hocking wrote: Another option is to use https://emacspeak.sourceforge.net/ <https://emacspeak.sourceforge.net/> (version of emacs editor/ide which can speak letters/words/lines -- has a blind maintainer) with https://ess.r-project.org/ <https://ess.r-project.org/> (interface for editing and running R code from within emacs) Thanks everyone for all the suggestions. Of course, the optimal solution would be to figure out what is going on in Rgui, but, as is always the case, the blind user use case is a fairly niche one. I appreciate all the suggestions for finding an immediate solution to my problem. I don't use any kind of IDE for working with R since I simply haven't found one that is accessible or that i understand how to use. There is a plug-in for the Eclipse IDE I installed a few years ago, but I didn't understand the first thing about how it was to be used. So I've just always worked with an editor open in one Window and R in another, working interactively in R or bouncing over to the editor for more complex things and sourcing code into R as necessary. However, I only use the R console in Rgui. I went and had a look at Rterm, which I have never used on Windows; I've only ever used it when ssh-ing into Linux systems to use R. However, I've just found out that Rterm does a number of fairly important things that probably mean I can just use it instead of Rgui: 1. You can paste from the clipboard into the Rterm prompt; 2. It has a command history; 3. If you plot something, it opens a Window to draw the plot (I never realised it could do this and had always assumed Rgui was needed for this); and 4. It opens the HTML help if you ask for help on windows. I only ever saw it display text help on Linux, but I was logged in remotely. Text-based help is fine when ssh-ing into a machine, but HTML help is much nicer to read and navigate. I think I'll just switch over to Rterm for a while, but I can also check out ess, which I wasn't aware of. Thanks a lot, Andrew. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Space between axis title and tick labels in persp plot in R (using vis.gam)
R does not provide a native 3D coordinate syytem in base graphics. Therefore, persp() is rather a hack that plots everything based on its internal code into the device. Labels are not in the marhings of the 2D coordinate system, hence the related par() are not functional. I'd suggest to add the axis titles manually after the plot and keep the rest unless you want to look fpr alternatives to persp(). Best, Uwe Ligges On 06.07.2022 19:22, jade.shodan--- via R-help wrote: Dear list, I am making a perspective plot of my generalised additive model (GAM) named a1b, using vis.gam() in mgcv, which in turn makes use of the persp function in base R. Code is as follows: library(mgcv) vis.gam(x = a1b, view = c("wbgt_max", "lag"), plot.type = "persp", xlab = "max WBGT (°C)", ylab = "lag (days)", zlab = "deaths", theta = 60, phi = 15, r = sqrt(3), d = 1, type = "response", ticktype = "detailed") The plot can be found here: https://stackoverflow.com/questions/72884763/space-between-axis-title-and-tick-labels-in-persp-plot-in-r-using-vis-gam On the x and z-axes, the axis title and axis labels are plotted over each other. I would like to: 1) increase the space between the axis titles and the tick labels for the x and z- axes (WBGT and deaths) and 2) increase the space between the ticks and the tick labels. I've looked up similar posts on StackOverflow, which suggest adding the following code to the plot (and change the values for the currently stated defaults): par(mgp=c(3,1,0)) like library(mgcv) par(mgp=c(20,20,20)) vis.gam(x = a1b, view = c("wbgt_max", "lag"), etc. However, this changes nothing at all to the plot. (I tried with c(20, 20, 20) , smaller values and larger ones). Would be grateful for any suggestions! Jade __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Calling stargazer() with do.call() in R 4.2.0
On 27.05.2022 17:29, Arne Henningsen wrote: Dear all (cc Marek = maintainer of the stargazer package) We use do.call() to automatically create many LaTeX tables with stargazer but after upgrading to R 4.2.0, this no longer works. I illustrate this with a simple reproducible example: R> data("USArrests") R> res <- lm( Murder ~ UrbanPop, data = USArrests ) R> library(stargazer) R> stargazer(res) # works as expected R> do.call( stargazer, list(res) ) Error in if (is.na(s)) { : the condition has length > 1 Without looking at the code in detail: The line aboce suggests the code needs an any():if(any(is.na(x))) raher than if(is.na(x)). Best, Uwe Ligges Any ideas what we can do so that the last command works with R 4.2.0? /Arne __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R and .asc file extension
On 20.05.2022 15:27, Thomas Subia via R-help wrote: Colleagues, I have data which has a .asc file extension. asc likely means ASCII and can be any kind of text data, so wed need some contents to suggest a function. But any for text files should work. Best, Uwe Ligges Can R read that file extension? All the best, Thomas Subia Statistician __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing an R package
On 28.04.2022 23:55, David Winsemius wrote: Pretty sure the right way to install that package is with the Bioc installer. or simply install.packages() after setting the repository. Best, Uwe Ligges Sent from my iPhone On Apr 28, 2022, at 3:35 PM, Bogdan Tanasa wrote: HI everyone, I must transfer a package from one platform (AWS) where I was able to install the package to another platform (local PC), where I am not able to install the package. The package is called : BSgenome.Hsapiens.UCSC.hg38 Is there a way to transfer the files from BSgenome.Hsapiens.UCSC.hg38 folder (below) from AWS to local PC and get it to run ? Thanks ! 4.0KDESCRIPTION 4.0KINDEX 28K Meta 4.0KNAMESPACE 20K R 784Mextdata 24K help 12K html [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Assigning categorical values to dates
For a data.frame d, I'd simply do d$cycle <- factor(d$dates, labels=1:3) but I have not idea about tibbles. Best, Uwe Ligges On 22.07.2021 05:12, N. F. Parsons wrote: Hi all, If I have a tibble as follows: tibble(dates = c(rep("2021-07-04", 2), rep("2021-07-25", 3), rep("2021-07-18", 4))) how in the world do I add a column that evaluates each of those dates and assigns it a categorical value such that datescycle 2021-07-04 1 2021-07-04 1 2021-07-25 3 2021-07-25 3 2021-07-25 3 2021-07-18 2 2021-07-18 2 2021-07-18 2 2021-07-18 2 Not to further complicate matters, but some months I may only have one date, and some months I will have 4 dates - so thats not a fixed quantity. We've literally been doing this by hand at my job and I'd like to automate it. Thanks in advance! Nate Parsons [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Unexpected date format coercion
On 01.07.2021 10:06, Jeremie Juste wrote: Hello, I have been surprised when converting a character string to a date with the following format, in R 4.1.0 (linux debian 10) as.Date("20-12-2020","%Y-%m-%d") [1] "20-12-20" in R 4.0.5 (window 10) as.Date("20-12-2020","%Y-%m-%d") [1] "0020-12-20" Yes, it is rather strange to specify "2020" as the day and "20" as the 4digits year, so different implementations may print the year in 2 or 4 digits. What you want is actually as.Date("20-12-2020","%d-%m-%Y") Best, Uwe Ligges Here I was expecting a blunt and sharp NA, am I missing something? Best regards, Jeremie __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] foreign package read.spss() and NA levels
On 27.05.2021 12:27, Allen, Justin wrote: Hi All, Wanted to report what may be a bug or possibly an oversight, but I am unsure, in the "foreign" packages in the read.spss() command, https://cran.r-project.org/web/packages/foreign/index.html. When running the following code, input <- read.spss("[.sav file location]", to.data.frame = TRUE) str(input) The read.spss() seems to be applying addNA() to factors so NA is being set as a level, and there seems to be no way to get read.spss() to bring factors in without doing this. This seems to be a recent change as read.spss() was not doing this as of a few months ago. None of the arguments in read.spss() seem to also stop this behaviour. I am currently on the most recent version of both R and the package, as of 27/05/21, and am using RStudio Version 1.4.1106. Within R (I do not use RStudio) and even with the most recent R-devel, I see (sav <- system.file("files", "electric.sav", package = "foreign")) dat <- read.spss(file=sav, to.data.frame=TRUE) table(dat$DAYOFWK) # SUNDAY MONDAY TUESDAY WEDNSDAY THURSDAY FRIDAY SATURDAY # 19 11 19 17 15 13 16 table(dat$DAYOFWK, useNA="always") # SUNDAY MONDAY TUESDAY WEDNSDAY THURSDAY FRIDAY SATURDAY # 19 11 19 17 15 13 16 130 So exactly what you expected? If you rather use dat <- read.spss(file=sav, to.data.frame=TRUE, use.missings=FALSE) table(dat$DAYOFWK, useNA="always") you see the NA values are converted to a factor level called "MISSING". If it is different on your end, pelase try in plain R, tell us the version of R / foreign and show an example data file where this happens. Best, Uwe Ligges Any thoughts? Many Thanks, Justin Allen p.s. your continued maintenance and additions to R and its packages have been infinitely useful in my work and life and thank for that. Justin Allen Housing Consultant, BRE<https://bregroup.com/> T: 07807122647 Follow BRE on Twitter: @BRE_Group<http://twitter.com/BRE_Group> Privileged and confidential information and/or copyright material may be contained in this e-mail. If you are not the intended addressee you may not copy or deliver it to anyone else or use it in any unauthorised manner. To do so is prohibited and may be unlawful. If you have received this e-mail by mistake, please advise the sender immediately by return e-mail and destroy all copies. Thank you. Building Research Establishment Ltd, Registered under number 3319324 in England and Wales. VAT Registration No GB 689 9499 27 www.bregroup.com<http://www.bregroup.com> BRE Global Limited, Registered under number 8961297 in England and Wales. www.breglobal.com<http://www.breglobal.com> Building Research Establishment and BRE Global are subsidiaries of the BRE Trust. BRE Trust is a company limited by guarantee, Registered under number 3282856 in England and Wales, and registered as a charity in England (no. 1092193) and in Scotland (no. SC039320). www.bretrust.org.uk<http://www.bretrust.org.uk> Registered Offices: Bucknalls Lane, Garston, Watford, Hertfordshire WD25 9XX - Travelling to BRE: see www.bregroup.com/contact/directions/<http://www.bregroup.com/contact/directions/> [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] problem downloading R
Sounds like you always got corrupted vesions. Either an issue with your connection or the mirror. What happens if you try another mirror and clear your browser caches? Best, Uwe Ligges On 05.03.2021 08:58, Abby Spurdle wrote: Does the following sound familiar? The Windows installer starts installing (or decompressing) R, flashing one file name at a time. And then, part way through, says file is corrupt, and gives you the choice to ignore. And if you click ignore, then the next file does the same thing. And one quickly realizes, that every subsequent file will have the same message. Then if you re-download the installation file, the same thing happens. Except that the first file flagged as corrupted, is not necessarily the same file. On Fri, Mar 5, 2021 at 5:55 AM Dick Mathews wrote: I am trying to download the Windows version of R. This computer is Win7, I do have Win10 computers also. Tried R4.0.4, got message these files are corrupted. Then tried R4.0.3, got same message as above. Tried the next, R4.0.2, got same message. I checked to see if I was downloading the proper version, seems okay. What is the problem? Can anybody help me with this? Dick Mathews __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] strptime, date and conversion of week number into POSIX
That monday does not exist. FOr the week before: strptime(paste0("2020-52","-1"),format="%Y-%W-%u") [1] "2020-12-28" One week later is no longer in 2020, so there is no 53th week. Best, Uwe Ligges On 22.02.2021 16:15, Patrick Giraudoux wrote: Sorry to answer to myself, but the format was clearly incorrect in the previous post. It should read, refering to the 1th day of the week: strptime(paste0(mydate,"-1"),format="%Y-%W-%u") It converts better, but with a NA on week 53 strptime(paste0(pays$year_week,"-1"),format="%Y-%W-%u") [1] "2020-01-06 CET" "2020-01-13 CET" "2020-01-20 CET" "2020-01-27 CET" [5] "2020-02-03 CET" "2020-02-10 CET" "2020-02-17 CET" "2020-02-24 CET" [9] "2020-03-02 CET" "2020-03-09 CET" "2020-03-16 CET" "2020-03-23 CET" [13] "2020-03-30 CEST" "2020-04-06 CEST" "2020-04-13 CEST" "2020-04-20 CEST" [17] "2020-04-27 CEST" "2020-05-04 CEST" "2020-05-11 CEST" "2020-05-18 CEST" [21] "2020-05-25 CEST" "2020-06-01 CEST" "2020-06-08 CEST" "2020-06-15 CEST" [25] "2020-06-22 CEST" "2020-06-29 CEST" "2020-07-06 CEST" "2020-07-13 CEST" [29] "2020-07-20 CEST" "2020-07-27 CEST" "2020-08-03 CEST" "2020-08-10 CEST" [33] "2020-08-17 CEST" "2020-08-24 CEST" "2020-08-31 CEST" "2020-09-07 CEST" [37] "2020-09-14 CEST" "2020-09-21 CEST" "2020-09-28 CEST" "2020-10-05 CEST" [41] "2020-10-12 CEST" "2020-10-19 CEST" "2020-10-26 CET" "2020-11-02 CET" [45] "2020-11-09 CET" "2020-11-16 CET" "2020-11-23 CET" "2020-11-30 CET" [49] "2020-12-07 CET" "2020-12-14 CET" "2020-12-21 CET" "2020-12-28 CET" [53] NA"2021-01-04 CET" "2021-01-11 CET" "2021-01-18 CET" [57] "2021-01-25 CET" "2021-02-01 CET" "2021-02-08 CET" Warning message: In strptime(paste0(pays$year_week, "-1"), format = "%Y-%W-%u") : (0-based) yday 369 in year 2020 is invalid Any idea on how to handle this ? Le 22/02/2021 à 15:26, Patrick Giraudoux a écrit : Dear all, I have a trouble trying to convert dates given in character to POSIX. The date is expressed as a year then the week number e.g. "2020-01" (first week of 2020). I thought is can be converted as following: strptime(mydate,format="%Y-%W") %W refering to the week of the year as decimal number (00–53) using Monday as the first day of week (and typically with the first Monday of the year as day 1 of week 1), as indicated in the doc. However, I got this result, with the month fixed to 02 (february) and day 22 (only the year is converted correctly): strptime(mydate,format="%Y-%W") [1] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [5] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [9] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [13] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [17] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [21] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [25] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [29] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [33] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [37] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [41] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [45] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [49] "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" "2020-02-22 CET" [53] "2020-02-22 CET" "2021-02-22 CET" "2021-02-22 CET" "2021-02-22 CET" [57] "2021-02-22 CET" "2021-02-22 CET" "2021-02-22 CET" You'll find below a dump of "mydate" you can copy and paster if you need a try Any hint welcome... Bes
Re: [R] unable to access index for repository...
Drop the RStudio repos. Best, Uwe Ligges On 05.10.2020 11:10, Steven Yen wrote: Thanks. I did as suggested but still received a warning, though the installation went through. Anything I could do to install without the warning message. What is the contrib.url argument? > install.packages("aod",repos='https://cran-archive.r-project.org') Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 trying URL 'https://cran-archive.r-project.org/bin/windows/contrib/3.0/aod_1.3.zip' Content type 'application/zip' length 225712 bytes (220 Kb) opened URL downloaded 220 Kb package ‘aod’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\USER\AppData\Local\Temp\Rtmp46p9a3\downloaded_packages > On 2020/10/5 下午 04:58, Uwe Ligges wrote: Then you'd rather need install.packages("aod",repos='https://cran-archive.r-project.org') or use the contrib.url argument. Best, Uwe Ligges On 05.10.2020 10:47, Steven Yen wrote: Thanks for the help. I do update to the latest R-4.0.2. As I said, for reasons that's hard to explain, some of my tasks are better handled with an older version of R, in this case R-3.0.3. Please just help me install packages successfully with this older version of R. I ran the following line but obviously was not getting it across. = install.packages("aod",repos='https://cran-archive.r-project.org/bin/windows/contrib/3.0/') Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning in install.packages : unable to access index for repository https://cran-archive.r-project.org/bin/windows/contrib/3.0/bin/windows/contrib/3.0 Warning in install.packages : package ‘aod’ is not available (for R version 3.0.3) On 2020/10/5 下午 04:12, Uwe Ligges wrote: From ../ReadMe in the mentioned web resource: "Packages for R >= 1.7.0 and R < 3.2.0 are available from https://cran-archive.r-project.org/bin/windows/contrib/; We do not hold binaries of several year old versions of R on CRAN. Note that R 3.0.0 is 7 years old. You shoudl realy consider to update to 4.0.2. Best, Uwe Ligges On 05.10.2020 09:56, Steven Yen wrote: I had to install/use an older version of (R-3.0.3) for a reason. While installing a package from CRAN (either in RStudio or R), I received the following warning message saying unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0. See message below. In this case, I tried to install "aod". The install nevertheless went through, as confirmed by the library statement (I did not try to use it). Any idea? Thank you. = Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 > install.packages("aod") Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 package ‘aod’ is available as a source package but not as a binary Warning in install.packages : package ‘aod’ is not available (for R version 3.0.3) > library(aod) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] unable to access index for repository...
Then you'd rather need install.packages("aod",repos='https://cran-archive.r-project.org') or use the contrib.url argument. Best, Uwe Ligges On 05.10.2020 10:47, Steven Yen wrote: Thanks for the help. I do update to the latest R-4.0.2. As I said, for reasons that's hard to explain, some of my tasks are better handled with an older version of R, in this case R-3.0.3. Please just help me install packages successfully with this older version of R. I ran the following line but obviously was not getting it across. = install.packages("aod",repos='https://cran-archive.r-project.org/bin/windows/contrib/3.0/') Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning in install.packages : unable to access index for repository https://cran-archive.r-project.org/bin/windows/contrib/3.0/bin/windows/contrib/3.0 Warning in install.packages : package ‘aod’ is not available (for R version 3.0.3) On 2020/10/5 下午 04:12, Uwe Ligges wrote: From ../ReadMe in the mentioned web resource: "Packages for R >= 1.7.0 and R < 3.2.0 are available from https://cran-archive.r-project.org/bin/windows/contrib/; We do not hold binaries of several year old versions of R on CRAN. Note that R 3.0.0 is 7 years old. You shoudl realy consider to update to 4.0.2. Best, Uwe Ligges On 05.10.2020 09:56, Steven Yen wrote: I had to install/use an older version of (R-3.0.3) for a reason. While installing a package from CRAN (either in RStudio or R), I received the following warning message saying unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0. See message below. In this case, I tried to install "aod". The install nevertheless went through, as confirmed by the library statement (I did not try to use it). Any idea? Thank you. = Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 > install.packages("aod") Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 package ‘aod’ is available as a source package but not as a binary Warning in install.packages : package ‘aod’ is not available (for R version 3.0.3) > library(aod) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] unable to access index for repository...
From ../ReadMe in the mentioned web resource: "Packages for R >= 1.7.0 and R < 3.2.0 are available from https://cran-archive.r-project.org/bin/windows/contrib/; We do not hold binaries of several year old versions of R on CRAN. Note that R 3.0.0 is 7 years old. You shoudl realy consider to update to 4.0.2. Best, Uwe Ligges On 05.10.2020 09:56, Steven Yen wrote: I had to install/use an older version of (R-3.0.3) for a reason. While installing a package from CRAN (either in RStudio or R), I received the following warning message saying unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0. See message below. In this case, I tried to install "aod". The install nevertheless went through, as confirmed by the library statement (I did not try to use it). Any idea? Thank you. = Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 > install.packages("aod") Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 Warning in install.packages : unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.0 package ‘aod’ is available as a source package but not as a binary Warning in install.packages : package ‘aod’ is not available (for R version 3.0.3) > library(aod) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Why does a 2 GB RData file exceed my 16GB memory limit when reading it in?
On 02.09.2020 04:44, David Jones wrote: I ran a number of analyses in R and saved the workspace, which resulted in a 2GB .RData file. When I try to read the file back into R Compressed in RData but uncompressed in main memory later, it won't read into R and provides the error: "Error: cannot allocate vector of size 37 Kb" This error comes after 1 minute of trying to read things in - I presume a single vector sends it over the memory limit. But, memory.limit() shows that I have access to a full 16gb of ram on my machine (12 GB are free when I try to load the RData file). But the data may need more gc() shows the following after I receive this error: used (Mb) gc trigger (Mb) max used (Mb) Ncells 623130 33.3 4134347 220.8 5715387 305.3 Vcells 1535682 11.8 883084810 6737.5 2100594002 16026.3 So 16GB were used when R gave up. Best, Uwe Ligges __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error: cannot remove prior installation of package ‘BiocManager’
The packages must not be loaded when you try to update. Best, Uwe Ligges On 19.06.2020 12:07, Ankush Sharma wrote: Dear all, I am working R version 4.0.1 macos catalina , I´m not able to load libraries e.g ggplot2 Error: Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘gtable’ Then i tried installing gtable, But installation is showing error : Error in install.packages : cannot remove prior installation of package ‘gtable’ This is also for other packages like BiocManager, when I manually changed the name or removed the BiocManager from the library, the package was smoothly installed. Any pointers on how to solve this problem without manual removal of packages. remove.packages command is also not working. Thanks in advance. Best Regards *Ankush Sharma* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with library path
On 29.05.2020 08:32, Hiram Saúl Rebollar Fuentes wrote: Hi, I have a problem when I try to load a library, and I think it’s because my username has a special character in it, the library path is C:/Users/Saúl/Documents/R/win-library/4.0, but R reads it as C:/Users/Saú Documents/R/win-library/4.0 Simplest solution is to use a plain ASCII path without blanks. Best, Uwe Ligges How can this be fixed? Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] incomplete reading of a large csv file
On 21.02.2020 20:10, Christopher W. Ryan wrote: sessionInfo at end of message. I have data that I was given as an Excel .xlsx file. It contains 96266 lines and 24 columns. I opened it in OpenOffice.org and saved it in .csv format, using the pipe character as a field separator. This produced a file with 96266 lines. When I read it into R thusly: skip0.dd <- read.csv("AmbulanceDispatches2017-2019-02-18-2020.csv", sep = "|", header = TRUE, comment.char = "", skip = 0) the resulting skip0.dd dataframe has only 58208 lines: dim(skip0.dd) [1] 5820824 I've tried a variety of things to troubleshoot. Using head() and tail(), the expected first and last lines (comparing to the .csv file) do indeed exist in skip0.dd. Several arbitrary lines from the "middle" of the csv file are also present in the skip0.dd dataframe. I tried reading only the first column, which is integer, but still it appears that not all lines are read in: classes <- c(NA, rep("NULL", 23)) skip01.dd <- read.csv("AmbulanceDispatches2017-2019-02-18-2020.csv", sep = "|", header = TRUE, comment.char = "", skip = 0, colClasses = classes) dim(skip01.dd) [1] 582081 Skipping the first 5 lines nominally should give me a dataframe of 46266 lines, or at least one of 5 fewer lines than skip0.dd (i.e. 8208 lines), but it does neither: skip5.dd <- read.csv("AmbulanceDispatches2017-2019-02-18-2020.csv", sep = "|", header = TRUE, comment.char = "", skip = 5) dim(skip5.dd) [1] 2217024 Any thoughts on what might be going wrong? Some funky characters from Excel or OpenOffice.org lurking in the .csv file? quotes are a typical proiblem, what if you try with arg quote=""? Perhaps I'd have more success with one of the packages that enables reading directly from an .xlsx file. Thanks. --Chris Ryan SUNY Upstate Medical University Binghamton Clinical Campus Broome County Health Department Binghamton University sessionInfo() R version 3.5.3 (2019-03-11) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] dplyr_0.8.3 stringr_1.4.0 Hmisc_4.2-0 ggplot2_3.2.1 [5] Formula_1.2-3 survival_2.44-1.1 lattice_0.20-38 loaded via a namespace (and not attached): [1] Rcpp_1.0.1 pillar_1.4.0compiler_3.5.3 [4] RColorBrewer_1.1-2 tools_3.5.3 base64enc_0.1-3 [7] digest_0.6.18 zeallot_0.1.0 rpart_4.1-13 [10] checkmate_1.9.3 tibble_2.1.1gtable_0.3.0 [13] htmlTable_1.13.1pkgconfig_2.0.2 rlang_0.4.0 [16] Matrix_1.2-15 rstudioapi_0.10 xfun_0.7 [19] gridExtra_2.3 knitr_1.23 withr_2.1.2 [22] cluster_2.0.7-1 htmlwidgets_1.3 vctrs_0.2.0 [25] grid_3.5.3 nnet_7.3-12 tidyselect_0.2.5 [28] data.table_1.12.2 glue_1.3.1 R6_2.4.0 [31] foreign_0.8-71 latticeExtra_0.6-28 purrr_0.3.2 [34] magrittr_1.5htmltools_0.3.6 backports_1.1.4 [37] scales_1.0.0splines_3.5.3 assertthat_0.2.1 [40] colorspace_1.4-1stringi_1.4.3 acepack_1.4.1 [43] lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] .Random.seed for the Mersenne Twister
Exactly, from ?.Random.seed: "In the underlying C, .Random.seed[-1] is unsigned; therefore in R .Random.seed[-1] can be negative, due to the representation of an unsigned integer by a signed integer. " and "It can be saved and restored, but should not be altered by the user. " Best, Uwe Ligges On 09.01.2020 16:40, Jeff Newmiller wrote: I am no expert on this specific algorithm, but there is no "32-bit unsigned integer" type in R. Presumably the interpretation of those negative numbers in the C code is as if they were unsigned while R presents them as if they were signed because it cannot do otherwise. AFAIK you need to use set.seed to configure .Random.seed, and you can retrieve and later restore the vectors created this way in the future. As I understand it there exist invalid vectors that cannot arbitrarily be used by this algorithm so generating them yourself is at the very least hard, and possibly could break in future versions of R. On January 9, 2020 1:18:01 AM PST, Luca Passalacqua via R-help wrote: Dear R users, inspecting .Random.seed for the Mersenne Twister (MT) I find (many) negative values for the 624 values of the initial state of the generator. It seems to me that this is a bug (an unsigned integer mapped to a signed integer ?), since, to my understanding, the R version of MT should be working with 32-bits unsigned long. Moreover, this prevents starting the generator by setting .Random.seed to user provided values. Could someone please provide some insight to this issue ? Many thanks, Luca Passalacqua RNGkind('default')> RNGkind()[1] "Mersenne-Twister" "Inversion" set.seed(1)> .Random.seed [1] 403 624 -169270483 -442010614 -603558397 ... __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Column 'xyz' does not exist
Use the functional style such as mean(x) instead of the piping style such as x %>% mean. Best, Uwe Ligges On 30.07.2019 11:26, Tolulope Adeagbo wrote: Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in : Column `Previous_stage` is unknown. Ans please what do you mean by functional programming style? On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges <mailto:lig...@statistik.tu-dortmund.de>> wrote: Don't use pipes but functional programming style, then you can eaasily traceback() and use debugging tools. Best, Uwe Ligges On 30.07.2019 11:03, Tolulope Adeagbo wrote: > So I'm having this error: > > column 'Previous stage does not exist' > > bal_matrix = loan_data_2 %>% as.tibble() %>% > dplyr::arrange(Account_number) %>% > dplyr::group_by(Previous_stage, Current_stage) %>% > dplyr::summarise( > Total_bal = sum(Balance, na.rm = TRUE) > ) %>% > tidyr::spread(key = Current_stage, value = Total_bal, fill = 0) > > Please assist. > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org <mailto:R-help@r-project.org> mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Column 'xyz' does not exist
Don't use pipes but functional programming style, then you can eaasily traceback() and use debugging tools. Best, Uwe Ligges On 30.07.2019 11:03, Tolulope Adeagbo wrote: So I'm having this error: column 'Previous stage does not exist' bal_matrix = loan_data_2 %>% as.tibble() %>% dplyr::arrange(Account_number) %>% dplyr::group_by(Previous_stage, Current_stage) %>% dplyr::summarise( Total_bal = sum(Balance, na.rm = TRUE) ) %>% tidyr::spread(key = Current_stage, value = Total_bal, fill = 0) Please assist. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with random numbers/seed
On 21.06.2019 19:09, Steven Yen wrote: Now I see that results were replicated but running RNGversion I get a warning message. Isn't there a way to do this clean? Well, the old RNG is known to be not optimal, hence we give a warning if you choose the old one. This is the clean way if you really want to get the old (slightly buggy) behaviour. Best, Uwe Ligges RNGversion("3.5.3") Warning message: In RNGkind("Mersenne-Twister", "Inversion", "Rounding") : non-uniform 'Rounding' sampler used On 6/22/2019 1:03 AM, Uwe Ligges wrote: What does not work? For me it works under R-3.6.0: x<-1:500 set.seed(12345671) j<-sample(1:length(x),size=60); y<-x[j] summary(j) RNGversion("3.5.3") set.seed(12345671) j<-sample(1:length(x),size=60); y<-x[j] summary(j) Now I get the results you got udner the old R. Best, Uwe Ligges On 21.06.2019 18:39, Steven Yen wrote: Thanks. Somewhat of a mystery. The older version I had was R-3.5.3patched. I cannot get the RNGversion command to run. Can you help? Thanks. On 6/22/2019 12:25 AM, Uwe Ligges wrote: See the NEWS, the RNG has been changed, use RNGversion On 21.06.2019 18:10, Steven Yen wrote: Dear all, I did all this work with older R (R-3.5.3.patched and older) but now with R3.6 I cannot replicate the results. Below I sample 60 observations from 1:500 using the sample command with a random seed of 123. I get different results. Advice appreciated. Steven Yen > # Run under R-3.6.0 > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 26.0 134.2 240.0 249.8 368.0 500.0 > # Run under R-3.5.3.patched > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 9.0 122.2 205.0 236.1 364.2 493.0 Under R-3.6.0 use, e.g. RNGversion("3.5.2") to get reproducible results from the older RNG. Best, Uwe Ligges -- st...@ntu.edu.tw (S.T. Yen) __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with random numbers/seed
What does not work? For me it works under R-3.6.0: x<-1:500 set.seed(12345671) j<-sample(1:length(x),size=60); y<-x[j] summary(j) RNGversion("3.5.3") set.seed(12345671) j<-sample(1:length(x),size=60); y<-x[j] summary(j) Now I get the results you got udner the old R. Best, Uwe Ligges On 21.06.2019 18:39, Steven Yen wrote: Thanks. Somewhat of a mystery. The older version I had was R-3.5.3patched. I cannot get the RNGversion command to run. Can you help? Thanks. On 6/22/2019 12:25 AM, Uwe Ligges wrote: See the NEWS, the RNG has been changed, use RNGversion On 21.06.2019 18:10, Steven Yen wrote: Dear all, I did all this work with older R (R-3.5.3.patched and older) but now with R3.6 I cannot replicate the results. Below I sample 60 observations from 1:500 using the sample command with a random seed of 123. I get different results. Advice appreciated. Steven Yen > # Run under R-3.6.0 > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 26.0 134.2 240.0 249.8 368.0 500.0 > # Run under R-3.5.3.patched > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 9.0 122.2 205.0 236.1 364.2 493.0 Under R-3.6.0 use, e.g. RNGversion("3.5.2") to get reproducible results from the older RNG. Best, Uwe Ligges -- st...@ntu.edu.tw (S.T. Yen) __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem with random numbers/seed
See the NEWS, the RNG has been changed, use RNGversion On 21.06.2019 18:10, Steven Yen wrote: Dear all, I did all this work with older R (R-3.5.3.patched and older) but now with R3.6 I cannot replicate the results. Below I sample 60 observations from 1:500 using the sample command with a random seed of 123. I get different results. Advice appreciated. Steven Yen > # Run under R-3.6.0 > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 26.0 134.2 240.0 249.8 368.0 500.0 > # Run under R-3.5.3.patched > x<-1:500 > set.seed(12345671) > j<-sample(1:length(x),size=60); y<-x[j] > summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max. 9.0 122.2 205.0 236.1 364.2 493.0 Under R-3.6.0 use, e.g. RNGversion("3.5.2") to get reproducible results from the older RNG. Best, Uwe Ligges __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem in using 'plm' package after updating R
IN addition, you install to Documents\R\win-library\3.3 which suggest you have updated R but are still suing the old version 3.3.x? Best, Uwe Ligges On 04.06.2019 14:47, peter dalgaard wrote: Looks like you are not equipped to install source packages, so don't Or, possibly, install from source has an unstated dependency on package "stringr" so try install that first. -pd On 3 Jun 2019, at 05:38 , Wong David wrote: Dear Madam/ Sir, After I tried to update the plm package based on the enclosure [i.e. download the package.soruces (tar.gz)], I still found the following errors as bold in black: "--- Please select a CRAN mirror for use in this session --- There is a binary version available but the source version is later: binary source needs_compilation plm 1.6-6 2.0-1 FALSE installing the source package ‘plm’ trying URL 'https://mirror-hk.koddos.net/CRAN/src/contrib/plm_2.0-1.tar.gz' Content type 'application/x-gzip' length 2343782 bytes (2.2 MB) downloaded 2.2 MB * installing *source* package 'plm' ... ** package 'plm' successfully unpacked and MD5 sums checked ** R ** data ** inst ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'stringr' ERROR: lazy loading failed for package 'plm' * removing 'C:/Users/David Wong/Documents/R/win-library/3.3/plm' * restoring previous 'C:/Users/David Wong/Documents/R/win-library/3.3/plm' The downloaded source packages are in ‘C:\Users\David Wong\AppData\Local\Temp\RtmpcPaQsM\downloaded_packages’ Warning messages: 1: running command '"C:/PROGRA~1/R/R-33~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\David Wong\Documents\R\win-library\3.3" C:\Users\DAVIDW~1\AppData\Local\Temp\RtmpcPaQsM/downloaded_packages/plm_2.0-1.tar.gz' had status 1 2: In install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) : installation of package ‘plm’ had non-zero exit status" Please help. Thanks and regards, David Wong from Hong Kong 发件人: Wong David 发送时间: 2019年5月31日 7:21 收件人: r-help-ow...@r-project.org; r-help@r-project.org 主题: Problem in using 'plm' package after updating R Dear Madam/ Sir, After I updated the latest packages in R this afternoon, I found that I cannot use 'plm' package. The error messages are as follows: "R version 3.3.3 (2017-03-06) -- "Another Canoe" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-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. 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. 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. Warning: namespace ‘plm’ is not available and has been replaced by .GlobalEnv when processing object ‘inst_f’ [Previously saved workspace restored] utils:::menuInstallPkgs() --- Please select a CRAN mirror for use in this session --- There is a binary version available but the source version is later: binary source needs_compilation plm 1.6-6 2.0-1 FALSE installing the source package ‘plm’ trying URL 'https://mirror-hk.koddos.net/CRAN/src/contrib/plm_2.0-1.tar.gz' Content type 'application/x-gzip' length 2343782 bytes (2.2 MB) downloaded 2.2 MB * installing *source* package 'plm' ... ** package 'plm' successfully unpacked and MD5 sums checked ** R ** data ** inst ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'stringr' ERROR: lazy loading failed for package 'plm' * removing 'C:/Users/David Wong/Documents/R/win-library/3.3/plm' * restoring previous 'C:/Users/David Wong/Documents/R/win-library/3.3/plm' The downloaded source packages are in ‘C:\Users\David Wong\AppData\Local\Temp\RtmpEdDjdI\downloaded_packages’ Warning messages: 1: running command '"C:/PROGRA~1/R/R-33~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\David Wong\Documents\R\win-library\3.3" C:\Users\DAVIDW~1\AppData\Local\Temp\RtmpEdDjdI/downloaded_packages/plm_2.0-1.tar.gz' had status 1 2: In install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) : installation of package ‘plm’ had non-zero exit status library(plm) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘stringr’ Error: package or namespace load failed for ‘plm’ help.start() starting httpd help server ... done If nothing happens, you should open ‘http
Re: [R] Tying to underdressed the magic of lm redux
Simply quote the colnames in the call, i.e.: demo("a", "b", df) Best, Uwe Ligges On 02.06.2019 03:43, Sorkin, John wrote: Colleagues, Despite Bert having tried to help me, I am still unable to perform a simple act with a function. I want to pass the names of the columns of a dataframe along with the name of the dataframe, and use the parameters to allow the function to access the dataframe and modify its contents. I apologize multiple postings regarding this question, but it is a fundamental concept that one who wants to program in R needs to know. Thank you, John # Create a toy dataframe. df <- data.frame(a=c(1:20),b=(20:39)) df # Set up a function that will access the first and second columns of the # data frame, print the columns of the dataframe and add the columns demo <- function(first,second,df) { # None of the following work print(df[,all.vars(first)]) print(df[,first]) print(df[,"first"]) print(df[,all.vars(second)]) print(df[,second]) print(df[,"second"]) df[,"sum"] <- print(df[,first])+print(df[,second]) } demo(a,b, df) John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) From: Bert Gunter Sent: Wednesday, May 29, 2019 11:27 PM To: Sorkin, John Cc: r-help@r-project.org Subject: Re: [R] Tying to underdressed the magic of lm redux Depends on how you want to specify variables. You are not clear (to me) on this. But, for instance: demo <- function(form,df) { av <- all.vars(form) df[,av] } demo(~a+b, df) demo(a~b,df) ?all.vars, ?all.names for details Bert Gunter On Wed, May 29, 2019 at 7:33 PM Sorkin, John mailto:jsor...@som.umaryland.edu>> wrote: Bert, Thank you for your reply. You are correct that your code will print the contents of the data frame. While it works, it is not as elegant as the lm function. One does not have to pass the independent and dependent variables to lm In parentheses. Fit1<-lm(y~x,data=mydata) None of the parameters to lm are passed in quotation marks. Somehow, using deparse(substitute()) and other magic lm is able to get the data in the dataframe mydata. I want to be able to do the same magic in functions I write; pass a dataframe and column names, all without quotation marks and be able to write code that will provide access to the columns of the dataframe without having to pass the column names in quotation marks. Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) On May 29, 2019, at 9:59 PM, Bert Gunter mailto:bgunter.4...@gmail.com>> wrote: Basically, huh? df <- data.frame(a = 1:3, b = letters[1:3]) nm <- names(df) print(df[,nm[1]]) [1] 1 2 3 print(df[,nm[2]]) [1] a b c Levels: a b c This can be done within a function, of course: demo <- function(df, colnames){ +print(df[,colnames]) + } demo(df,c("a","b")) a b 1 1 a 2 2 b 3 3 c Am I missing something? (Apologies, if so). Bert Gunter On Wed, May 29, 2019 at 6:40 PM Sorkin, John mailto:jsor...@som.umaryland.edu>> wrote: Thanks to several kind people, I understand how to use deparse(substitute(paramter)) to get as text strings the arguments passed to an R function. What I still can't do is put the text strings recovered by deparse(substitute(parameter)) back together to get the columns of a dataframe passed to the function. What I want to do is pass a column name to a function along with the name of the dataframe and then, within the function access the column of the dataframe. I want the function below to print the columns of the dataframe testdata, i.e. testdata[,"FSG"] and testdata[,"GCM"]. I have tried several ways to tell the function to print the columns; none of them work. I thank everyone who has helped in the past, and those people who will help me now! John testdata <- structure(list(FSG = c(271L, 288L, 269L, 297L, 311L, 217L, 235L, 172L, 201L, 162L), CGM = c(205L, 273L, 226L, 235L, 311L, 201L, 203L, 155L, 182L, 163L)), row.names = c(NA, 10L), class = "data.frame") cat("This is the data frame") class(testdata) testdata BAPlot <- function(first,second,indata){ # these lines of code work col1 &l
Re: [R] Help with replace()
On 12.07.2018 18:09, Bill Poling wrote: Yes, that's got it! (20 years from now I'll have it all figured out UGH!), lol! Using R for 20 years myself now I can only tell that it takes much longer. Best, Uwe Ligges Thank you David Min. 1st Qu. Median Mean 3rd Qu. Max. "1977-07-16" "1984-03-13" "1990-08-16" "1990-12-28" "1997-07-29" "2002-12-31" WHP From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thursday, July 12, 2018 11:29 AM To: Bill Poling Cc: r-help (r-help@r-project.org) Subject: Re: [R] Help with replace() On Jul 12, 2018, at 8:17 AM, Bill Poling mailto:bill.pol...@zelis.com>> wrote: R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) Hi. I have data set with day month year integers. I am creating a date column from those using lubridate. a hundred or so rows failed to parse. The problem is April and September have day = 31. paste(df1$year, df1$month, df1$day, sep = "-") ymd(paste(df1$year, df1$month, df1$day, sep = "-"))#Warning message: 129 failed to parse. As expected in tutorial #The resulting Date vector can be added to df1 as a new column called date: df1$date <- ymd(paste(df1$year, df1$month, df1$day, sep = "-"))#Same warning head(df1) sapply(df1$date,class) #"date" summary(df1$date) # Min. 1st Qu. Median Mean 3rd Qu. Max. NA's #"1977-07-16" "1984-03-12" "1990-07-22" "1990-12-15" "1997-07-29" "2002-12-31" "129" is_missing_date <- is.na(df1$date) View(is_missing_date) date_columns <- c("year", "month", "day") missing_dates <- df1[is_missing_date, date_columns] head(missing_dates) # year month day # 3144 2000 9 31 # 3817 2000 4 31 # 3818 2000 4 31 # 3819 2000 4 31 # 3820 2000 4 31 # 3856 2000 9 31 I am trying to replace those with 30. Seems like a fairly straightforward application of "[<-" with a conditional argument. (No need for tidyverse.) missing_dates$day[ missing_dates$day==31 & ( missing_dates$month %in% c(4,9) )] <- 30 missing_dates year month day 3144 2000 9 30 3817 2000 4 30 3818 2000 4 30 3819 2000 4 30 3820 2000 4 30 3856 2000 9 30 Best; David. I am all over the map in Google looking for a fix, but haven't found one. I am sure I have over complicated my attempts with ideas(below) from these and other sites. https://stackoverflow.com/questions/14737773/replacing-occurrences-of-a-number-in-multiple-columns-of-data-frame-with-another?noredirect=1=1<https://stackoverflow.com/questions/14737773/replacing-occurrences-of-a-number-in-multiple-columns-of-data-frame-with-another?noredirect=1=1> https://www.rdocumentation.org/packages/base/versions/3.5.1/topics/replace<https://www.rdocumentation.org/packages/base/versions/3.5.1/topics/replace> https://stackoverflow.com/questions/48714625/error-in-data-frame-unused-argument<https://stackoverflow.com/questions/48714625/error-in-data-frame-unused-argument> The following are screwy attempts at this simple repair, ??mutate_if ??replace is_missing_date <- is.na(df1$date) View(is_missing_date) date_columns <- c("year", "month", "day") missing_dates <- df1[is_missing_date, date_columns] head(missing_dates) #year month day # 3144 2000 9 31 # 3817 2000 4 31 # 3818 2000 4 31 # 3819 2000 4 31 # 3820 2000 4 31 # 3856 2000 9 31 #So need those months with 30 days that are 31 to be 30 View(missing_dates) install.packages("dplyr") library(dplyr) View(missing_dates) # ..those were the values you're going to replace I thought this function from stackover would work, but get error when I try to add filter #https://stackoverflow.com/questions/14737773/replacing-occurrences-of-a-number-in-multiple-columns-of-data-frame-with-another?noredirect=1=1<https://stackoverflow.com/questions/14737773/replacing-occurrences-of-a-number-in-multiple-columns-of-data-frame-with-another?noredirect=1=1> df.Rep <- function(.data_Frame, .search_Columns, .search_Value, .sub_Value){ .data_Frame[, .search_Columns] <- ifelse(.data_Frame[, .search_Columns]==.search_Value,.sub_Value/.search_Value,1) * .data_Frame[, .search_Columns] return(.data_Frame) } df.Rep(missing_dates, 3, 31, 30) #--So I should be able to apply this to the complete df1 data somehow? head(df1) df.Rep(df1, filter(month == c(4,9)), 31, 30) #Error in month == c(4, 9) : comparison (1) is possible only for atomic and list types Other screwy attempts: select(df1, month, day, year) str(df1) #'data.frame': 34786 obs. of 14 variables: #To choose rows, use filter(): #mutate_if(df1, month =4,9), day = 30) filter(df1, month == c(4,9), day == 31) df1 %>% group_by(month == c(4,9), day ==
Re: [R] package : plm : pgmm question
Please talk to the package maintainer whi may not be listen on R-help. Best, Uwe Ligges On 25.12.2017 10:53, Ye Dong wrote: Dear Sir, I am using the package pgmm you build in panel regression. However, I found that when T is 10, N=30, the error would show as following: system is computationally singular: reciprocal condition number But the similar code works well on Stata, so I wonder how I can optimize the algorithm, for example , the inverse matrix optimization ? And I have checked my data as well, no multicollinearity problem exists. Another problem is that although I have some NA in the panel data, the panel dataframe is still recognized as balanced model. But with plm, the dataframe would be recognized unbalanced. Thanks and Best regards, Ye Dong [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Scatterplot3d :: Rotating x tick labels by x degrees
On 31.10.2017 00:56, Alex Restrepo wrote: Hi, I would like to rotate the x axis tick labels by 45 degrees. Using the code below, could someone please provide an example? Many Thanks In Advance, Alex 45 degree rotation is not supported in base R graphics and scatterplot3d uses that. You can use par(las=2) before your code and get them rrotated by 90 degrees, or you can add them individually by s3d <- scatterplot3d( Afterwards you could try along trhese lines: par(xpd=TRUE) text(s3d$xyz.convert(desired positions of labels in 3D coordinate system), labels, angle=45) (untested) Best, Uwe Ligges library("scatterplot3d") mydf=data.frame(rate=seq(158, 314) ,age=seq(1, 157) ,market_date=seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="7 days")) mydf$market_date=as.Date(mydf$market_date, format="%Y-%m-%d") scatterplot3d(mydf$market_date ,mydf$rate ,mydf$age ,x.ticklabs = seq(as.Date("2000/1/1"), as.Date("2003/1/1"), by="330 days")) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Notes for new R version 3.4.2
Sounds like you have some base packages from an old version of R. Perhaps copy in another library tree that comes firt on the search path? Best, Uwe Ligges On 11.10.2017 02:58, kevin luo wrote: Dear officers, Sorry to bother you. Recently, I have installed the R version 3.4.2. But some cautions appear in the console as the following: Note: no visible global function definition for 'radixsort' This note didn't affect the normal operation of some statistical packages. BUT it does great affect the ggplot2 and the other graphics systems in my PC. So, what can I do to fix this bugs or is there any remedy to make things ok? Thanks for your reading! Best! Kai Luo Ph.D. candidate Peking Union Medical College Beijing,China zip: 100730 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Block comment?
On 02.09.2017 11:40, Christian wrote: I consider it quite worth while to introduce into R syntax a nestable block comment like #{ }# if(FALSE){ } Best, Uwe Ligges It would make documentation more easily manageable and lucid. Is there considerable need for this. Please, comment on this. How about R core? Christian __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Difficulty Installing Packages
On Windows, if you load a dll, this is locked. Hence, for package installations, close all R instances, start one without loading packages and then update packages. Best, Uwe Ligges On 26.08.2017 15:18, Bill Denney wrote: Hi, When installing packages in Windows (currently using Windows 10 with all service packs), occasionally, I get a warning similar to the following: package 'Rcpp' successfully unpacked and MD5 sums checked Warning in install.packages : unable to move temporary installation 'C:\Users\William Denney\Documents\R\win-library\3.4\file32701900456\Rcpp' to 'C:\Users\William Denney\Documents\R\win-library\3.4\Rcpp' This can occur when installing many packages where the package that could not be moved (e.g. Rcpp) is a dependency. In the end, the package where the warning is issued is not available to load, and I have to spend time figuring out why. The usual reason is that for some reason during the package install process the library directory ("C:\Users\William Denney\Documents\R\win-library\3.4\") has been set to partially or fully read-only. I have a couple of questions: * Why is the directory set to read-only? It happens almost every time that I install packages that are compiled. (It doesn't seem to occur with interpreted-only packages.) * Shouldn't that warning be an error or at least prevent the packages that depend on the one that couldn't be moved from being installed? The way that it tends to go, package installation completes with that warning, and then I have to clean up the mess of missing dependencies. Thanks, Bill [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] likert Package
If this is not docuemnted that way, write to the package maintainer. Best, Uwe Ligges On 23.08.2017 02:51, Jeff Reichman wrote: R- Help Forum Working with the "likert" package and find that my "bar" graphs are backwards (see attached) summary(results) Item low neutral high meansd 4 Q4 5 15 80 2.75 0.5501196 5 Q5 20 40 40 2.20 0.7677719 1 Q1 65 305 1.40 0.5982430 3 Q3 5 905 2.00 0.3244428 2 Q2 90 100 1.10 0.3077935 results <- likert(data[,2:6], grouping = data$Group) plot(results, type = "bar", centered = FALSE, group.order = c("Band 3", "Band 4")) In the attached figure the percentages appear correct but the bars are backwards (or appear to be backwards) Figure.png __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] SPSS R Factor v2.4.2
Actually there is also a Windows binary: https://cran.r-project.org/bin/windows/contrib/3.2/polycor_0.7-8.zip hence installing with install.packages("polycor") should work *if* you choose a http (not https) mirror. The latter was not possible in R-3.2.0 which probably is what you are taking about. Best, Uwe Ligges On 06.08.2017 07:08, David Winsemius wrote: On Aug 5, 2017, at 7:02 PM, Gavin Brown <gt.br...@auckland.ac.nz> wrote: I am not an R-Head, hence I use nice utilities that integrate R into SPSS I have SPSS v24, R3.20 and R3.40 I have run IBM SPSS R Integration which requires linking to R3.20 I have installed R Factor v2.4.2 This package requires 'polycor' library Unfortunately, 'polycor' does not exist in R3.20 That's not really correct. There is an archived version that should be compatible with your out-of-date version of R. See: ftp://cran.r-project.org/pub/R/src/contrib/Archive/polycor/ Good luck; David. DATASET ACTIVATE DataSet1. *M�rio Basto, Jos� Manuel Pereira, IPCA *Required: SPSS 21 and R Integration Plugin *R Packages required: psych, polycor, GPArotation, nFactors, corpcor, ICS, R.utils. set printback off. Error in library(polycor) : there is no package called 'polycor' This means the very good utility does not run in the way I have installed both R and SPSS Does anyone know what I've done wrong and how to overcome this? Prof. Gavin T L Brown, PhD Director Quantitative Data Analysis and Research Unit Faculty of Education & Social Work The University of Auckland Tel: +64 9 3737599 ext. 48602 Mob: +64 22 108 7253 Honorary Professor, Dept. of Curriculum & Instruction, Education University of Hong Kong Affiliated Professor, Dept. of Applied Educational Sciences, University of Umea, Sweden New: https://www.routledge.com/Assessment-of-Student-Achievement/Brown/p/book/9781138061866 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] greek letters do not work in expression
There is no internationalization of help pages, only of messages. Best, Uwe On 30.07.2017 21:51, David Winsemius wrote: On Jul 30, 2017, at 8:25 AM, Uwe Ligges <lig...@statistik.tu-dortmund.de> wrote: On 30.07.2017 17:22, Milan Cisty wrote: Dear all, I appreciate suggestions for following problem. I wrote to RStudio: plot(c(1,20),c(1,20), xlab = expression(paste(alfa))) or the same happen when I wrote: plot(c(1,20),c(1,20), xlab = expression(alfa)) Write "alpha", not "alfa". To Misty; This makes me wonder if the internationalization of the R documentation is overly "aggressive" in changing the spelling of "Greek" letters to conform to local spellings. Does your ?plotmath page spell the first letter in the Greek alphabet as "alfa". Best, Uwe Ligges -- David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] greek letters do not work in expression
On 30.07.2017 17:22, Milan Cisty wrote: Dear all, I appreciate suggestions for following problem. I wrote to RStudio: plot(c(1,20),c(1,20), xlab = expression(paste(alfa))) or the same happen when I wrote: plot(c(1,20),c(1,20), xlab = expression(alfa)) Write "alpha", not "alfa". Best, Uwe Ligges what happen is, that description under x label is exactly "alpha", not greek letter alfa (α). Please where should I search problem, or what information to sent to list for identification of this problem? Thanks, Milan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] about installing smwrGraphs package
On 23.07.2017 05:28, lily li wrote: Hi R users, I'm trying to install the package, but got the error and don't know how to fix it. Can anyone help me? Thanks very much. install.packages("smwrGraphs", repos=c("http://owi.usgs.gov/R",; I guess "http://owi.usgs.gov/R; does not provide standard repositories for R? Best, Uwe Ligges http://cran.us.r-project.org;), dependencies = TRUE) Error in install.packages : Line starting ' ...' is malformed! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem for installing cbPlatte on R Version 3.4.1
On 12.07.2017 12:35, Shanu Singh wrote: Hi John, Thanks for reply ! Sorry It was my mistake. It is *cbPalette. *Basically its a R package. Come on. - Where do you want to get thsi from? - What have you tried to do so? Please re-read the posting guide that helps to ask good questions. Best, Uwe Ligges Shanu On Wed, Jul 12, 2017 at 3:57 PM, John Kane <jrkrid...@yahoo.ca> wrote: What is cbplatte? Where do we find it? On Wednesday, July 12, 2017, 6:20:38 AM EDT, Shanu Singh < singh.shanu1...@gmail.com> wrote: Please solve the problem. on which R Version works cbplatte? Regards Shanu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problem for installing cbPlatte on R Version 3.4.1
On 12.07.2017 12:03, Shanu Singh wrote: Please solve the problem. on which R Version works cbplatte? What is cbPlatte or cbplatte (case matters). Best, Uwe Ligges Regards Shanu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] devtools::check "hangs"
On 12.07.2017 10:31, Sigbert Klinke wrote: Hi, checking my package with check from devtools leads to the output Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. See chapter ‘Writing R documentation files’ in the ‘Writing R Extensions’ manual. * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... Take a look in the example log files in the corresponding check dir. Best, Uwe Ligges and that is the last thing I get. Since I write shiny apps, it may happen that somewhere an example expects some input/interactivity and is not in \dontrun environment. How I can see which example currently is checked? Thanks in advance Sigbert __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] 3D plot with coordinates
package rgl. Best, Uwe Ligges On 20.06.2017 21:29, Alaios via R-help wrote: HelloI have three x,y,z vectors (lets say each is set as rnorm(360)). So each one is having 360 elements each one correpsonding to angular coordinates (1 degree, 2 degrees, 3 degrees, 360 degrees) and I want to plot those on the xyz axes that have degress. Is there a function or library to look at R cran? The ideal will be that after plotting I will be able to rotate the shape. I would like to thank you in advance for your helpRegardsAlex [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [FORGED] Re: Question on function "scatterplot3d"
On 01.06.2017 10:03, Rolf Turner wrote: On 01/06/17 19:54, Uwe Ligges wrote: A design flaw, whether the labels are cut depends somewhat on the sizce of the device, hence there is the argument y.margin.add add additional space between tick mark labels and axis label of the y axis for working around that limittation that can be set to some positive value This seems to be addressing Hannah's (li li's) original enquiry, not my follow-up in which I worried about the position, along the y-axis, of the y-axis label. Ah, that is intended as a smart way of rotating it along the axis is not easy (if not impossible) with the bas egraohics system. Best, Uwe Ligges Or am I misunderstanding/missing something? cheers, Rolf __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installed.packages() does not work properly
Try R-3.4.0 patched. Best, Uwe Ligges On 01.06.2017 03:54, Anil Dabral wrote: Hi, I tried executing the following statement multiple times on R 3.4 and it worked only the first time. In older versions of R it seems to have worked. Am I doing anything wrong? In R 3.4 (works only the first time) tmp <- installed.packages() #this works tmp <- installed.packages() ## See error below Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && : missing value where TRUE/FALSE needed in R 3.3.3 works well when executed multiple times. tmp <- installed.packages() #this works tmp <- installed.packages() #this works tmp <- installed.packages() #this works Thanks and Regards, Anil Sent from Outlook<http://aka.ms/weboutlook> [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] [FORGED] Re: Question on function "scatterplot3d"
A design flaw, whether the labels are cut depends somewhat on the sizce of the device, hence there is the argument y.margin.add add additional space between tick mark labels and axis label of the y axis for working around that limittation that can be set to some positive value Best, Uwe Ligges On 01.06.2017 07:15, Rolf Turner wrote: On 01/06/17 13:17, Ismail SEZEN wrote: On 1 Jun 2017, at 03:41, li li <hannah@gmail.com> wrote: Hi all, I have a question with regard to making plots using function "scatterplot3d". Please see the example below. It looks like, for y axis, the tickmark text was cutoff. The number "10" does not show up completely. I tried to work with par(mpg). It does not seem to work. Hope to get some advice here. Thanks much! Hanna C <- runif(30) B <- rep(1:3, each=10) A <- rep(1:10,3) scatterplot3d(B,A,C, type = "h", lwd = 1, pch = 16, color="red", main = "", grid=TRUE, col.grid="lightgreen", xlab="x", ylab="y", zlab="z”) Everything seems ok to me. Try to reset/clear all plots in your plotting window and try only to run the code above. Perhaps You changed par settings before in some point? I tried the code given above, and after I replaced the deleted> incorrect double quote mark (after the final "z"), it ran and looked OK *except* for the positioning of the "y" axis label, which is at the "far end" of the y-axis rather than being at the "centre" of the y-axis. (See attached.) Is this a bug? cheers, Rolf Turner P.S. I have also attached the code in the file "scatScript.txt", for convenience. P^2. S.: > sessionInfo() R Under development (unstable) (2017-04-21 r72585) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.2 LTS Matrix products: default BLAS: /usr/local/lib/R/lib/libRblas.so LAPACK: /usr/local/lib/R/lib/libRlapack.so locale: [1] LC_CTYPE=en_NZ.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_NZ.UTF-8LC_COLLATE=en_NZ.UTF-8 [5] LC_MONETARY=en_NZ.UTF-8LC_MESSAGES=en_NZ.UTF-8 [7] LC_PAPER=en_NZ.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] scatterplot3d_0.3-40 misc_0.0-16 loaded via a namespace (and not attached): [1] compiler_3.5.0 deldir_0.1-15Matrix_1.2-8 [4] spatstat.utils_1.4-1 tools_3.5.0 mgcv_1.8-17 [7] abind_1.4-5 spatstat_1.50-0 rpart_4.1-11 [10] nlme_3.1-131 grid_3.5.0 polyclip_1.6-1 [13] lattice_0.20-35 goftest_1.1-1tensor_1.5 scatScript.txt library(scatterplot3d) set.seed(42) C <- runif(30) B <- rep(1:3, each=10) A <- rep(1:10,3) scatterplot3d(B,A,C, type = "h", lwd = 1, pch = 16, color="red", main = "", grid=TRUE, col.grid="lightgreen", xlab="x", ylab="y", zlab="z") __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Unusual behavior in e1071?
Look more carefully at y. If this is a factor, please note what is the first (reference) level and what the second. This determines the rule, not the value of the first observation. Best, Uwe Ligges On 02.05.2017 07:25, Daniel Jeske wrote: Hello - I have noticed that when I run svm() the order of my data matters. If the first case in the data frame has y=+1 I get the expected decision rule that says to classify as +1 if f(x)>0. However, if the first case in the data frame has y=-1 then apparently the decision rule being used says to classify as +1 if f(x)<0, and in this case all the coefficients are negative of their values compared to the first case. So the two classification rules are equivalent, but is a user really supposed to know the difference? It is likely they would assume the decision rule is always to classify as +1 if f(x)>0. Does anyone think the behavior I have noticed is as intended, or is otherwise benign? Thank you, Daniel Jeske Professor Department of Statistics University of California - Riverside [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error with installed.packages with R 3.4.0 on Windows
On 28.04.2017 19:10, Dimitri Liakhovitski wrote: When I click on "r patched snapshot build" here <https://cran.r-project.org/bin/windows/base/>, it take me here <https://cran.r-project.org/bin/windows/base/rpatched.html> , it says: Download R-3.3.3 Patched build for Windows <https://cran.r-project.org/bin/windows/base/R-3.3.3patched-win.exe> However, I am unclear how can one get to the patched 3.4.0 version? If you are on Windows, you did the roight things, but the page has to be updated.CCing Duncan who maintains these pages. Best, Uwe Thank you! On Fri, Apr 28, 2017 at 7:58 AM, Uwe Ligges <lig...@statistik.tu-dortmund.de <mailto:lig...@statistik.tu-dortmund.de>> wrote: On 28.04.2017 10:45, Thierry Onkelinx wrote: Dear Peter, It actually breaks install.packages(). So it is not that innocent. And hence, as Peter exoplained, it is already fixed inn R-patched, thanks to Tomas Kalibera. Best, Uwe Ligges Best regards, Thierry Op 28 apr. 2017 10:36 a.m. schreef "peter dalgaard" <pda...@gmail.com <mailto:pda...@gmail.com>>: Yes, we noticed this in the last days of the code freeze before release and shied away from inserting a workaround, partly because we couldn't see what the root of the problem might be. For the purposes of installed.packages it is relatively harmless to treat the NA condition as FALSE, since it is just a matter of whether a cache is valid. I.e., it might cause an unnecessary cache rebuild. For other situations it might be more of an issue. The workaround (NA -> FALSE, basically) is in place in R-patched and R-devel. -pd On 28 Apr 2017, at 07:47 , Thierry Onkelinx <thierry.onkel...@inbo.be <mailto:thierry.onkel...@inbo.be>> wrote: We have several computers with the same problem. Op 28 apr. 2017 7:25 a.m. schreef "Jean-Claude Arbaut" <arbau...@gmail.com <mailto:arbau...@gmail.com> : Hello, I am currently getting a strange error when I call installed.packages(): Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && : missing value where TRUE/FALSE needed Calls: installed.packages I am working with R 3.4.0 on Windows. I didn't get this error with R 3.3.3. Apparently, file.mtime() is returning NA well applied to a directory, and this causes the entire && expression to be NA, then the "if" fails because it needs either T or F. The source of "installed.packages" seems to be roughly the same as in R 3.3.3, so I wonder if there have been other changes in R, maybe the logical operators, that would make this function fail. Any idea? Best regards, Jean-Claude Arbaut [[alternative HTML version deleted]] __ R-help@r-project.org <mailto:R-help@r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help <https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org <mailto:R-help@r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help <https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 <tel:%28%2B45%2938153501> Office: A 4.23 Email: pd@cbs.dk <mailto:pd@cbs.dk> Priv: pda...@gmail.com <mailto:pda...@gmail.com> [[alternative HTML version deleted]] __ R-help@r-project.org <mailto:R-help@r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.et
Re: [R] Error with installed.packages with R 3.4.0 on Windows
On 28.04.2017 10:45, Thierry Onkelinx wrote: Dear Peter, It actually breaks install.packages(). So it is not that innocent. And hence, as Peter exoplained, it is already fixed inn R-patched, thanks to Tomas Kalibera. Best, Uwe Ligges Best regards, Thierry Op 28 apr. 2017 10:36 a.m. schreef "peter dalgaard" <pda...@gmail.com>: Yes, we noticed this in the last days of the code freeze before release and shied away from inserting a workaround, partly because we couldn't see what the root of the problem might be. For the purposes of installed.packages it is relatively harmless to treat the NA condition as FALSE, since it is just a matter of whether a cache is valid. I.e., it might cause an unnecessary cache rebuild. For other situations it might be more of an issue. The workaround (NA -> FALSE, basically) is in place in R-patched and R-devel. -pd On 28 Apr 2017, at 07:47 , Thierry Onkelinx <thierry.onkel...@inbo.be> wrote: We have several computers with the same problem. Op 28 apr. 2017 7:25 a.m. schreef "Jean-Claude Arbaut" <arbau...@gmail.com : Hello, I am currently getting a strange error when I call installed.packages(): Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) && : missing value where TRUE/FALSE needed Calls: installed.packages I am working with R 3.4.0 on Windows. I didn't get this error with R 3.3.3. Apparently, file.mtime() is returning NA well applied to a directory, and this causes the entire && expression to be NA, then the "if" fails because it needs either T or F. The source of "installed.packages" seems to be roughly the same as in R 3.3.3, so I wonder if there have been other changes in R, maybe the logical operators, that would make this function fail. Any idea? Best regards, Jean-Claude Arbaut [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/ posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd@cbs.dk Priv: pda...@gmail.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Difference between R for the Mac and for Windows
On 31.03.2017 19:15, Berend Hasselman wrote: I have noted a difference between R on macOS en on Kubuntu Trusty (64bits) with complex division. I don't know what would happen R on Windows. R.3.3.3: macOS (10.11.6) - (1+2i)/0 [1] NaN+NaNi (-1+2i)/0 [1] NaN+NaNi 1i/0 [1] NaN+NaNi 1i/(0+0i) [1] NaN+NaNi KubuntuTrusty - (1+2i)/0 [1] Inf+Infi (-1+2i)/0 [1] -Inf+Infi 1i/0 [1] NaN+Infi 1i/(0+0i) [1] NaN+Infi Interesting to see what R on Windows delivers. Same as KubuntuTrusty and what I would expect. Best, Uwe Ligges Berend Hasselman __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Error in match.fun(f) : object 'x' not found
On 21.02.2017 18:29, C W wrote: Dear R list, I am having a little trouble understanding the R code. I want to compute expectation of normal pdf. I did the following: integrate(x*dnorm(x, rate=1), -Inf, Inf) integrate needs a function as first argument, hence: integrate(function(x) x*dnorm(x, rate=1), -Inf, Inf) and then you have the next error that is more obvious to fix... Error in match.fun(f) : object 'x' not found If I did this, I get, integrate(dexp(x, rate=1), -Inf, Inf) Error in dexp(x, rate = 1) : object 'x' not found same here. How should I fix this? I remember when I did it for curve(), it was fine. curve(pexp(x, rate = 1/2), from = 0, to = 5) curve() is an exception in that it can use an unevaluated function call. Best, Uwe Ligges What am I not getting here? Thank you so much! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Antwort: Re: packrat: Failed to download current version of foreign(0.8-67)
Yes, then we cannot help and you have to ask your company how to get the files, of course. Best, Uwe Ligges On 21.02.2017 08:16, g.maub...@weinwolf.de wrote: Hi Mr. Ligges, doing as you said R responds with install.packages("foreign") trying URL 'https://cran.uni-muenster.de/bin/windows/contrib/3.3/foreign_0.8-67.zip' Warning in install.packages : cannot open URL 'https://cran.uni-muenster.de/bin/windows/contrib/3.3/foreign_0.8-67.zip': HTTP status was '403 Forbidden (Content blocked by Trustwave Secure Web Gateway)' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'https://cran.uni-muenster.de/bin/windows/contrib/3.3/foreign_0.8-67.zip' Warning in install.packages : download of package ‘foreign’ failed Running install.packages("foreign", type = "source") trying URL 'https://cran.uni-muenster.de/src/contrib/foreign_0.8-67.tar.gz' Warning in install.packages : cannot open URL 'https://cran.uni-muenster.de/src/contrib/foreign_0.8-67.tar.gz': HTTP status was '403 Forbidden (Content blocked by Trustwave Secure Web Gateway)' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'https://cran.uni-muenster.de/src/contrib/foreign_0.8-67.tar.gz' Warning in install.packages : download of package ‘foreign’ failed The firewall in my company blocks all binary files. Foreign is downloaded in "wb" mode. Thus I have no chance to get it. The first fresh installation was done from an external drive. As packrat is also downloading the binaries instead of the source my download will always fail. My sessionInfo() is sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=German_Germany.1252 [2] LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 [4] LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base loaded via a namespace (and not attached): [1] tools_3.3.2 Do have a suggestion? Kind regards Georg Von:Uwe Ligges <lig...@statistik.tu-dortmund.de> An: g.maub...@weinwolf.de, r-help@r-project.org, Datum: 20.02.2017 21:29 Betreff:Re: [R] packrat: Failed to download current version of foreign(0.8-67) foreign is a recommended package that is already part of your R installation. and there shoudl not be a problem to install a recent version of it. What is the error message of you run install.packages("foreign") from a new R session? Best, Uwe Ligges On 20.02.2017 17:33, g.maub...@weinwolf.de wrote: Hi All, I tried to use packrat on R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=German_Germany.1252 [2] LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 [4] LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [1] packrat_0.4.8-1 loaded via a namespace (and not attached): [1] tools_3.3.2 Due to internal firewall restrictions the package "foreign" could not be downloaded as source. I assume that the package also contains some binary parts which will be blocked by the firewall. When running packrat a directory "packrat" and a file called .Rprofile were created in the project directory. A lot of library sources were download, but not for "foreign". After finishing the process the directory "packrat" and the file .Rprofile were deleted from the project directory. Why is that? Just one source library missing and the whole directory is gone? Having all libraries for my project without just one is better than none! How can I use packrat with the missing library "foreign"? Kind regards Georg __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] packrat: Failed to download current version of foreign(0.8-67)
foreign is a recommended package that is already part of your R installation. and there shoudl not be a problem to install a recent version of it. What is the error message of you run install.packages("foreign") from a new R session? Best, Uwe Ligges On 20.02.2017 17:33, g.maub...@weinwolf.de wrote: Hi All, I tried to use packrat on R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=German_Germany.1252 [2] LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 [4] LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [1] packrat_0.4.8-1 loaded via a namespace (and not attached): [1] tools_3.3.2 Due to internal firewall restrictions the package "foreign" could not be downloaded as source. I assume that the package also contains some binary parts which will be blocked by the firewall. When running packrat a directory "packrat" and a file called .Rprofile were created in the project directory. A lot of library sources were download, but not for "foreign". After finishing the process the directory "packrat" and the file .Rprofile were deleted from the project directory. Why is that? Just one source library missing and the whole directory is gone? Having all libraries for my project without just one is better than none! How can I use packrat with the missing library "foreign"? Kind regards Georg __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Extracting first number after * in a character vector
On 23.01.2017 13:29, Abhinaba Roy wrote: Hi, How do I extract the first number after '*' in a vector? The vector is given below dput(out[1:10]) c(" 1 X[0,SMITH] * 0 0 1 ", " 2 X[0,JOHNSON] * 0 0 1 ", " 3 X[0,WILLIAMS]", "* 1 0 1 ", " 4 X[0,JONES] * 0 0 1 ", " 5 X[0,BROWN] * 0 0 1 ", " 6 X[0,DAVIS] * 0 0 1 ", " 7 X[0,MILLER] * 0 0 1 ", " 8 X[0,WILSON] * 0 0 1 ", " 9 X[0,MOORE] * 0 0 1 " ) I want a vector with the first number after the asterisk. So the output would give me, a vector (0,0,1,0,0,0,0,0,0,0) How can I do it in R? You know that your vector (called x below) contains an element without an asterisk? If that happened by accident, use gsub(".+\\* *([[:digit:]]+).*", "\\1", x) and if it could happen to have elements without an asterisk or number that follows, you can set these results to NA in a seperate step. Best, Uwe Ligges Best, Abhinaba [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How these Plots are called? Which package
On 14.01.2017 21:04, Alaios via R-help wrote: can you see it now? I have uploaded it on my dropbox https://www.dropbox.com/s/9eikpabu6xflasa/Figure.jpg?dl=0 This is called spectogram and there are several packages that can do it, depending on your application. Best, Uwe Ligges On Saturday, January 14, 2017 12:57 PM, John Kane <jrkrid...@yahoo.ca> wrote: No sign of attachment. On Saturday, January 14, 2017 5:42 AM, Alaios via R-help <r-help@r-project.org> wrote: Hello,how I can try something like that in R (in the attachment I am providing a sketch).Which packages would you try to use?I would like to thank you in advance for your helpRegardsAlex __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] rstan error: C:/Rtools/mingw_64/bin/g++: not found
On 02.12.2016 12:23, S Ellison wrote: Apologies for posting a possibly package-specific question, but I'm not sure whether this is an R or rstan ussue. Running rstan under R 3.1.1 in windows 10 I get the well-known error "Compilation ERROR, function(s)/method(s) not created! C:/Rtools/mingw_64/bin/g++: not found" Are you sure this is R-3.1.1? I'd expect such a message for R >= 3.3.0 if you do not update some files, but for 3.1.1 the correct PATH should be sufficient. Nevertheless, there is some code in rstan that seems to deal with Rtools for some reason, so perhaps better ask its package maintainer. Best, Uwe Ligges The cause on my system is simple; g++ is not on my C:\ drive; it's on D: My system path correctly points to D:, running system('g++ -v') works fine. But the error message shows that either rstan or R is insisting on a specific call on C:. I suspect that something is causing either a package, or R, to use the wrong drive. It _may_ be related to the fact that R itself is in its usual place in 'C:\Program files'. Any pointers, either to an answer or to a better place to ask, would be welcome. Steve Ellison PS: I can see that there is a _fairly_ simple work-round, but I prefer Rtools where it is for system management reasons and this is (so far) the only place that the path variable is not correctly picked up. *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Average every 4 columns
On 09.11.2016 22:06, Jim Lemon wrote: Hi Milu, Perhaps this will help: apply(as.matrix(x[-1,seq(1:dim(x)[1],by=4)]),1,mean) More efficient than apply(..., 1, mean): rowMeans() Best, Uwe Ligges Jim On Thu, Nov 10, 2016 at 4:00 AM, Miluji Sb <miluj...@gmail.com> wrote: Thanks a lot for your quick reply. I made a mistake in the question, I meant to ask every 4 (or 12) rows not columns. Apologies. Thanks again! Sincerely, Milu On Wed, Nov 9, 2016 at 5:45 PM, Dalthorp, Daniel <ddalth...@usgs.gov> wrote: Hi Milu, The following should work for an array x (provided dim(x)[2] is divisible by 4): colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) -Dan On Wed, Nov 9, 2016 at 8:29 AM, Miluji Sb <miluj...@gmail.com> wrote: Dear all, I have a dataset with hundreds of columns, I am only providing only 12 columns. Is it possible to take the mean of every four (or 12) columns (value601, value602, value603, value604 etc.in this case) and repeat for the hundreds of columns? Thank you. Sincerely, Milu structure(list(value601 = c(10.1738710403442, 3.54112911224365, 12.9192342758179, 3.17447590827942, 11.7332258224487, 7.68282270431519, -7.11564493179321, 0.987620949745178, 13.0476207733154, 6.36939525604248 ), value602 = c(13.0642414093018, 5.53129482269287, 16.0519638061523, 2.88946437835693, 14.9204912185669, 9.42428588867188, -6.80674123764038, -0.614241063594818, 16.7947769165039, 7.9541072845459), value603 = c(22.0399188995361, 14.398024559021, 24.9523792266846, 12.0878629684448, 23.6459674835205, 18.3277816772461, -2.54092741012573, 10.5550804138184, 25.1016540527344, 16.2166938781738), value604 = c(27.7165412902832, 20.3255825042725, 30.8430004119873, 16.6856250762939, 29.2485408782959, 24.3775005340576, 6.47758340835571, 15.5897912979126, 30.7387924194336, 22.3637084960938 ), value605 = c(31.6644763946533, 23.4093952178955, 35.1488723754883, 19.7132263183594, 33.3924179077148, 29.5846366882324, 10.2083873748779, 19.3551616668701, 35.3076629638672, 27.4299201965332), value606 = c(33.9698333740234, 26.8574161529541, 36.8900833129883, 22.8604583740234, 34.8642921447754, 33.8158760070801, 14.7055835723877, 22.1144580841064, 37.0545425415039, 32.1087913513184), value607 = c(36.0279846191406, 26.9297180175781, 38.2701225280762, 23.2643146514893, 36.7398796081543, 34.1216125488281, 17.1387901306152, 24.0419750213623, 37.8542327880859, 32.7677421569824 ), value608 = c(34.0242347717285, 25.7720966339111, 36.4897193908691, 22.0332260131836, 34.8011703491211, 32.6856842041016, 16.6232261657715, 21.5571365356445, 36.1491546630859, 31.1716938018799), value609 = c(27.5402088165283, 21.7590408325195, 30.5214176177979, 18.4252090454102, 29.1156253814697, 26.9878330230713, 12.4962501525879, 17.7259578704834, 30.9099159240723, 25.4832077026367), value610 = c(23.4706859588623, 17.0126209259033, 26.8166942596436, 15.297459602356, 25.1733055114746, 23.5616931915283, 8.86995983123779, 13.5793552398682, 27.5732250213623, 22.1691932678223 ), value611 = c(14.5820417404175, 9.08279132843018, 17.8419170379639, 8.36016654968262, 16.5633754730225, 14.8123331069946, 1.32095837593079, 5.73408317565918, 18.9752082824707, 13.572542236), value612 = c(9.12979793548584, 2.79943537712097, 11.6504030227661, 2.21584677696228, 10.5404834747314, 7.55471754074097, -5.58141136169434, -0.566209673881531, 12.3264112472534, 6.65576601028442)), .Names = c("value601", "value602", "value603", "value604", "value605", "value606", "value607", "value608", "value609", "value610", "value611", "value612"), row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), class = "data.frame") [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posti ng-guide.html and provide commented, minimal, self-contained, reproducible code. -- Dan Dalthorp, PhD USGS Forest and Rangeland Ecosystem Science Center Forest Sciences Lab, Rm 189 3200 SW Jefferson Way Corvallis, OR 97331 ph: 541-750-0953 ddalth...@usgs.gov [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide comme
Re: [R] creating lists of random matrices
Not answering the question, but if you have the same dimensions of the matrices everywhere, it is much more efficient to sample all numbers in a row and put stuff into an array: array(rnorm(5*4), dim=c(2,2,5))) Best, Uwe Ligges On 09.11.2016 19:51, Marc Schwartz wrote: On Nov 9, 2016, at 12:41 PM, Marc Schwartz <marc_schwa...@me.com> wrote: On Nov 9, 2016, at 12:32 PM, Evan Cooch <evan.co...@gmail.com> wrote: So, its easy enough to create a random matrix, using something like (say) matrix(rnorm(4),2,2) which generates a (2x2) matrix with random N(0,1) in each cell. But, what I need to be able to do is create a 'list' of such random matrices, where the length of the list (i.e., the number of said random matrices I store in the list) is some variable I can pass to the function (or loop). I tried the obvious like hold <- list() for (i in 1:5) { hold[[i]] <- matrix(rnorm(4),2,2) } While this works, it seems inelegant, and I'm wondering if there is a better (more efficient) way to accomplish the same thing -- perhaps avoiding the loop. Thanks in advance... Hi, See ?replicate Example: ## Create a list of 5 2x2 matrices Sorry, correction on my reply. I copied the wrong output, It should be: replicate(5, matrix(rnorm(4), 2, 2), simplify = FALSE) [[1]] [,1] [,2] [1,] 0.9700486 1.4249251 [2,] 0.7621312 0.8267747 [[2]] [,1] [,2] [1,] 0.4517927 0.2047509 [2,] 0.6336959 -0.6028124 [[3]] [,1] [,2] [1,] 0.6468823 0.4268734 [2,] 0.1664907 0.3905180 [[4]] [,1] [,2] [1,] -0.3170839 -1.0113201 [2,] -1.5356600 0.9658132 [[5]] [,1] [,2] [1,] -1.1937503 -0.2653502 [2,] 0.9319919 0.1780254 The 'simplify' argument should be FALSE, so that an array is not created. Regards, Marc Schwartz [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] paste0 in file path
On 31.08.2016 17:50, Leslie Rutkowski wrote: Hi, I'm trying to reshape and output 8 simple tables into excel files. This is the code I'm using for (i in 1:8) { count <- table(mydata$ctry, mydata[,paste0("q0",i,"r")]) dat <- as.data.frame(q01count) wide <- reshape(dat, timevar="Var2", idvar="Var1", direction="wide") write.xlsx(wide, file=paste0(i, 'C:/temp/q0',i,'r.xlsx')) ^^ remove the i? Best, Uwe Ligges } All goes well until the write.xlsx, which produces the error Error in .jnew("java/io/FileOutputStream", jFile) : java.io.FileNotFoundException: 1C:\temp\q01r.xlsx (The filename, directory name, or volume label syntax is incorrect) Among other things, I'm puzzled about why a "1" is getting tacked on to the file path. Any hints? Thanks, Leslie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] package.skeleton, environment argument causes error
It would be helpful for us if you provide a reproducible examples when the current package.skeleton fails. Best, Uwe Ligges On 19.08.2016 00:12, Jacob Strunk wrote: Hello, I have been using package.skeleton from within an lapply statement successfully (assuming good source code) with the following setup in the past: x=try(package.skeleton(package_name,path=pathi,code_files=file_i)) but now fails with error: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? I am working in RStudio Version 0.99.896, with 64 bit R version 3.3.1 (2016-06-21) I have been probing the code for package.skeleton a bit and noticed that the default arguments for 'list' and 'environment' are supplied in the function definition, thus making it impossible to achieve the conditions envIsMissing=TRUE missing(list) = TRUE as a result of the fact that missing(list) cannot be true, the classesList argument is empty and the call classes0 <- .fixPackageFileNames(classesList) then fails with the error Error: evaluation nested too deeply: infinite recursion / options(expressions=)? If I remove the default arguments I get further, but get the same error I had before (Error: evaluation nested too deeply: infinite recursion / options(expressions=)?) after executing the following code: methods0 <- .fixPackageFileNames(methodsList) and the contents of methodsList look like An object of class "ObjectsWithPackage": Object: Package: the function .fixPackageFileNames fails when it reaches list <- as.character(list) where in this case the contents of 'list' look like str(list) Formal class 'ObjectsWithPackage' [package "methods"] with 2 slots ..@ .Data : chr(0) ..@ package: chr(0) I am not sure if the problem arose from changes to package.skeleton or methods::getClasses and methods::getGenerics or if there is something peculiar about my environment. my current ugly fix is to define the function .fixPackageFileNames in the global environment and add a try statement and exit when it results in an object of class "try-error": .fixPackageFileNames= function (list) { list <- *try(*as.character(list)*)* *if(class(list)=="try-error")return(list)* if (length(list) == 0L) return(list) list0 <- gsub("[[:cntrl:]\"*/:<>?\\|]", "_", list) wrong <- grep("^(con|prn|aux|clock\\$|nul|lpt[1-3]|com[1-4])(\\..*|)$", list0) if (length(wrong)) list0[wrong] <- paste0("zz", list0[wrong]) ok <- grepl("^[[:alnum:]]", list0) if (any(!ok)) list0[!ok] <- paste0("z", list0[!ok]) list1 <- tolower(list0) list2 <- make.unique(list1, sep = "_") changed <- (list2 != list1) list0[changed] <- list2[changed] list0 } Any assistance with this error would be greatly appreciated! Thank you, __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] package.skeleton fails
Your code works for me, and I do not see any lapply in the example you provide below. Best, Uwe Ligges On 24.08.2016 21:21, Strunk, Jacob (DNR) wrote: Hello, I have been using package.skeleton from within an lapply statement successfully (assuming good source code) with the following setup in the past: writeLines("testfun=function(){}", "c:\\temp\\testfun.r") x=try(package.skeleton("test_pack",path="c:\\temp\\tests\\",code_files= "c:\\temp\\testfun.r")) but it now fails with the error: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? I am working in RStudio Version 0.99.896, with 64 bit R version 3.3.1 (2016-06-21) I have been poking in the code and the error appears happen within the subfunction '.fixPackageFileNames' Thanks for any assistance you might be able to provide. Jacob [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R2WinBUGS with Multivariate Logistic Regression
On 17.07.2016 05:33, Christopher Kelvin via R-help wrote: Dear R-User, I have written a simple code to analyze some data using Bayesian logistic regression via the R2WinBUGS package. The code when run in WinBUGS stops WinBUGS from running it and using the package returns no results also. I'd suggest to reduce it to a WinBUGS only problem, try OpenBUGS (which iw more recent) and if it still fails, ask on the WinBUGS/OpenBUGS mailing list. A trap in WinBUGS is not an R related problem. Best, Uwe Ligges I attach herewith, the code and a sample of the dataset. Any suggestion will be greatly appreciated. Chris Guure Biostatistics Department University of Ghana library(R2WinBUGS) library(coda)model1<-function(){ for (i in 1:N) { # likelihood function ms[i] ~ dbin( p [ i ], N ) logit(p [ i ] ) <- alpha + bage*age[ i ] + bpam*pam[i ] + bpah*pah[i] } ### prior for intercept alpha ~ dnorm(0,0.0001) # prior for slopes bage ~ dnorm(0,0.0001) bpam ~ dnorm(0,0.0001) bpah ~ dnorm(0,0.0001) # OR for alpha or.age<-exp(bage) # OR for hbp or.pam <- exp(bpam) # OR for fdm or.pah <- exp(bpah) } data=cbind(ms=c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), age=c(77, 83, 75, 78, 75, 83, 85, 80, 80, 85, 76, 77, 80, 76, 88, 77, 81, 78, 85, 81), pam=c(0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1), pah=c(1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0)) N=20 initial values ### lineinits <- function(){ list(alpha=1,bage= 0.05, bpam=0.05, bpah=0.05) } ## CODA output lineout1 <- bugs(data, lineinits, c("bage", "alpha","bpam", "bpah", "or.age", "or.pam", "or.pah"), model1,n.iter = 11000, n.burnin = 1000, n.chains = 2, codaPkg = T, DIC = TRUE) ### Posterior summaries line.coda <- read.bugs(lineout1) summary(line.coda) __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Installation of package "rio" broken
On 14.06.2016 21:01, Ista Zahn wrote: On Tue, Jun 14, 2016 at 3:19 PM, <g.maub...@gmx.de> wrote: Hi all, today I wanted to install package "rio". As it depends on package "feather" which is only available as source I have chosen to install "rio" from source. The installations fails with the following messages: "feather" is available as in pre-compiled form for windows versions of R >= 3.3.0. Your simplest course of action is probably to update to the latest released version of R and install the pre-compiled packages. Indeed, you need at least R-3.0.0 as this is compiled with gcc-4.9.3 that supports the new standard. Best, Uwe Ligges Best, Ista -- cut -- * installing *source* package 'feather' ... ** Paket 'feather' erfolgreich entpackt und MD5 Summen überprüft ** libs *** arch - i386 g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather-read.cpp -o feather-read.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather-types.cpp -o feather-types.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather-write.cpp -o feather-write.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather/buffer.cc -o feather/buffer.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather/feather-c.cc -o feather/feather-c.o g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather/io.cc -o feather/io.o feather/io.cc:18:0: warning: "NOMINMAX" redefined [enabled by default] c:\program files\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/i686-w64-mingw32/bits/os_defines.h:46:0: note: this is the location of the previous definition g++ -m32 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.2/include" -DNDEBUG -I. -I"C:/Users/admin/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c feather/metadata.cc -o feather/metadata.o feather/metadata.cc:29:7: error: expected nested-name-specifier before 'FBString' feather/metadata.cc:29:7: error: 'FBString' has not been declared feather/metadata.cc:29:16: error: expected ';' before '=' token feather/metadata.cc:29:16: error: expected unqualified-id before '=' token feather/metadata.cc:32:7: error: expected nested-name-specifier before 'ColumnVector' feather/metadata.cc:32:7: error: 'ColumnVector' has not been declared feather/metadata.cc:32:20: error: expected ';' before '=' token feather/metadata.cc:32:20: error: expected unqualified-id before '=' token feather/metadata.cc:178:3: error: 'ColumnVector' does not name a type feather/metadata.cc: In member function 'feather::Status feather::metadata::TableBuilder::Impl::Finish()': feather/metadata.cc:146:5: error: 'FBString' was not declared in this scope feather/metadata.cc:146:14: error: expected ';' before 'desc' feather/metadata.cc:148:7: error: 'desc' was not declared in this scope feather/metadata.cc:154:9: error: 'desc' was not declared in this scope feather/metadata.cc:156:27: error: 'columns_' was not declared in this scope feather/metadata.cc:157:34: error: unable to deduce 'auto' from '' feather/metadata.cc: In member function 'void feather::metadata::TableBuilder::Impl::add_column(const flatbuffers::Offset&)': feather/metadata.cc:173:5: error: 'columns_' was not declared in this scope feather/metadata.cc: In constructor 'feather::metadata::TableBuilder::TableBuilder()': feather/metadata.cc:190:5: error: type 'feather::metadata::TableBuilder' is not a direct base of 'f
Re: [R] R getting "Killed" while running VAR model
Wild guess: You have huge and high dimensional VAR models, i.e. the matrices get huge and you use huge amounts of memory and you use more than what is available physically. The operating system protects itself by killing processes in such a case... Best, Uwe Ligges On 31.05.2016 20:29, Vivek Singh wrote: Hi, I am using VARS (vector autoregressive model). The process gets killed after running for sometime. Following is the output of R. vivek@isds-research:~/cloudAuction/padding/panel$ cat var.Rout R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (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. 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. 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. [Previously saved workspace restored] data=read.csv("output1.csv") attach(data) only_variables= subset(data, select=c(-date,-hour,-minute,-sec)) library("vars") Loading required package: MASS Loading required package: strucchange Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date, as.Date.numeric Loading required package: sandwich Loading required package: urca Loading required package: lmtest summary(VAR(only_variables, p = 1, type ="both")) *Killed* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] lib default location
On 21.05.2016 14:49, Alba Pompeo wrote: Everytime I install a package from CRAN I receive this message: Installing package into ‘/home/albap/R/x86_64-pc-linux-gnu-library/3.3’ (as ‘lib’ is unspecified) Should I set my lib? If so, what's the recommended path? It is fine to keep this per user default. Also, everytime I have to choose the mirror. Could I make one of them default? Yes, one way is described in the examples of ?Startup. Best, Uwe Ligges Thanks! Ciao. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Cannot Install Packages
On 10.05.2016 19:14, Jason Hernandez via R-help wrote: I have been trying to install the package "reshape2" using the code: install.packages("reshape2") I get the following return: Installing package into ‘C:/Users/Jason/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository http://cran.cs.wwu.edu/bin/windows/contrib/3.0 The mirror does not exist, perhaps choose another one? Best, Uwe Ligges Warning message: package ‘reshape2’ is not available (for R version 3.0.2) When I went to the list of packages to look up reshape2, it said this package needs compilation. I did not see an indication of which R versions it is available for. I went to the R for Windows FAQ, but it did not seem very helpful. The relevant sentences seemed to be: "For packages with code that needscompilation you will need to collect and install several tools: you candownload them via the portal athttp://www.murdoch-sutherland.com/Rtools/. Once you have doneso, just run R CMD INSTALL pkgname at a Windows commandprompt." I did the download, but I do not understand the meaning of the last sentence, since R does not recognize R CMD INSTALL as a valid code line, and the usual install.packages("reshape2") still returns the same error. What did I miss? Jason Hernandez [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] loading
Err, you already loaded it, there is not necessarily another message. Just try the functions you want to use. .. Best, Uwe Ligges On 27.03.2016 19:10, farzana akbari wrote: hi I install plm and pglm packages but I can not load no one of them. the massage of loading plm is library(plm) Loading required package: Formula and for pglm is library(pglm) Loading required package: maxLik Loading required package: miscTools Please cite the 'maxLik' package as: Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1. If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site: https://r-forge.r-project.org/projects/maxlik/ can you help me? and also when i wanna Formula package there is no massage . for installing Formula massage is --- Please select a CRAN mirror for use in this session --- Warning: package ‘Formula’ is in use and will not be installed i used 3.1.3 and 3.2.4 ver *64 and 32 and my computer is 64 bit please help me [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] fftImg() error: fftw_access_func
Please report problems in packages to the corresponding package maintainer, CCing here .. Best, Uwe Ligges On 25.03.2016 21:09, Eric Handler wrote: Hello- My name is Eric Handler and I am an academic technologist supporting the Science Division(7 academic departments) at Macalester College in Saint Paul, MN. The faculty use R for a variety of teaching and research tasks around campus. I administer our RStudio instance and have encountered an error I can't resolve. A student working on an independent research project has reported that he received the following error when attempting to use the ripa function fftImg(): Error in .C("fftw_access_func", as.complex(img), as.integer(w), as.integer(h), : "fftw_access_func" not available for .C() for package "ripa" I've been able to recreate this error in RStudio as well as directly in R. I've also recreated the error across different platforms(Ubuntu, Mac OS X 10.10 and 10.11). My test platform's sessionInfo() output is below: R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.3 (El Capitan) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] parallel tcltk stats graphics grDevices utils datasets [8] methods base other attached packages: [1] fftw_1.0-3 ripa_2.0-2 loaded via a namespace (and not attached): [1] tools_3.2.3 Rcpp_0.12.3 A google search for "fftw_access_func" doesn't reveal anything modern on this topic, only mentions of OS 10.4 and 10.5 and rimage, which doesn't seem to exist anymore(perhaps it was a predecessor to RIPA?) Can someone help me get the student functional with fftImg() or alternately, tell me it is a known issue and an alternative option(if available) for the student? Thanks, Eric -- Eric Handler Academic Information Associate - Science Division Macalester College - Saint Paul, MN Olin-Rice 124 Office: 651-696-6016 View my calendar: http://goo.gl/SbxLOu __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] installing packages
On 21.03.2016 22:07, James Henson wrote: Dear R community, When I install or update a package, R prints the waring below. I go to the ‘downloaded_packages’ folder in the Temp file and manually move the new or updated package to the folder ‘3.2’. How can I instruct R to download new and updates packages into the ‘3.2’ folder? Warning in install.packages : unable to move temporary installation ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\file1c5c6f1731c8\nlme’ to ‘C:\Users\james_henson\Desktop\Documents\R\win-library\3.2\nlme I guess you had nlme loaded? Start a fresh R without loading nlme, then R should be able to move the temp installation. Best, Uwe Ligges The downloaded binary packages are in C:\Users\james_henson\AppData\Local\Temp\RtmpIZmUa3\downloaded_packages Thank for your help. James F. Henson [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] degree sign
On 18.03.2016 21:58, Cathy Lee Gierke wrote: I have searched and tried many things but cannot get anything to work. I just want to print out a degree sign after a the Orthophase number. The following list of "xl" values are all ones I have tried. Granted they are not what I want, but I have tried them all, and none of them print out a degree symbol... # xl = expression(paste("Orthophase [", { # }^o, "]")) #xl<-~degree~C #xl<-parse(text = ~degree) #xl<-parse(text = paste(" ", "~degree", sep = "")) #xl<-expression(~degree) xl <- parse(text = paste(Orthophase[i,j], "*degree ~ S", sep = "")) printXlab<-paste("Orthophase",Orthophase[i,j],xl," ") plot(MyData$time.hour[plotData],newData[plotData],type="l", xaxt="n", xlab=printXlab,. It has to be an expression, you must not use paste() around it: plot(MyData$time.hour[plotData], newData[plotData], type="l", xaxt="n", xlab = expression("Orthophase" * Orthophase[i,j] * degree)) Best, Uwe Ligges Cathy Lee Gierke *"We are what we repeatedly do. Excellence, then, is not an act, but a habit." Aristotle* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Testing installed package of rJava in Linux
I do not get this: If it works it is OK to use it. If it does not work, you can't Best, Uwe Kigges On 09.03.2016 17:44, Santosh wrote: Thanks for your response. Since the test failed due to X11 connectivity reasons, is it okay to use it in applications where X11 server connectivity is not required? Thanks and much appreciated, Santosh On Tue, Mar 8, 2016 at 10:41 PM, Uwe Ligges <lig...@statistik.tu-dortmund.de wrote: On 09.03.2016 02:19, Santosh wrote: Dear Rxperts.. I installed rJava on 64-bit Linux system and apparently it installed without errors.However, I got the following error message when I tried to test the installed package. Error in .jcall("RJavaTools", "Ljava/lang/Object;", "newInstance", .jfindClass(class), : java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. Calls: new -> new -> .J -> .jcall -> .jcheck -> .Call Execution halted Apparently you do not have an X server running or no X forwarding enabled? Best, Uwe Ligges Would highly appreciate your tips/suggestions.. Thanks and much appreciated, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Testing installed package of rJava in Linux
On 09.03.2016 02:19, Santosh wrote: Dear Rxperts.. I installed rJava on 64-bit Linux system and apparently it installed without errors.However, I got the following error message when I tried to test the installed package. Error in .jcall("RJavaTools", "Ljava/lang/Object;", "newInstance", .jfindClass(class), : java.lang.InternalError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. Calls: new -> new -> .J -> .jcall -> .jcheck -> .Call Execution halted Apparently you do not have an X server running or no X forwarding enabled? Best, Uwe Ligges Would highly appreciate your tips/suggestions.. Thanks and much appreciated, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Slow CRAN Mirror Action
On 08.03.2016 11:01, Justace Clutter wrote: I have been creating a local mirror of the CRAN for my works servers. After a review of the CRAN mirror literature, I settled on the following command to perform the mirror: rsync -rtlzv --delete --exclude-from u:\CRANRSYNCFilterRules cran.r-project.org::CRAN . Where the CRANRSYNCFilterRules file has the following contents: / BEGIN SNIP - bin/linux - bin/macos - bin/macosx - bin/windows/base/old #- bin/windows/contrib/* - bin/windows/contrib/1* - bin/windows/contrib/2* - bin/windows/contrib/3.0 - bin/windows/contrib/3.1 + bin/ + bin/windows/ + bin/windows/contrib/ + bin/windows/contrib/3.2/ + bin/windows/contrib/3.2/*** / END SNIP What I find is that the command tends to redownload a lot of files and I can never seem to get past the windows/contrib/3.2 directory because I have to leave work and go home for the day after 7 hours. Is there something incorrect with my rsync command which is forcing the redownload of a lot of packages? Is there a way to speed this process up? Thank you for any help. No, we rebuild really many packages on a daily basis. Once a depdendency changes you may need to build a new binary. So this is expected. Best, Uwe Ligges Version Information: Just in case people feel they need to know OS: Windows 7 rsync: version 3.0.9 protocol version 30 Network: hardwired to company LAN which has some form of firewall/proxy to the real internet Justace [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] .Call works in R 2 not in R 3
On 08.03.2016 14:55, Sebastien Moretti wrote: Hi I inherited a R package done in 2004 that works perfectly in R 2.15.1 and before, but not in R 3.2.2 ( >= 3). I have already fixed issues with namespace for functions in R 3 but maybe not all of them. Here is the error message: Error in .Call("R_cutree", tree$merge, k, PACKAGE = "stats") "R_cutree" not available for .Call() for package "stats" Why do you .Call() into another package? Rather use the API. Let's say that I am far from a R master. I never use .Call() myself. I want the code works again in R >= 3 because R support for R 2 will soon be stopped in my institute. When the code will work again, I could change internals by comparing results with R 2 and R 3. Well, the error message above suggets you have R code that uses .Call() not compatible with the R version you are using. I do not know where the .Call() comes from, ehnce your turn to find it out. You havenÄt given any other information, not even a traceback(). Best, Uwe Ligges Best, Uwe Ligges Thanks for your help -- Sébastien Moretti __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] .Call works in R 2 not in R 3
On 08.03.2016 12:01, Sebastien Moretti wrote: Hi I inherited a R package done in 2004 that works perfectly in R 2.15.1 and before, but not in R 3.2.2 ( >= 3). I have already fixed issues with namespace for functions in R 3 but maybe not all of them. Here is the error message: Error in .Call("R_cutree", tree$merge, k, PACKAGE = "stats") "R_cutree" not available for .Call() for package "stats" Why do you .Call() into another package? Rather use the API. Best, Uwe Ligges Thanks for your help __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.