[R] rgl not plotting properly

2023-05-04 Thread Jiayue Wang
Hi I can't get rgl working. I installed rgl, loaded it, but it seems all plot3d codes have failed: remotes::install_github("dmurdoch/rgl") library(rgl) open3d() x <- sort(rnorm(1000)) y <- rnorm(1000) z <- rnorm(1000) + atan2(x, y) plot3d(x, y, z, col = rainbow(1000)) I see no plotting at all

[R] Regex Split?

2023-05-04 Thread Leonard Mada via R-help
Dear R-Users, I tried the following 3 Regex expressions in R 4.3: strsplit("a bc,def, adef ,,gh", " |(?=,)|(?<=,)(?![ ])", perl=T) # "a"    "bc"   ","    "def"  ","    "" "adef" ","    "," "gh" strsplit("a bc,def, adef ,,gh", " |(?- the first one could also return "", "," (but probably not;

Re: [R] question about update()

2023-05-04 Thread Adelchi Azzalini via R-help
Hi, Berwin, good to hear from you, and thanks for the detailed comments and suggestion. Actually, my current experimental code works in the way that you suggest, calling directly lm.fit and glm.fit. What I am trying to develop is an “improved” version of the code for distribution to other peop

Re: [R] question about update()

2023-05-04 Thread Berwin A Turlach
G'day Adelchi, hope all is well with you. On Thu, 4 May 2023 10:34:00 +0200 Adelchi Azzalini via R-help wrote: > Thanks, Duncan. What you indicate is surely the ideal route. > Unfortunately, in my case this is not feasible, because the > construction of xf and the update call are within an iter

Re: [R] question about update()

2023-05-04 Thread Duncan Murdoch
On 04/05/2023 4:34 a.m., Adelchi Azzalini wrote: On 4 May 2023, at 10:26, Duncan Murdoch wrote: On 04/05/2023 4:05 a.m., Adelchi Azzalini via R-help wrote: Hi. There must be something about the use of update() which I do not grasp, as the next exercise indicates. Suppose that obj is an obje

Re: [R] question about update()

2023-05-04 Thread Adelchi Azzalini via R-help
> On 4 May 2023, at 10:26, Duncan Murdoch wrote: > > On 04/05/2023 4:05 a.m., Adelchi Azzalini via R-help wrote: >> Hi. There must be something about the use of update() which I do not grasp, >> as the next exercise indicates. >> Suppose that obj is an object returned by a call to lm() or glm(

[R] question about update()

2023-05-04 Thread Adelchi Azzalini via R-help
Hi. There must be something about the use of update() which I do not grasp, as the next exercise indicates. Suppose that obj is an object returned by a call to lm() or glm(). Next, a new variable xf is constructed using the same dataframe used for producing obj. Then obj$data <- cbind(obj$data,