Re: [R] Find the max entry in column 2 - that satisfies a condition given a fixed entry in column 1

2019-06-21 Thread Rui Barradas
Hello, Thinking again, if all you want is vector b the following function fun2 will do it without having to create plain. Less memory and (much) faster. fun2 <- function(X, val){ u <- sort(unique(X)) n <- length(u) b <- numeric(n^2) b[n*(n - 1) + match(val, u)] <- u[n] b }

[R] Problem with random numbers/seed

2019-06-21 Thread Steven Yen
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 >

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Uwe Ligges
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

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Uwe Ligges
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

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Uwe Ligges
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

Re: [R] Regarding R doubt

2019-06-21 Thread shr...@outlook.com
Thank you so much for the help ! Sent from Mail for Windows 10 From: Richard O'Keefe Sent: Thursday, June 20, 2019 10:41:49 AM To: shr...@outlook.com Cc: r-help@r-project.org Subject: Re: [R] Regarding R doubt And

Re: [R] Regarding R doubt

2019-06-21 Thread shr...@outlook.com
library(ltm) library(psych) setwd("C:/Users/Admin/Desktop/IRT_CatSim") irtdat<-read.csv("Fresh_r_2pl.csv",header=F) head(irtdat) PL2.rasch<-ltm(irtdat~z1) summary(PL2.rasch) plot(PL2.rasch,type=c("ICC")) plot(PL2.rasch,type=c("IIC")) Above is the code,When I run summary(PL2.rasch) I will get

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Steven Yen
Now I see that results were replicated but running RNGversion I get a warning message. Isn't there a way to do this clean? > 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

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Steven Yen
Unhappy but thanks. Steven On 6/22/2019 1:13 AM, Uwe Ligges wrote: > > > 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

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Steven Yen
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, >>

Re: [R] [External] Re: Problem with random numbers/seed

2019-06-21 Thread Tierney, Luke
Maybe looking at ?suppressWarnings will make you feel better. Best, luke On Fri, 21 Jun 2019, Steven Yen wrote: > Unhappy but thanks. > Steven > > On 6/22/2019 1:13 AM, Uwe Ligges wrote: >> >> >> On 21.06.2019 19:09, Steven Yen wrote: >>> Now I see that results were replicated but running

Re: [R] How to filter data in R based on first column ID

2019-06-21 Thread Rui Barradas
Hello, Please don't post in HTML like the posting guide asks you to, the data is unreadable. Not tested: i <- data[[1]] %in% ID.list data[i, ] That's it. Hope this helps, Rui Barradas Às 21:09 de 21/06/19, Yogesh Gupta escreveu: Hi, I do need to filter data based on first column could

[R] Recovering former projects on R

2019-06-21 Thread Spencer Brackett
Good evening, I am revisiting a project I had saved to R studio and after working with it for a little, with loaded data and environments shown just as I left them when I stopped working on the project, my console and the tabs opened went blank. I believe I accidentally activated q() and quit

[R] Problem witth nnet:multinom

2019-06-21 Thread Tom Woolman
I am using R with the nnet package to perform a multinomial logistic regression on a training dataset with ~5800 training dataset records and 45 predictor variables in that training data. Predictor variables were chosen as a subset of all ~120 available variables based on PCA analysis. My

[R] How to filter data in R based on first column ID

2019-06-21 Thread Yogesh Gupta
Hi, I do need to filter data based on first column could you please suggest , How I can do it in R. head(data) Root-1.S35.L001 Root-10.S75.L001 Root-13.S5.L001 Root-14.S16.L001 Root-17.S26.L001 719e20e1e3d19fbc5dd50844c6d29a8f 0.049304262 0 0 0 0.033765858

Re: [R] Recovering former projects on R

2019-06-21 Thread William Dunlap via R-help
You should ask someone at RStudio about this, but *.Rproj files are not something R itself knows about. load() reads files made by save(), which usually have the extension ".Rdata" or ".rda". Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Jun 21, 2019 at 1:43 PM Spencer Brackett <

Re: [R] Recovering former projects on R

2019-06-21 Thread Spencer Brackett
Thank you, I called them but was able to load what appears to be a reprex of my Rhistory. If I remember correctly, there is a way to to reimplement this history into your console so to regenerate previous work. How is this done? Best, Spencer On Fri, Jun 21, 2019 at 4:51 PM William Dunlap

Re: [R] Problem with random numbers/seed

