Re: [R] convert numeric variables to factor

2018-04-10 Thread Saif Tauheed
I run this command for converting the numerical variable into factor. However, I get the following error message. > cols<- c(“GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL" > "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", "MASSMEDIA_M", > "HomeComputer", "HomeInternet")

Re: [R] convert numeric variables to factor

2018-04-10 Thread Eric Berger
You are missing a comma between "MARITAL" and "JOBSTATUS". On Tue, Apr 10, 2018 at 10:27 AM, Saif Tauheed wrote: > I run this command for converting the numerical variable into factor. > However, I get the following error message. > > > cols<- c(“GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE

Re: [R] convert numeric variables to factor

2018-04-10 Thread Saif Tauheed
Thank you very much. After that I have the following error: cols<- c("GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL", "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", "MASSMEDIA_M", "HomeComputer", "HomeInternet") > for (I in cols) {data.frame[,i]= as.factor(data.frame[,i

Re: [R] Question about subset

2018-04-10 Thread Sebastien Bihorel
Thanks. That works great! > df <- data.frame(x=c(1,1,NA,NA,2), y=c('a','a','a','b','b'), > z=c(TRUE,FALSE,TRUE,FALSE,TRUE)) > cond1 <- 'x==1' > cond2 <- 'x==1 & z' > df x y z 1 1 a TRUE 2 1 a FALSE 3 NA a TRUE 4 NA b FALSE 5 2 b TRUE > subset(df, subset = ifelse(is.na(eval(parse(te

Re: [R] Question about subset

2018-04-10 Thread Sebastien Bihorel
Thanks. S. Elison provided a similar but apparently more general solution (see other post in thread). - Original Message - From: "David Winsemius" To: "Sebastien Bihorel" Cc: r-help@r-project.org Sent: Monday, April 9, 2018 12:33:41 AM Subject: Re: [R] Question about subset Sent fro

Re: [R] convert numeric variables to factor

2018-04-10 Thread Michael Dewey
Not sure whether this is the problem but calling your data frame data.frame is not a good idea. On 10/04/2018 11:48, Saif Tauheed wrote: Thank you very much. After that I have the following error: cols<- c("GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL", "JOBSTATUS", "ENG", "ED

Re: [R] convert numeric variables to factor

2018-04-10 Thread S Ellison
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Saif Tauheed > After that I have the following error: > > cols<- c("GrMM", "RELG", "CASTE1", "SECTOR", "SECTOR4","AGE", "MARITAL", > "JOBSTATUS", "ENG", "EDU", "PARENT_EDU", "MASSMEDIA_F", > "MASSMEDIA_M", "HomeComputer", "HomeInter

[R] Spectral analisys for for R version 3.4.3

2018-04-10 Thread Danniel Lafeta Machado
Dear all, Is there any spectral analisys functionality available for R version 3.4.3? Series() functionality doesn't work in this version. Regards Danniel [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSC

Re: [R] convert numeric variables to factor

2018-04-10 Thread PIKAL Petr
Hi You could instead of selecting columns by name select them by number Something like your.data[,2:3] <- do.call(data.frame, lapply(your.data[,2:3], factor)) or you could construct a vector of column numbers x <- c(2,3) Cheers Petr -Original Message- From: R-help [mailto:r-help-boun.

Re: [R] Spectral analisys for for R version 3.4.3

2018-04-10 Thread Jeff Newmiller
Please provide a reproducible example of the problem, with sample data. Notes: 1) The Posting Guide points out that this is a plain text mailing list, but does not emphasize how damaged your sent email may be if you fail to set your email program to plain text mode. 2) Technically, 3.4.3 is not

Re: [R] Spectral analisys for for R version 3.4.3

2018-04-10 Thread William Dunlap via R-help
stats::spectrum for starters. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Apr 10, 2018 at 5:49 AM, Danniel Lafeta Machado < danniel.laf...@bcb.gov.br> wrote: > Dear all, > Is there any spectral analisys functionality available for R version 3.4.3? > Series() functionality doesn't work i

Re: [R] Test if data uniformly distributed (newbie)

2018-04-10 Thread Huber, Florian
Dear Mr. Savicky, I am currently working on a project where I want to test a random number generator, which is supposed to create 10.000 continuously uniformly distributed random numbers between 0 and 1. I am now wondering if I can use the Chi-Squared-Test to solve this problem or if the Kolmog