Re: [R] lattice graph with free scales and reversed axis values
This worked very well for me. Thanks, Naresh From: P TennantSent: Saturday, November 5, 2016 7:57 PM To: Naresh Gurbuxani Cc: R-help@r-project.org Subject: Re: [R] lattice graph with free scales and reversed axis values Hi Naresh, You could calculate the ranges explicitly and then supply to scales(): holdRange <- vector('list', length(unique(my.df$name))) for(i in 1:length(holdRange)){ holdRange[[i]] <- rev(range(my.df$x[my.df$name==unique(my.df$name)[i]])) } holdRange # [[1]] # [1] -5.052890 -9.967671 # [[2]] # [1] 2.648870 -2.629866 xyplot(y ~ x | name, data = my.df, type = c("p", "g"), scales = list(relation="free", limits=holdRange)) Philip On 6/11/2016 9:59 AM, Naresh Gurbuxani wrote: > I want to draw a lattice graph where different panels have different ranges > AND the order of values is reversed. I am struggling to achieve both at the > same time. Can you help? > > Thanks, > Naresh > > # Create dummy data for illustration > my.df<- data.frame(x = runif(100, min = -10, max = -5), name = "A") > my.df<- rbind(my.df, data.frame(x = rnorm(100), name = "B")) > my.df<- within(my.df, {y<- x + 0.2 * rnorm(200)}) > > # This works. Both x and y axes show values in reverse order. > xyplot(y ~ x, groups = name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), type = c("p", "g")) > > # This works. Both x and y axes show values in reverse order. > xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), type = c("p", "g")) > > # This does not work as intended. x and y values are in reverse order. But > both panels have the same and x and y ranges. scales argument does not seem > to have any effect. > xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), scales = list(x = "free", y = "free"), type = c("p", > "g")) > > # This does not work at all. panel.xyplot does not see to take xlim or ylim > arguments. > xyplot(y ~ x | name, data = my.df, scales = list(x = "free", y = "free"), > panel = function(x,y,subscripts, ...) { >panel.xyplot(x,y, ylim = rev(range(y[subscripts]), xlim = > rev(range(x[subscripts] > }) > > __ > 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.
Re: [R] Problem with downloading library(Rcmdr)
> On Nov 5, 2016, at 5:13 PM, Fox, Johnwrote: > > Dear David, > > Sorry to chime in late -- I didn't read the messages in this thread until > just now. I see no reason for an apology. 6 hour service on a weekend is damned good software support in my opinion. I'm glad to see my inferences confirmed about the XQuartz versioning as prime suspect. Best; David. > >> -Original Message- >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David >> Winsemius >> Sent: November 5, 2016 3:43 PM >> To: varin sacha >> Cc: R-help Mailing List >> Subject: Re: [R] Problem with downloading library(Rcmdr) >> >> >>> On Nov 5, 2016, at 11:27 AM, varin sacha via R-help >> wrote: >>> >>> Dear R-experts, >>> >>> Here below you will find my R sessionInfo. I have a problem with the >> library(Rcmdr). The error message is here below. How can I solve that problem >> ? >> >> I'm not an Rcmdr user and my Mac is too old to support Sierra so unable to >> attempt replication. All I am able offer is a search on what appear to be >> similar >> issues in the past. You do need to indicate your XQuartz version. I see there >> have been three recent releases suggesting to me that there might have been >> teething difficulties with the birth of the neanate Sierra. >> >> • XQuartz 2.7.11 - 2016-10-29 >> >> • XQuartz 2.7.10 - 2016-10-22 >> >> • XQuartz 2.7.9 - 2016-05-05 >> >> You might also mention in any follow-up whether this is being done inside >> MacGUI or at an R console launched from Terminal.app. >> >> Make sure you have reviewed: >> http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html >> >> >> Over the years there have been many questions regarding the three-way >> marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's a >> relatively recent one that mentions the image function: >> >> http://markmail.org/search/?q=list%3Aorg.r-project.r-sig- >> mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig- >> mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results >> > > The current Rcmdr Mac installation notes, to which you also pointed, reflect > this discussion. > >> >> So I think I would make sure you have a version of R that has Tcl and have >> the >> most uptodate X11 version (XQuartz) and once you do that and then try to >> reload R, load Rcmdr _before_ RcmdrMisc and before all those other packages. >> If you still get an error, then repost with version details of _all_ the >> components mentioned to the R-SIG-Mac mailing list and copy John Fox. >> (Might not be necessary to give him a copy since I think he monitors >> R-SIG-Mac >> for Rcmdr issues.) > > If one loads the Rcmdr package at the beginning of a session via > library(Rcmdr), then the dependencies that it needs to start up, such as > RcmdrMisc, will be loaded automatically. Other packages may be loaded during > an Rcmdr session as needed. > > By far the most common problem with getting the Rcmdr to work on Macs is > failure to install XQuartz or failure to reinstall it after updating the OS. > > I see from a subsequent message that varin sasha's problem has been solved. > > Thanks for trying to help. > > Best, > John > >> >> >> -- >> David. >>> >>> >>> Many thanks. >>> >>> >>> >>> sessionInfo() >>> R version 3.3.2 (2016-10-31) >>> Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS >>> Sierra 10.12 >>> >>> locale: >>> [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 >>> >>> attached base packages: >>> [1] splines stats graphics grDevices utils datasets methods >>> base >>> >>> other attached packages: >>> [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 >>> >>> loaded via a namespace (and not attached): >>> [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 >>> RColorBrewer_1.1-2 >> plyr_1.8.4 class_7.3-14 >>> [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 >> gtable_0.2.0nlme_3.1-128 >>> [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 >>> Matrix_1.2-7.1 >> parallel_3.3.2 SparseM_1.72 >>> [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 >> stringr_1.1.0 cluster_2.0.5 >>> [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 >> data.table_1.9.6tcltk_3.3.2 >>> [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 >>> latticeExtra_0.6-28 >> minqa_1.2.4 Formula_1.2-1 >>> [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 >> scales_0.4.0MASS_7.3-45 >>> [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 >>> quantreg_5.29 >> stringi_1.1.2 acepack_1.4.1 >>> [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 >>> >>> library(Rcmdr) >>> Error : .onAttach a échoué dans attachNamespace() pour
Re: [R] Problem with downloading library(Rcmdr)
Dear David, Sorry to chime in late -- I didn't read the messages in this thread until just now. > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David > Winsemius > Sent: November 5, 2016 3:43 PM > To: varin sacha> Cc: R-help Mailing List > Subject: Re: [R] Problem with downloading library(Rcmdr) > > > > On Nov 5, 2016, at 11:27 AM, varin sacha via R-help > wrote: > > > > Dear R-experts, > > > > Here below you will find my R sessionInfo. I have a problem with the > library(Rcmdr). The error message is here below. How can I solve that problem > ? > > I'm not an Rcmdr user and my Mac is too old to support Sierra so unable to > attempt replication. All I am able offer is a search on what appear to be > similar > issues in the past. You do need to indicate your XQuartz version. I see there > have been three recent releases suggesting to me that there might have been > teething difficulties with the birth of the neanate Sierra. > > • XQuartz 2.7.11 - 2016-10-29 > > • XQuartz 2.7.10 - 2016-10-22 > > • XQuartz 2.7.9 - 2016-05-05 > > You might also mention in any follow-up whether this is being done inside > MacGUI or at an R console launched from Terminal.app. > > Make sure you have reviewed: > http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html > > > Over the years there have been many questions regarding the three-way > marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's a > relatively recent one that mentions the image function: > > http://markmail.org/search/?q=list%3Aorg.r-project.r-sig- > mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig- > mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results > The current Rcmdr Mac installation notes, to which you also pointed, reflect this discussion. > > So I think I would make sure you have a version of R that has Tcl and have the > most uptodate X11 version (XQuartz) and once you do that and then try to > reload R, load Rcmdr _before_ RcmdrMisc and before all those other packages. > If you still get an error, then repost with version details of _all_ the > components mentioned to the R-SIG-Mac mailing list and copy John Fox. > (Might not be necessary to give him a copy since I think he monitors R-SIG-Mac > for Rcmdr issues.) If one loads the Rcmdr package at the beginning of a session via library(Rcmdr), then the dependencies that it needs to start up, such as RcmdrMisc, will be loaded automatically. Other packages may be loaded during an Rcmdr session as needed. By far the most common problem with getting the Rcmdr to work on Macs is failure to install XQuartz or failure to reinstall it after updating the OS. I see from a subsequent message that varin sasha's problem has been solved. Thanks for trying to help. Best, John > > > -- > David. > > > > > > Many thanks. > > > > > > > > sessionInfo() > > R version 3.3.2 (2016-10-31) > > Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS > > Sierra 10.12 > > > > locale: > > [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 > > > > attached base packages: > > [1] splines stats graphics grDevices utils datasets methods > > base > > > > other attached packages: > > [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 > > > > loaded via a namespace (and not attached): > > [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 > > RColorBrewer_1.1-2 > plyr_1.8.4 class_7.3-14 > > [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 > gtable_0.2.0nlme_3.1-128 > > [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 > > Matrix_1.2-7.1 > parallel_3.3.2 SparseM_1.72 > > [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 > stringr_1.1.0 cluster_2.0.5 > > [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 > data.table_1.9.6tcltk_3.3.2 > > [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 > > latticeExtra_0.6-28 > minqa_1.2.4 Formula_1.2-1 > > [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 > scales_0.4.0MASS_7.3-45 > > [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 > > quantreg_5.29 > stringi_1.1.2 acepack_1.4.1 > > [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 > > > > > >> library(Rcmdr) > > Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', détails : > > appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") > > erreur : [tcl] invalid command name "image". > > > > Erreur : le chargement du package ou de l'espace de noms a échoué pour > 'Rcmdr' > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do
Re: [R] lattice graph with free scales and reversed axis values
Hi Naresh, You could calculate the ranges explicitly and then supply to scales(): holdRange <- vector('list', length(unique(my.df$name))) for(i in 1:length(holdRange)){ holdRange[[i]] <- rev(range(my.df$x[my.df$name==unique(my.df$name)[i]])) } holdRange # [[1]] # [1] -5.052890 -9.967671 # [[2]] # [1] 2.648870 -2.629866 xyplot(y ~ x | name, data = my.df, type = c("p", "g"), scales = list(relation="free", limits=holdRange)) Philip On 6/11/2016 9:59 AM, Naresh Gurbuxani wrote: I want to draw a lattice graph where different panels have different ranges AND the order of values is reversed. I am struggling to achieve both at the same time. Can you help? Thanks, Naresh # Create dummy data for illustration my.df<- data.frame(x = runif(100, min = -10, max = -5), name = "A") my.df<- rbind(my.df, data.frame(x = rnorm(100), name = "B")) my.df<- within(my.df, {y<- x + 0.2 * rnorm(200)}) # This works. Both x and y axes show values in reverse order. xyplot(y ~ x, groups = name, data = my.df, xlim = rev(range(my.df$x)), ylim = rev(range(my.df$y)), type = c("p", "g")) # This works. Both x and y axes show values in reverse order. xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = rev(range(my.df$y)), type = c("p", "g")) # This does not work as intended. x and y values are in reverse order. But both panels have the same and x and y ranges. scales argument does not seem to have any effect. xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = rev(range(my.df$y)), scales = list(x = "free", y = "free"), type = c("p", "g")) # This does not work at all. panel.xyplot does not see to take xlim or ylim arguments. xyplot(y ~ x | name, data = my.df, scales = list(x = "free", y = "free"), panel = function(x,y,subscripts, ...) { panel.xyplot(x,y, ylim = rev(range(y[subscripts]), xlim = rev(range(x[subscripts] }) __ 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] lattice graph with free scales and reversed axis values
> On Nov 5, 2016, at 3:59 PM, Naresh Gurbuxani> wrote: > > I want to draw a lattice graph where different panels have different ranges > AND the order of values is reversed. I am struggling to achieve both at the > same time. Can you help? > > Thanks, > Naresh > > # Create dummy data for illustration > my.df <- data.frame(x = runif(100, min = -10, max = -5), name = "A") > my.df <- rbind(my.df, data.frame(x = rnorm(100), name = "B")) > my.df <- within(my.df, {y <- x + 0.2 * rnorm(200)}) > > # This works. Both x and y axes show values in reverse order. > xyplot(y ~ x, groups = name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), type = c("p", "g")) > > # This works. Both x and y axes show values in reverse order. > xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), type = c("p", "g")) > > # This does not work as intended. x and y values are in reverse order. But > both panels have the same and x and y ranges. scales argument does not seem > to have any effect. > xyplot(y ~ x | name, data = my.df, xlim = rev(range(my.df$x)), ylim = > rev(range(my.df$y)), scales = list(x = "free", y = "free"), type = c("p", > "g")) > > # This does not work at all. panel.xyplot does not see to take xlim or ylim > arguments. But prepanel does xyplot(y ~ x | name, data = my.df, scales = list(x = "free", y = "free"), panel = function(x,y,subscripts, ...) { > panel.xyplot(x,y, ylim = rev(range(y[subscripts]), xlim = > rev(range(x[subscripts] > }) I used this posting to r-help from 2006 by xyplot's author, Sarkar, to solve the problem: https://stat.ethz.ch/pipermail/r-help/2006-March/101248.html xyplot(y ~ x | name, data = my.df, scales =list(relation="free"), prepanel= function(x,y, ...) { list(xlim= rev(range(my.df$x)) , ylim = rev(range(my.df$y)) )}, type = c("p", "g")) -- David Winsemius Alameda, CA, USA __ 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 downloading library(Rcmdr)
> On Nov 5, 2016, at 3:33 PM, varin sachawrote: > > Many thanks David, > > My Rcmdr problem is solved but now I have another one with rlme package ! > > I want to use the hbrwts_gr function from the rlme package. > I have tried to download the rlme package, but rlme is not available (for R > version 3.3.2) as you can see here below the error message. > > How can I solve my problem ? https://github.com/cran/rlme -- David. > > >> install.packages("rlme") > Installing package into ‘/Users/Caro/Library/R/3.3/library’ > (as ‘lib’ is unspecified) > Warning in install.packages : > package ‘rlme’ is not available (for R version 3.3.2) > > > > > > > > De : David Winsemius > À : varin sacha > Cc : R-help Mailing List > Envoyé le : Samedi 5 novembre 2016 20h42 > Objet : Re: [R] Problem with downloading library(Rcmdr) > > > >> On Nov 5, 2016, at 11:27 AM, varin sacha via R-help >> wrote: >> >> Dear R-experts, >> >> Here below you will find my R sessionInfo. I have a problem with the >> library(Rcmdr). The error message is here below. How can I solve that >> problem ? > > I'm not an Rcmdr user and my Mac is too old to support Sierra so unable to > attempt replication. All I am able offer is a search on what appear to be > similar issues in the past. You do need to indicate your XQuartz version. I > see there have been three recent releases suggesting to me that there might > have been teething difficulties with the birth of the neanate Sierra. > >• XQuartz 2.7.11 - 2016-10-29 > >• XQuartz 2.7.10 - 2016-10-22 > >• XQuartz 2.7.9 - 2016-05-05 > > You might also mention in any follow-up whether this is being done inside > MacGUI or at an R console launched from Terminal.app. > > Make sure you have reviewed: > http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html > > > Over the years there have been many questions regarding the three-way > marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's a > relatively recent one that mentions the image function: > > http://markmail.org/search/?q=list%3Aorg.r-project.r-sig-mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig-mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results > > > So I think I would make sure you have a version of R that has Tcl and have > the most uptodate X11 version (XQuartz) and once you do that and then try to > reload R, load Rcmdr _before_ RcmdrMisc and before all those other packages. > If you still get an error, then repost with version details of _all_ the > components mentioned to the R-SIG-Mac mailing list and copy John Fox. (Might > not be necessary to give him a copy since I think he monitors R-SIG-Mac for > Rcmdr issues.) > > > -- > David. > >> >> >> Many thanks. >> >> >> >> sessionInfo() >> R version 3.3.2 (2016-10-31) >> Platform: x86_64-apple-darwin13.4.0 (64-bit) >> Running under: macOS Sierra 10.12 >> >> locale: >> [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 >> >> attached base packages: >> [1] splines stats graphics grDevices utils datasets methods >> base >> >> other attached packages: >> [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 >> >> loaded via a namespace (and not attached): >> [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 >> RColorBrewer_1.1-2 plyr_1.8.4 class_7.3-14 >> [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 >>gtable_0.2.0nlme_3.1-128 >> [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 >> Matrix_1.2-7.1 parallel_3.3.2 SparseM_1.72 >> [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 >> stringr_1.1.0 cluster_2.0.5 >> [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 >> data.table_1.9.6tcltk_3.3.2 >> [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 >> latticeExtra_0.6-28 minqa_1.2.4 Formula_1.2-1 >> [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 >> scales_0.4.0MASS_7.3-45 >> [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 >> quantreg_5.29 stringi_1.1.2 acepack_1.4.1 >> [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 >> >> >>> library(Rcmdr) >> Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', détails : >> appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") >> erreur : [tcl] invalid command name "image". >> >> Erreur : le chargement du package ou de l'espace de noms a échoué pour >> 'Rcmdr' >> >> __ >> 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
Re: [R] Problem with downloading library(Rcmdr)
Google is your friend... try searching for "CRAN rlme". The bad thing about contributed packages is that sometimes the maintainers stop maintaining their packages. The good thing is that the source is still there so you can go fix it if you really need it. -- Sent from my phone. Please excuse my brevity. On November 5, 2016 3:33:47 PM PDT, varin sacha via R-helpwrote: >Many thanks David, > >My Rcmdr problem is solved but now I have another one with rlme package >! > >I want to use the hbrwts_gr function from the rlme package. >I have tried to download the rlme package, but rlme is not available >(for R version 3.3.2) as you can see here below the error message. > >How can I solve my problem ? > > >> install.packages("rlme") >Installing package into ‘/Users/Caro/Library/R/3.3/library’ >(as ‘lib’ is unspecified) >Warning in install.packages : >package ‘rlme’ is not available (for R version 3.3.2) > > > > > > > >De : David Winsemius > >Cc : R-help Mailing List >Envoyé le : Samedi 5 novembre 2016 20h42 >Objet : Re: [R] Problem with downloading library(Rcmdr) > > > >> On Nov 5, 2016, at 11:27 AM, varin sacha via R-help > wrote: >> >> Dear R-experts, >> >> Here below you will find my R sessionInfo. I have a problem with the >library(Rcmdr). The error message is here below. How can I solve that >problem ? > >I'm not an Rcmdr user and my Mac is too old to support Sierra so unable >to attempt replication. All I am able offer is a search on what appear >to be similar issues in the past. You do need to indicate your XQuartz >version. I see there have been three recent releases suggesting to me >that there might have been teething difficulties with the birth of the >neanate Sierra. > >• XQuartz 2.7.11 - 2016-10-29 > >• XQuartz 2.7.10 - 2016-10-22 > >• XQuartz 2.7.9 - 2016-05-05 > >You might also mention in any follow-up whether this is being done >inside MacGUI or at an R console launched from Terminal.app. > >Make sure you have reviewed: >http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html > > >Over the years there have been many questions regarding the three-way >marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's >a relatively recent one that mentions the image function: > >http://markmail.org/search/?q=list%3Aorg.r-project.r-sig-mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig-mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results > > >So I think I would make sure you have a version of R that has Tcl and >have the most uptodate X11 version (XQuartz) and once you do that and >then try to reload R, load Rcmdr _before_ RcmdrMisc and before all >those other packages. If you still get an error, then repost with >version details of _all_ the components mentioned to the R-SIG-Mac >mailing list and copy John Fox. (Might not be necessary to give him a >copy since I think he monitors R-SIG-Mac for Rcmdr issues.) > > >-- >David. > >> >> >> Many thanks. >> >> >> >> sessionInfo() >> R version 3.3.2 (2016-10-31) >> Platform: x86_64-apple-darwin13.4.0 (64-bit) >> Running under: macOS Sierra 10.12 >> >> locale: >> [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 >> >> attached base packages: >> [1] splines stats graphics grDevices utils datasets >methods base >> >> other attached packages: >> [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 >> >> loaded via a namespace (and not attached): >> [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 >RColorBrewer_1.1-2 plyr_1.8.4 class_7.3-14 >> [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10 >lme4_1.1-12 gtable_0.2.0nlme_3.1-128 >> [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 >Matrix_1.2-7.1 parallel_3.3.2 SparseM_1.72 >> [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 >Rcmdr_2.3-1 stringr_1.1.0 cluster_2.0.5 >> [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 >nnet_7.3-12 data.table_1.9.6tcltk_3.3.2 >> [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 >latticeExtra_0.6-28 minqa_1.2.4 Formula_1.2-1 >> [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 >Hmisc_4.0-0 scales_0.4.0MASS_7.3-45 >> [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 >quantreg_5.29 stringi_1.1.2 acepack_1.4.1 >> [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 >> >> >>> library(Rcmdr) >> Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', >détails : >> appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") >> erreur : [tcl] invalid command name "image". >> >> Erreur : le chargement du package ou de l'espace de noms a échoué >pour 'Rcmdr' >> >> __ >>
Re: [R] Problem with downloading library(Rcmdr)
Many thanks David, My Rcmdr problem is solved but now I have another one with rlme package ! I want to use the hbrwts_gr function from the rlme package. I have tried to download the rlme package, but rlme is not available (for R version 3.3.2) as you can see here below the error message. How can I solve my problem ? > install.packages("rlme") Installing package into ‘/Users/Caro/Library/R/3.3/library’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘rlme’ is not available (for R version 3.3.2) De : David WinsemiusCc : R-help Mailing List Envoyé le : Samedi 5 novembre 2016 20h42 Objet : Re: [R] Problem with downloading library(Rcmdr) > On Nov 5, 2016, at 11:27 AM, varin sacha via R-help > wrote: > > Dear R-experts, > > Here below you will find my R sessionInfo. I have a problem with the > library(Rcmdr). The error message is here below. How can I solve that problem > ? I'm not an Rcmdr user and my Mac is too old to support Sierra so unable to attempt replication. All I am able offer is a search on what appear to be similar issues in the past. You do need to indicate your XQuartz version. I see there have been three recent releases suggesting to me that there might have been teething difficulties with the birth of the neanate Sierra. • XQuartz 2.7.11 - 2016-10-29 • XQuartz 2.7.10 - 2016-10-22 • XQuartz 2.7.9 - 2016-05-05 You might also mention in any follow-up whether this is being done inside MacGUI or at an R console launched from Terminal.app. Make sure you have reviewed: http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html Over the years there have been many questions regarding the three-way marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's a relatively recent one that mentions the image function: http://markmail.org/search/?q=list%3Aorg.r-project.r-sig-mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig-mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results So I think I would make sure you have a version of R that has Tcl and have the most uptodate X11 version (XQuartz) and once you do that and then try to reload R, load Rcmdr _before_ RcmdrMisc and before all those other packages. If you still get an error, then repost with version details of _all_ the components mentioned to the R-SIG-Mac mailing list and copy John Fox. (Might not be necessary to give him a copy since I think he monitors R-SIG-Mac for Rcmdr issues.) -- David. > > > Many thanks. > > > > sessionInfo() > R version 3.3.2 (2016-10-31) > Platform: x86_64-apple-darwin13.4.0 (64-bit) > Running under: macOS Sierra 10.12 > > locale: > [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 > > attached base packages: > [1] splines stats graphics grDevices utils datasets methods > base > > other attached packages: > [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 > > loaded via a namespace (and not attached): > [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 > RColorBrewer_1.1-2 plyr_1.8.4 class_7.3-14 > [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 > gtable_0.2.0nlme_3.1-128 > [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 > Matrix_1.2-7.1 parallel_3.3.2 SparseM_1.72 > [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 >stringr_1.1.0 cluster_2.0.5 > [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 >data.table_1.9.6tcltk_3.3.2 > [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 > latticeExtra_0.6-28 minqa_1.2.4 Formula_1.2-1 > [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 >scales_0.4.0MASS_7.3-45 > [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 > quantreg_5.29 stringi_1.1.2 acepack_1.4.1 > [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 > > >> library(Rcmdr) > Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', détails : > appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") > erreur : [tcl] invalid command name "image". > > Erreur : le chargement du package ou de l'espace de noms a échoué pour 'Rcmdr' > > __ > 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. David Winsemius Alameda, CA, USA __ 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
Re: [R] question on lasso
Hi Dr. Franggakis; This can be explained because of collinearity and suppressor variable in multiple regression models. In the first scenario, you have both correlated variables and suppressor variables in the second scenario you do not have this problem. I do wonder why to do not use the scale elastic net for this particular problem. Good luck,Oslo On Saturday, November 5, 2016 4:29 PM, Constantine Frangakiswrote: I would appreciate any comments to the following question. I am trying to build a model for survival based on 155 patients and 70 covariates using lasso. Lasso picks, three variables only, say X1,X2,X3, and omits the others. I wanted to check why a particular (clinically important) variable, say X4, is omitted by lasso. One of the things I did was I ran lasso on X1,X2,X3 and X4 only. The results (coefs) I get are different from running all 70 variables, and in fact now X4 is not omitted. Why is that ? should it not be that the global (among all 70 variables) optimum, which is X1,X2,X3 and not X4, be also the local (among the four only) optimum ? Thank you for your consideration Constantine Frangakis, PhD Professor Departments of Biostatistics Psychiatry, and Radiology Johns Hopkins University [[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.
Re: [R] question on lasso
Wrong list. This list is about R programming not statistics. Try stats.stackexchange.com for statistics questions. However, I will make a suggestion: Find local statistical experts with whom to consult. Your understanding appears to fall short of the necessary background to use such complex statistical procedures reliably. I am not confident that online lists will suffice. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Nov 5, 2016 at 11:37 AM, Constantine Frangakiswrote: > I would appreciate any comments to the following question. > I am trying to build a model for survival based on 155 patients and 70 > covariates using lasso. Lasso picks, three variables only, say X1,X2,X3, and > omits the others. I wanted to check why a particular (clinically important) > variable, say X4, is omitted by lasso. One of the things I did was I ran > lasso on X1,X2,X3 and X4 only. The results (coefs) I get are different from > running all 70 variables, and in fact now X4 is not omitted. > Why is that ? should it not be that the global (among all 70 variables) > optimum, which is X1,X2,X3 and not X4, be also the local (among the four > only) optimum ? > Thank you for your consideration > > > Constantine Frangakis, PhD > Professor > Departments of Biostatistics > Psychiatry, and Radiology > Johns Hopkins University > > > > > > > [[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] question on lasso
I would appreciate any comments to the following question. I am trying to build a model for survival based on 155 patients and 70 covariates using lasso. Lasso picks, three variables only, say X1,X2,X3, and omits the others. I wanted to check why a particular (clinically important) variable, say X4, is omitted by lasso. One of the things I did was I ran lasso on X1,X2,X3 and X4 only. The results (coefs) I get are different from running all 70 variables, and in fact now X4 is not omitted. Why is that ? should it not be that the global (among all 70 variables) optimum, which is X1,X2,X3 and not X4, be also the local (among the four only) optimum ? Thank you for your consideration Constantine Frangakis, PhD Professor Departments of Biostatistics Psychiatry, and Radiology Johns Hopkins University [[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] tcl('tk::fontchooser', 'show') : Hoe to use? R-devel Tcl 8.6
Hello, Somebody would indicate the correct way to use the option the fontchooser widget into tcltk package (in R-devel, Tcl 8.6) ? I tried to use as other traditional widgets but no success. (code below) Thanks Cleber > tt <- tktoplevel(); but <- ttkbutton( tt, text='Test'); tcl('pack', but ) > tcl( but, 'configure', '-text' ) -text text Text {} Test > tcl( but, 'configure', text=NULL ) -text text Text {} Test > tcl( but, 'cget', '-text') Test > > > tcl('tk::fontchooser', 'show') > tcl( 'tk::fontchooser', 'configure', '-font') > > > sessionInfo() R Under development (unstable) (2016-11-01 r71616) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.4.0 > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[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.
Re: [R] Problem with downloading library(Rcmdr)
> On Nov 5, 2016, at 11:27 AM, varin sacha via R-help> wrote: > > Dear R-experts, > > Here below you will find my R sessionInfo. I have a problem with the > library(Rcmdr). The error message is here below. How can I solve that problem > ? I'm not an Rcmdr user and my Mac is too old to support Sierra so unable to attempt replication. All I am able offer is a search on what appear to be similar issues in the past. You do need to indicate your XQuartz version. I see there have been three recent releases suggesting to me that there might have been teething difficulties with the birth of the neanate Sierra. • XQuartz 2.7.11 - 2016-10-29 • XQuartz 2.7.10 - 2016-10-22 • XQuartz 2.7.9 - 2016-05-05 You might also mention in any follow-up whether this is being done inside MacGUI or at an R console launched from Terminal.app. Make sure you have reviewed: http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html Over the years there have been many questions regarding the three-way marriage of R, MacOS, and Rcmdr that relate to Tk/Tcl functions. Here's a relatively recent one that mentions the image function: http://markmail.org/search/?q=list%3Aorg.r-project.r-sig-mac+tcl+Rcmdr+image#query:list%3Aorg.r-project.r-sig-mac%20tcl%20Rcmdr%20image+page:1+mid:y5mgjtgtw65eqzfu+state:results So I think I would make sure you have a version of R that has Tcl and have the most uptodate X11 version (XQuartz) and once you do that and then try to reload R, load Rcmdr _before_ RcmdrMisc and before all those other packages. If you still get an error, then repost with version details of _all_ the components mentioned to the R-SIG-Mac mailing list and copy John Fox. (Might not be necessary to give him a copy since I think he monitors R-SIG-Mac for Rcmdr issues.) -- David. > > > Many thanks. > > > > sessionInfo() > R version 3.3.2 (2016-10-31) > Platform: x86_64-apple-darwin13.4.0 (64-bit) > Running under: macOS Sierra 10.12 > > locale: > [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 > > attached base packages: > [1] splines stats graphics grDevices utils datasets methods > base > > other attached packages: > [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 > > loaded via a namespace (and not attached): > [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 > RColorBrewer_1.1-2 plyr_1.8.4 class_7.3-14 > [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 > gtable_0.2.0nlme_3.1-128 > [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 > Matrix_1.2-7.1 parallel_3.3.2 SparseM_1.72 > [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 >stringr_1.1.0 cluster_2.0.5 > [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 >data.table_1.9.6tcltk_3.3.2 > [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 > latticeExtra_0.6-28 minqa_1.2.4 Formula_1.2-1 > [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 >scales_0.4.0MASS_7.3-45 > [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7 > quantreg_5.29 stringi_1.1.2 acepack_1.4.1 > [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 > > >> library(Rcmdr) > Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', détails : > appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") > erreur : [tcl] invalid command name "image". > > Erreur : le chargement du package ou de l'espace de noms a échoué pour 'Rcmdr' > > __ > 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. David Winsemius Alameda, CA, USA __ 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] Problem with downloading library(Rcmdr)
Dear R-experts, Here below you will find my R sessionInfo. I have a problem with the library(Rcmdr). The error message is here below. How can I solve that problem ? Many thanks. sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: macOS Sierra 10.12 locale: [1] fr_CH.UTF-8/fr_CH.UTF-8/fr_CH.UTF-8/C/fr_CH.UTF-8/fr_CH.UTF-8 attached base packages: [1] splines stats graphics grDevices utils datasets methods base other attached packages: [1] RcmdrMisc_1.0-5 sandwich_2.3-4 car_2.1-3 loaded via a namespace (and not attached): [1] Rcpp_0.12.7 tcltk2_1.2-11 nloptr_1.0.4 RColorBrewer_1.1-2 plyr_1.8.4 class_7.3-14 [7] tools_3.3.2 digest_0.6.10 rpart_4.1-10lme4_1.1-12 gtable_0.2.0nlme_3.1-128 [13] htmlTable_1.7 lattice_0.20-34 mgcv_1.8-15 Matrix_1.2-7.1 parallel_3.3.2 SparseM_1.72 [19] relimp_1.0-5e1071_1.6-7 gridExtra_2.2.1 Rcmdr_2.3-1 stringr_1.1.0 cluster_2.0.5 [25] knitr_1.14 MatrixModels_0.4-1 grid_3.3.2 nnet_7.3-12 data.table_1.9.6tcltk_3.3.2 [31] readxl_0.1.1survival_2.40-1 foreign_0.8-67 latticeExtra_0.6-28 minqa_1.2.4 Formula_1.2-1 [37] ggplot2_2.1.0 magrittr_1.5htmltools_0.3.5 Hmisc_4.0-0 scales_0.4.0MASS_7.3-45 [43] abind_1.4-5 pbkrtest_0.4-6 colorspace_1.2-7quantreg_5.29 stringi_1.1.2 acepack_1.4.1 [49] munsell_0.4.3 chron_2.3-47zoo_1.7-13 > library(Rcmdr) Error : .onAttach a échoué dans attachNamespace() pour 'Rcmdr', détails : appel : structure(.External(.C_dotTclObjv, objv), class = "tclObj") erreur : [tcl] invalid command name "image". Erreur : le chargement du package ou de l'espace de noms a échoué pour 'Rcmdr' __ 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] Using map with filled.contour doesn't display map
> On Nov 5, 2016, at 9:33 AM, Jeff Newmillerwrote: > > I get the error also (R3.3.1/raster2.5-8). > > Works fine if I call plot.new() before calling filledContour. It didn't "work fine" when I did that. I first briefly see a generic plotting frame (x and y axes with no data) which was then blanked out and replaced with a colored "strip map" of temperatures but no map of continents. Further I get the message: > library("ncdf") Package 'ncdf' is deprecated and will be removed from CRAN shortly. Use instead package RNetCDF or ncdf4 (for Windows from CRANextras) I would further note that in the original sessionInfo() output there was no instance of `ncdf` only `ncdf4`. However, that doesn't explain the problem. The same behavior appears if I restart R and instead load ncdf4. I was also unable to get any further plotting ... which was the original question, I thought. In particular this failed to update the image. filledContour( temp_file, plot.axes={axis(1); axis(2); map("world2", add=TRUE); points(0,0) }) If you look at map() you see that it also messes with the par('mar') values. I think the add=TRUE is overriding the plot=TRUE parameter to map. I can get a subsequent `points(0,0)`-call to plot a point but the location is not correct on the y axis. I think you would be better advised to start with map() and then fill in the colors using the values extracted from your NCDF file with the methods in the setup portion of filledContour. David. > > Given this is a contributed package you should be corresponding with the > package maintainer if you think this solution is inappropriate or the > documentation needs fixing, but I suspect you are better off being able to > initialize the plot yourself. > -- > Sent from my phone. Please excuse my brevity. > > On November 4, 2016 9:53:18 PM PDT, Jeff Charlton > wrote: >> Hi David, >> >> Thank you for the response. I apologize that I didn't give a more >> complete >> example. Here's code that recreates the issue I'm having on my system. >> You'll have to enter the path to your packages and where you want to >> store >> the downloaded file. >> >> library("maps", lib.loc="") >> library("raster", lib.loc="") >> library("ncdf", lib.loc="") >> >> download.file(" >> http://schubert.atmos.colostate.edu/~cslocum/code/air.sig995.2012.nc;, >> "/temp_file.nc") >> temp_file = raster("/temp_file.nc") >> filledContour(temp_file, plot.axes={axis(1); axis(2); map("world2", >> add=TRUE)}) >> >> When this is run, you should get a plot that shows some contours >> overlaid >> on a map of world. I originally wrote this several years ago. This >> code >> worked for me with the following versions of packages: R (3.0.1); ncdf >> (1.6.6); maps (2.3-6); and raster (2.1-49). >> >> Now, on my new, upgraded system, when I run this, I get a "plot.new has >> not >> been called yet" error. If I then execute a plot.new() command and try >> the >> filledContour command again, I get the contours, but no map. As I said >> below, I believe something has changed in the maps package, but I can't >> find anything in the documentation on it or an indication that others >> are >> having the same issue. My current versions are: R (3.3.2); ncdf4 >> (1.15); >> maps (3.1.1); and raster (2.5-8). >> >> I've changed from the ncdf package to the ncdf4 package, but I wouldn't >> expect that to be an issue as that package is for reading netCDF files >> into >> R and that isn't an issue (i.e. I can do a plot(temp_file) to see that >> the >> file has been loaded properly) >> >> Thanks for your time, >> Jeff >> >> >> >> On Fri, Nov 4, 2016 at 6:43 PM, David Winsemius >> >> wrote: >> >>> On Nov 4, 2016, at 11:26 AM, Jeff Charlton >> wrote: Hello, I'm trying to overlay a map on top of data showing temperatures >> across >>> the world. The code I'm using is: filledContour(tempdata, plot.axes={axis(1); axis(2); >> map("world2", add=TRUE)}) where tempdata is a raster file made from a netcdf file downloaded >> from >>> the NOAA website. The filledContour is a wrapper that translates the >> raster image into something that can be used by filled.contour. If I run the code: filledContour(tempdata) >>> >>> It's somewhat difficult to advise since in one place you say you are >> using >>> filled.contour, but above you are writing filledContour (but are not >> saying >>> where this function comes from or offering the required `library` >> call to >>> set this up.). You are also not offering any data example. Suggest >> you make >>> this a complete example. >>> I get the image I want, but when I add the plot.axes parameter, I >> get a "plot.new has not been called yet" error in axis(1). If I run >> plot.new() and the original filledContour call, I get the same result as
Re: [R] Help-Text file
Sorry, but this request is quite hard to understand... you are basically directing your question at an incredibly narrow set of people who happen to have combined your kind of data read in the way you read it in with your kind of analysis algorithms while telling us almost nothing about how you did those things. Please read the Posting Guide mentioned in the footer of every posting on this list and provide a reproducible example [1][2]. If the problem is in your use of R then someone here will be able to help. If your problem is inside a contributed package then you may need the assistance of the package maintainer, but they will also need a reproducible example so your effort will not be in vain. Also, the act of creating a RE often leads you to your own solution even without getting outside help. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html -- Sent from my phone. Please excuse my brevity. On November 4, 2016 10:28:48 PM PDT, Priya Arasu via R-helpwrote: >Hi, > I am using R 3.3.1 in R studio version 1.0.44 (Windows10, 64 bit >system). I could import text file with Boolean rules, but when I start >doing analysis in R, I get the error: I have been trying to do >attractor analysis using R package Boolnet, using the command: attr <- >getAttractors(net, type="asynchronous"). This command throws up the >below error: > >Error in matrix(nrow = n, ncol = length(network$genes)) : > invalid 'nrow' value (too large or NA) >In addition: Warning message: >In matrix(nrow = n, ncol = length(network$genes)) : > NAs introduced by coercion to integer range > > > Have anyone come across this error?. I have attached the text file >with Boolean rules. Pls find it. Any suggestions or ideas, would be of >great help >Thank you >Priya > > > > > > > > > > > > > > > > > > > > >__ >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] Using map with filled.contour doesn't display map
I get the error also (R3.3.1/raster2.5-8). Works fine if I call plot.new() before calling filledContour. Given this is a contributed package you should be corresponding with the package maintainer if you think this solution is inappropriate or the documentation needs fixing, but I suspect you are better off being able to initialize the plot yourself. -- Sent from my phone. Please excuse my brevity. On November 4, 2016 9:53:18 PM PDT, Jeff Charltonwrote: >Hi David, > >Thank you for the response. I apologize that I didn't give a more >complete >example. Here's code that recreates the issue I'm having on my system. >You'll have to enter the path to your packages and where you want to >store >the downloaded file. > >library("maps", lib.loc="") >library("raster", lib.loc="") >library("ncdf", lib.loc="") > >download.file(" >http://schubert.atmos.colostate.edu/~cslocum/code/air.sig995.2012.nc;, >"/temp_file.nc") >temp_file = raster("/temp_file.nc") >filledContour(temp_file, plot.axes={axis(1); axis(2); map("world2", >add=TRUE)}) > >When this is run, you should get a plot that shows some contours >overlaid >on a map of world. I originally wrote this several years ago. This >code >worked for me with the following versions of packages: R (3.0.1); ncdf >(1.6.6); maps (2.3-6); and raster (2.1-49). > >Now, on my new, upgraded system, when I run this, I get a "plot.new has >not >been called yet" error. If I then execute a plot.new() command and try >the >filledContour command again, I get the contours, but no map. As I said >below, I believe something has changed in the maps package, but I can't >find anything in the documentation on it or an indication that others >are >having the same issue. My current versions are: R (3.3.2); ncdf4 >(1.15); >maps (3.1.1); and raster (2.5-8). > >I've changed from the ncdf package to the ncdf4 package, but I wouldn't >expect that to be an issue as that package is for reading netCDF files >into >R and that isn't an issue (i.e. I can do a plot(temp_file) to see that >the >file has been loaded properly) > >Thanks for your time, >Jeff > > > >On Fri, Nov 4, 2016 at 6:43 PM, David Winsemius > >wrote: > >> >> > On Nov 4, 2016, at 11:26 AM, Jeff Charlton >wrote: >> > >> > Hello, >> > >> > I'm trying to overlay a map on top of data showing temperatures >across >> the >> > world. The code I'm using is: >> > >> > filledContour(tempdata, plot.axes={axis(1); axis(2); >map("world2", >> > add=TRUE)}) >> > >> > where tempdata is a raster file made from a netcdf file downloaded >from >> the >> > NOAA website. The filledContour is a wrapper that translates the >raster >> > image into something that can be used by filled.contour. >> > >> > If I run the code: >> > >> > filledContour(tempdata) >> >> It's somewhat difficult to advise since in one place you say you are >using >> filled.contour, but above you are writing filledContour (but are not >saying >> where this function comes from or offering the required `library` >call to >> set this up.). You are also not offering any data example. Suggest >you make >> this a complete example. >> >> > >> > I get the image I want, but when I add the plot.axes parameter, I >get a >> > "plot.new has not been called yet" error in axis(1). If I run >plot.new() >> > and the original filledContour call, I get the same result as if I >just >> did >> > filledContour(tempdata) (i.e. no map is overlayed). >> > >> > The kicker in all this is that this code worked a couple of years >ago. I >> > ran into this error when I recently dusted of my code and installed >the >> > latest version of R and its various packages. I have a feeling that >> > something has changed in the maps package but I can't find any >reference >> to >> > it online. >> > >> > Can anyone help? >> > >> > Thank you, >> > >> > Jeff >> > >> > Just in case, here's my session info: >> > >> > 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=English_United States.1252 >LC_CTYPE=English_United >> > States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C >> > LC_TIME=English_United States.1252 >> > >> > attached base packages: [1] stats graphics grDevices utils datasets >> methods >> > base >> > >> > other attached packages: [1] ncdf4_1.15 maps_3.1.1 XML_3.98-1.4 >> > RCurl_1.95-4.8 bitops_1.0-6 raster_2.5-8 sp_1.2-3 >> > >> > loaded via a namespace (and not attached): [1] parallel_3.3.2 >tools_3.3.2 >> > Rcpp_0.12.7 grid_3.3.2 lattice_0.20-34 >> > >> > [[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] Stop R script from running, when the memory goes beyond 15.4GB
See man ulimit Best, Ista On Nov 5, 2016 8:11 AM, "Priya Arasu via R-help"wrote: > Hi, > I am using R 3.3.1 in RedHat Linux7 , 64bit system (16GB RAM). I > could run simulation in R package, Boolnet for 25 genes without any > problem. When I add more gene i.e. 26 genes, the system becomes slow. > Simulation keeps running for more than a day. I have to stop the > simulation, as it takes a lot of memory. I need a suggestion here, I want > to stop the script from running when the script takes memory beyond 15.4 > GB. How do I do it? Should I generate warning in my script or use typeCatch? > Any idea or advice, would be of great help > Thank you > Priya > > > > > [[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.
Re: [R] loop with variable names
1. Statistically, you probably don't want to do this at all (but that's another story). 2. Programatically, you probably want to use one of several packages that do it already rather than trying to reinvent the wheel. A quick search on rseek.org for "all subsets regression" brought up this: http://rpubs.com/kaz_yos/all-subset Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Nov 4, 2016 at 9:53 AM, paolo brunoriwrote: > Suppose I have the following data: > > y<-rnorm(10) > age<-rnorm(10) > sex<-rbinom(10,1, 0.5) > edu<-round(runif(10, 1, 20)) > edu2<-edu^2 > > df<-data.frame(y,age,sex,edu,edu2) > > I want to run a large number of models, for example: > > lm(y~age) > lm(y~age+sex) > lm(y~age+sex+edu) > lm(y~age+sex+edu+edu2) > lm(y~sex+edu2) > lm(y~age+edu+edu2) > > > But I would like to first define a list containing all possible sets of > regressors, and then execute each one in a loop/lapply. Unfortunately I got > lost in trying to paste variables' name in the formula with no result. > > many thanks in advance. > > paolo > > > > -- > Paolo Brunori > Ricercatore in Economia Politica & Life Course Centre Fellow > Dipartimento di Scienze Economiche - Università di Bari > www.uniba.it/docenti/brunori-paolo > www.equalchances.org > www.lifecoursecentre.org.au > > __ > 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-Text file
Hi, I am using R 3.3.1 in R studio version 1.0.44 (Windows10, 64 bit system). I could import text file with Boolean rules, but when I start doing analysis in R, I get the error: I have been trying to do attractor analysis using R package Boolnet, using the command: attr <- getAttractors(net, type="asynchronous"). This command throws up the below error: Error in matrix(nrow = n, ncol = length(network$genes)) : invalid 'nrow' value (too large or NA) In addition: Warning message: In matrix(nrow = n, ncol = length(network$genes)) : NAs introduced by coercion to integer range Have anyone come across this error?. I have attached the text file with Boolean rules. Pls find it. Any suggestions or ideas, would be of great help Thank you Priya Targets, factors DISC1, (!miR124 & !let7b & !let7a & !let7d) | (PCM1 & BBS4) | (MITF | GATA1 | TAL1 | EZH2 | AR | TCF3 | HNF4A | RUNX1) MITF, (MITF) GATA1, (GATA1) TAL1, (!miR377) | (TAL1) EZH2, (!miR124) | (EZH2) AR, (!miR124) | (AR) TCF3, (!miR124) | (TCF3) miR124, (EGR1) miR377, (miR377) let7b, (let7b) let7a, (let7a) let7d, (let7d) PCM1, (! miR33a) | (DISC1 & BBS4) | (EGR1 | SALL4 | POU3F2 | THAP11 | HCFC1 | ZFP281 | WT1 | SOX2 | CUX1 | SIN3B | KDM5B | HOXB4 | ELK1 | TCF3 | FLI1 | HNF4A | RUNX1 | MITF) miR33a, (miR33a) EGR1, (! miR124) | (EGR1) SALL4, (SALL4) POU3F2, (POU3F2) THAP11, (THAP11) HCFC1, (HCFC1) ZFP281, (ZFP281) WT1, (WT1) SOX2, (SOX2) CUX1, (CUX1) SIN3B, (SIN3B) KDM5B, (KDM5B) HOXB4, (HOXB4) ELK1, (ELK1) FLI1, (FLI1) HNF4A, (HNF4A) RUNX1, (RUNX1) BBS4, (! miR432 & ! miR382 & ! miR127 & ! miR377) | (DISC1 & PCM1) | (E2F1 | GATA1 | FLI1 | MITF | ELK1 | CUX1 | KDM5B | SIN3B) | GABP | EOMES | TFAP2A) miR432, (miR432) miR382, (miR382) miR127, (miR127) E2F1, (! let7a) | (E2F1) TFAP2A, (TFAP2A) EOMES, (EOMES) GABP, (GABP) __ 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] Stop R script from running, when the memory goes beyond 15.4GB
Hi, I am using R 3.3.1 in RedHat Linux7 , 64bit system (16GB RAM). I could run simulation in R package, Boolnet for 25 genes without any problem. When I add more gene i.e. 26 genes, the system becomes slow. Simulation keeps running for more than a day. I have to stop the simulation, as it takes a lot of memory. I need a suggestion here, I want to stop the script from running when the script takes memory beyond 15.4 GB. How do I do it? Should I generate warning in my script or use typeCatch? Any idea or advice, would be of great help Thank you Priya [[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.