Re: [R] The "--slave" option

2019-09-18 Thread Abby Spurdle
> Personally I much prefer backwards compatibility to political correctness. I agree with Rolf, here. And as someone that's planning to write a Linux Terminal Emulator, in the medium-term future, I *strongly* defend this approach. And to the original poster. Haven't you seen The Matrix? (Second

Re: [R] The "--slave" option

2019-09-18 Thread Rolf Turner
On 18/09/19 6:00 PM, Benjamin Lang wrote: Dear R project, I have a very simple question: How, in late 2019, is there an option called "--slave" to "make R run as quietly as possible"? Let me reiterate that it is 2019, i.e. "The Future", rather than 1970 when R was presumably developed,

Re: [R] The "--slave" option

2019-09-18 Thread Jeff Newmiller
I think there is no confusion except in the minds of those with nothing better to do. I agree with Antirez, quoted in [1], which nevertheless indicates that perspective lost the debate. Any accurate alternative notation will have similar connotations because in fact the "slave" side of that

Re: [R] Data conversion

2019-09-18 Thread Jim Lemon
Hi Edward, Say your "data frame" is named "epdat". This may do it: epmat<-matrix(epdat[10:289],nrow=28) colnames(epmat)<-sub("1","",names(epdat[10:289])[seq(1,270,by=28)]) This one looks like the Sorceror's Apprentice tangled with one of those experimental schedule scripting programs. Jim On

[R] Data conversion

2019-09-18 Thread Patzelt, Edward
Hi R Help, How would I convert the data below so that I have it formatted with trials along the rows and then each type of measure separately? e.g., Subject RT OnOff Feedback Trial_1 Trial_2 Trial_3 Trial_4 Thanks! Edward structure(list(TAP_ID = "967372 ", TAP_Date =

[R] Problem loading packages in R 3.6.1

2019-09-18 Thread Thomas Knox
I have recently installed R 3.6.1 on my MacBook running Mac OS Mojave 10.14.5 in order to run a custom package called MH1823 (probability of detection). This package requires me to load the following packages from CRAN, tcltk, tcltk2, survival and xlsx. I have installed survival, xlsx and

Re: [R] Not the same length

2019-09-18 Thread varin sacha via R-help
Ar ! What a pity, I have not seen it ! Many thanks ! Le mercredi 18 septembre 2019 à 19:07:42 UTC+2, peter dalgaard a écrit : Redefining n is probably not a good idea... [...snip...] > m <-runif(n, 0, 5) > n <-rnorm(n, 2, 3) Oops! n is now a vector of length 2000. [...snip...]

Re: [R] The "--slave" option

2019-09-18 Thread Patrick (Malone Quantitative)
For what it's worth, this is an ongoing conversation in computer science and engineering. And has been so for decades. Not R, but related to this it's only in the past few months that a fork of the photo-manipulation software GIMP (slur for handicapped) renames it (GLIMPSE). Note, I am not

[R] The "--slave" option

2019-09-18 Thread Benjamin Lang
Dear R project, I have a very simple question: How, in late 2019, is there an option called "--slave" to "make R run as quietly as possible"? Let me reiterate that it is 2019, i.e. "The Future", rather than 1970 when R was presumably developed, based on its atrocious syntax, documentation and

Re: [R] Not the same length

2019-09-18 Thread Ana PGG
Dear Varin Sacha, My guess to try to help you is the following: I think you may want to change this: y_obs <- rnorm(n*0.9, y_model, 0.1) + rnorm(n*0.1, y_model, 0.5) for: y_obs <- c( rnorm(n*0.9, y_model, 0.1), rnorm(n*0.1, y_model, 0.5) ) then y_obs: > length(y_obs) [1] 2000 De: varin

Re: [R] Not the same length

2019-09-18 Thread peter dalgaard
Redefining n is probably not a good idea... [...snip...] > m <-runif(n, 0, 5) > n <-rnorm(n, 2, 3) Oops! n is now a vector of length 2000. [...snip...] > y_obs <- y_model +c( rnorm(n*0.97, 0, 0.1), rnorm(n*0.03, 0, 0.5) ) now length(n*0.97) == 2000 > 1, so rnorm(n*0.97, ...) gets you a

Re: [R] Not the same length

2019-09-18 Thread varin sacha via R-help
Dear Peter Dalgaard, Really appreciated, but my code does not work. There is still a problem ! Here below the reproducible example with 20 variables library(mgcv) library(earth) n<-2000 x<-runif(n, 0, 5) z <- rnorm(n, 2, 3) a <- runif(n, 0, 5) b <- rnorm(n, 2, 3) c <- runif(n, 0, 5) d

Re: [R] Help needed with eval parse

2019-09-18 Thread Huzefa Khalil
That worked! Thanks for the explanation. On Wed, Sep 18, 2019 at 10:06 AM Duncan Murdoch wrote: > > On 18/09/2019 8:43 a.m., Huzefa Khalil wrote: > > Hello R-users, > > > > I have been running a script which produces objects based on the > > column names of a data.frame. The column names are of

Re: [R] Help needed with eval parse

2019-09-18 Thread Duncan Murdoch
On 18/09/2019 8:43 a.m., Huzefa Khalil wrote: Hello R-users, I have been running a script which produces objects based on the column names of a data.frame. The column names are of the form CB_1-1, CB_1-2, etc. Now this calculation was rather long and memory intensive, so I would rather not have

[R] Help needed with eval parse

2019-09-18 Thread Huzefa Khalil
Hello R-users, I have been running a script which produces objects based on the column names of a data.frame. The column names are of the form CB_1-1, CB_1-2, etc. Now this calculation was rather long and memory intensive, so I would rather not have to do it again after fixing the column names

Re: [R] regex

2019-09-18 Thread Richard O'Keefe
A little note on quoting in regular expressions. I find writing \\. when I want a quoted . somewhat confusing, so I would use the pattern "_w_.*[.]csv$". Better still, if you want to match file names, there is a function glob2rx that converts shell ("glob") patterns into regular expression

Re: [R] How to use breaks argument in hist() function correctly?

2019-09-18 Thread Stephen Ellison
> When I had breaks = 18, I get total number of cells as 16, which is > same when I put breaks = 20 > > In the 2nd case I was expecting total number of cells (i.e. bars) as > 20 i.e. if I understand the documentation correctly I should expect > total number of cells (bars) should be same as breaks

Re: [R] How to use breaks argument in hist() function correctly?

2019-09-18 Thread Jim Lemon
Hi Cristofer, If you just ask for a number of breaks, you will get what "hist" thinks you should. Try this or something similar: hist(x,breaks=seq(min(x),max(x),length.out=21)) Jim On Wed, Sep 18, 2019 at 8:55 PM Christofer Bogaso wrote: > > Hi, > > I have a numerical vector as below > > x =

[R] How to use breaks argument in hist() function correctly?

2019-09-18 Thread Christofer Bogaso
Hi, I have a numerical vector as below x = c(92958.2014593977, -379826.025677203, 881937.411562002, 25761.5278163719, -11837.158273897, 48450.8089746788, -415505.62910869, -168462.98512054, 328504.255373387, -298966.051027528, 237133.794811816, -49610.1148173768, -92459.1170329526,

Re: [R] Not the same length

2019-09-18 Thread peter dalgaard
Um, I think not... The mean of the last 200 observation won't line up with the x and z. Possibly, if what you want is the last 200 obs to have a different variance, y_obs <- y_model + c(rnorm(0.9 * n, 0, 0.1), rnorm(0.1 * n, 0, 0.5)) or y_obs <- rnorm(n, y_model, rep(c(0.1, 0.5), c(.9 * n,

Re: [R] R wrong, Python rigth in calcution

2019-09-18 Thread Richard O'Keefe
Here's a tip for the original poster. > ?numeric and then follow the link it suggests > ?double which says amongst other things All R platforms are required to work with values conforming to the IEC 60559 (also known as IEEE 754) standard. This basically works with a precision of