Re: [R] question regarding is.factor()
See ?class -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 13/08/07, Jabez Wilson <[EMAIL PROTECTED]> wrote: > > Dear all, please help with what must be a straightforward question which I > can't answer. > > I add a column of my dataframe as factor of an existing column e.g. > > df[,5] <- factor(df[,2]) > > and can test that it is by is.factor() > > but if I did not know in advance what "types" the columns were, is there > a function to tell me what they are. > > i.e. instead of is.factor(), is.matrix(), is.list(), a function more > like what.is() > > > > > > - > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] question regarding is.factor()
typeof() for 'types'. However, "factor" is not a type but a class, so class() is probably what you want. On Mon, 13 Aug 2007, Jabez Wilson wrote: > Dear all, please help with what must be a straightforward question which > I can't answer. But 'An Introduction to R' could. > I add a column of my dataframe as factor of an existing column e.g. > > df[,5] <- factor(df[,2]) > > and can test that it is by is.factor() > > but if I did not know in advance what "types" the columns were, is > there a function to tell me what they are. > > i.e. instead of is.factor(), is.matrix(), is.list(), a function more > like what.is() > > > - > > [[alternative HTML version deleted]] > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] question regarding is.factor()
Dear all, please help with what must be a straightforward question which I can't answer. I add a column of my dataframe as factor of an existing column e.g. df[,5] <- factor(df[,2]) and can test that it is by is.factor() but if I did not know in advance what "types" the columns were, is there a function to tell me what they are. i.e. instead of is.factor(), is.matrix(), is.list(), a function more like what.is() - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.