Re: [R] [EXTERNAL] Re: bug in Windows implementation of nlme::groupedData

2022-01-07 Thread John Fox
Dear Melissa, Normally, in evaluating a formula an R modeling function follows the scoping rules in ?formula; that is, "A formula object has an associated environment, and this environment (rather than the parent environment) is used by model.frame to evaluate variables that are not found in

Re: [R] [EXTERNAL] Re: bug in Windows implementation of nlme::groupedData

2022-01-07 Thread Key, Melissa
John, Thanks for your response. I agree that the definition of the data frame is poor (in my defense it came directly from the demo code, but I should have checked it more thoroughly). The good news is that your comments caused me to take a closer look at where X was defined, and I found the

Re: [R] bug in Windows implementation of nlme::groupedData

2022-01-07 Thread John Fox
Dear Melissa, It seems strange to me that your code would work on any platform (it doesn't on my Mac) because the data frame you create shouldn't contain a matrix named "X" but rather columns including those originating from X. To illustrate: > X <- matrix(1:12, 4, 3) > colnames(X) <- c("a",

[R] bug in Windows implementation of nlme::groupedData

2022-01-07 Thread Key, Melissa
I am trying to replicate a semi-parametric analysis described in Harezlak, Jaroslaw, David Ruppert, and Matt P. Wand. Semiparametric regression with R. New York, NY: Springer, 2018. (https://link.springer.com/book/10.1007%2F978-1-4939-8853-2). I can successfully run the analysis, but now I'm tr

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
Ah I see. Thank you very much! On Fri, Jan 7, 2022 at 6:08 PM Jim Lemon wrote: > > Yes, the Mercator projection unwraps the globe (360 degrees around) > while the poles are 180 degrees apart. It then stretches the result > into a rectangle. If you enter: > > par("usr") > > after drawing the world

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
Got it. Thank you very much. On Fri, Jan 7, 2022 at 5:36 PM PIKAL Petr wrote: > > Hi Ani > > No need to apologise. I may by wrong as I did not dig into the map code and do > not use the package so I only guess. You could check how mar changes by > > > par("mar") > [1] 5.1 4.1 4.1 2.1 > > So > par

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread Jim Lemon
Yes, the Mercator projection unwraps the globe (360 degrees around) while the poles are 180 degrees apart. It then stretches the result into a rectangle. If you enter: par("usr") after drawing the world map you will see the proportions. Jim On Fri, Jan 7, 2022 at 7:20 PM ani jaya wrote: > > Hi

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread PIKAL Petr
Hi Ani No need to apologise. I may by wrong as I did not dig into the map code and do not use the package so I only guess. You could check how mar changes by > par("mar") [1] 5.1 4.1 4.1 2.1 So par("mar") par(mar=c(2, 6, 5, 4)) par("mar") m<-map('world', xlim = c(91, 142), ylim = c(25, 40), lwd

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
Hi Jim, Thank you for the alternative. Absolutely will try it. Can you explain a bit about "Maps draws an approximately 2x1 plot"? Is it the size proportion 2 in x-axis and 1 in y-axis? On Fri, Jan 7, 2022 at 4:41 PM Jim Lemon wrote: > > Hi Ani, > Blame Mercator. Maps draws an approximately 2x1

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
Hi Petr, Thank you for pointing that out! Silly newbie here. So, just want to make sure my mind, using my example: par(mar=c(2, 6, 5, 4)) m<-map('world', xlim = c(91, 142), ylim = c(25, 40), lwd=1.5, col = "grey",border=NA, fill = T, bg="white") box() first, map use the first mar=c(2,6,5