2019-06-21 Thread Rolf Turner
On 22/06/19 5:21 AM, Steven Yen wrote: Unhappy but thanks. Steven Well, if you're *really* unhappy (???) you could always do suppressWarnings(RNGversion("3.5.3")) Does that make you happier? cheers, Rolf On 6/22/2019 1:13 AM, Uwe Ligges wrote: On 21.06.2019 19:09, Steven Yen

Re: [R] Recovering former projects on R

2019-06-21 Thread David Winsemius
On 6/21/19 2:34 PM, Spencer Brackett wrote: Thank you, I called them but was able to load what appears to be a reprex of my Rhistory. If I remember correctly, there is a way to to reimplement this history into your console so to regenerate previous work. How is this done? Assuming you still

Re: [R] How to filter data in R based on first column ID

2019-06-21 Thread Jeff Newmiller
Open the "Introduction to R" document that comes with R and search for "subset". Oh, and read the Posting Guide mentioned in the footer of this and every message on the list for advice on communicating successfully on the R mailing lists. One problem with your post was that it was sent with

Re: [R] Problem with reading file saved in directory

2019-06-21 Thread Jeff Newmiller
My psychic powers are telling me you don't know what is in that file. Perhaps you should look, with an eye toward counting the number of fields on each line and on having properly-quoted fields. My psychic powers are not strong enough to tell you what problems you will find in that file. On

Re: [R] Problem with reading file saved in directory

2019-06-21 Thread William Dunlap via R-help
Reading the file with row.names=1 meant to make rownames out of the first column in the text file. Duplicate row names are not accepted. To diagnose, read it with row.names=NULL and see what is in the first column (e.g., use the table function on it). Bill Dunlap TIBCO Software wdunlap

[R] Problem with reading file saved in directory

2019-06-21 Thread Spencer Brackett
Good evening, I set up a working directory to read the indicated desktop file, but implementation of the read.file function produced the following error... >meth = read.table(file = "~/Vakul's GBM code/mapper.txt", sep ="\t", header = T, row.names = 1) Error in read.table(file = "~/Vakul's GBM

Re: [R] Output for pasting multiple vectors

2019-06-21 Thread Jeff Newmiller
Note that just editing in R (or RStudio, or Notepad, or whatever) will not solve the problem... you MUST learn how to use your email client to set the format to send at least your R-help emails in plain text. If you don't do that, the email program will just screw up your hard work. I do think

Re: [R] Problem with reading file saved in directory

2019-06-21 Thread Spencer Brackett
Thank you Mr. Dunlap, that was very helpful! On Fri, Jun 21, 2019 at 8:01 PM William Dunlap wrote: > Reading the file with row.names=1 meant to make rownames out of the first > column in the text file. Duplicate row names are not accepted. To > diagnose, read it with row.names=NULL and see

[R] Output for pasting multiple vectors

2019-06-21 Thread Spencer Brackett
Hello, I am attempting to paste multiple vectors using the paste() function for a dataset that I'm working with. Shouldn't I be receiving some kind of output as a result of the following? meth=as.matrix(meth) > colnames(meth) = sapply(colnames(meth), function(i){ + c1 = strsplit(i,split ='.',

Re: [R] Output for pasting multiple vectors

2019-06-21 Thread David Winsemius
All the +-signs are telling you that the expression is not complete. Please read the posting guide. I’m pretty sure you’ve already been warned NOT to use html. — David. Sent from my iPhone > On Jun 21, 2019, at 6:11 PM, Spencer Brackett > wrote: > > Hello, > > I am attempting to paste

Re: [R] Output for pasting multiple vectors

2019-06-21 Thread Spencer Brackett
My apologies. Is there a way to edit this within R? On Fri, Jun 21, 2019 at 9:47 PM David Winsemius wrote: > All the +-signs are telling you that the expression is not complete. > Please read the posting guide. I’m pretty sure you’ve already been warned > NOT to use html. > > — > David. > >

Re: [R] Output for pasting multiple vectors

2019-06-21 Thread Spencer Brackett
Would output <-paste() be part of the solution perhaps? Reading up on the matter now. Best, Spencer On Fri, Jun 21, 2019 at 9:11 PM Spencer Brackett < spbracket...@saintjosephhs.com> wrote: > Hello, > > I am attempting to paste multiple vectors using the paste() function for a > dataset that

Re: [R] Output for pasting multiple vectors

2019-06-21 Thread David Winsemius
Sent from my iPhone > On Jun 21, 2019, at 6:48 PM, Spencer Brackett > wrote: > > My apologies. Is there a way to edit this within R? Most people use an editor or an IDE to work on their code. The code you presented didn’t seem be doing what you were describing. You should put together a