Hi all, I'm trying to load a csv file in which all the variables must be of type number.The object is a dataframe.When i load the file what i get is a dataframe in wich the variables are of type factor.How can I get variables of type number??? Thanks all
Hi r-help-bounces at r-project.org napsal dne 19.04.2010 10:12:59:> Hi all, > I'm trying to load a csv file in which all the variables must be of type> number.The object is a dataframe.When i load the file what i get is adataframe You probably have non numeric data in your original CSV. Either you can correct it before reading it or you could try to force colClasses parameter of read.*whatever* you use and failed to tell. Another option is to remove nonumeric items and change factors to numeric see ?as.numeric and ?as.character Regards Petr> in wich the variables are of type factor.How can I get variables of type> number??? > Thanks all > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f -- View this message in context: http://n4.nabble.com/dataframe-tp2015650p2016230.html Sent from the R help mailing list archive at Nabble.com.
Dear list I have a question, I would like to get the following results but I dont know how to do it: I have a dataframe like this: NC8 PROD X 1 X2 1423 P1 342 10 1564 G5 56 20 123 G5 3 4 1568 H2 6 10 7864 H2 5 72 5693 P3 7 43 What I would like to do is the sum of the X1 and X2 variables by PROD, namely getting another dataframe which looks like the following NC8 PROD X 1 X2 1423 P1 342 10 1564 G5 59 24 123 G5 59 24 1568 H2 11 82 7864 H2 11 82 5693 P3 7 43 In Sas I know a function called proc means that can do it. How can I do this in R???
Dear list, I have a question about the selection of Variables in dataframes. I have a dataframes like this: CFISCA FIRMS YEAR VAR VALUE 20345 nike 2005 EC01 34 20345 nike 2006 EC01 45 56779 mediaset 2005 EC01 65 64568 agazzini 2005 EC01 78 64568 agazzini 2006 EC01 56 78907 uniteam 2006 EC01 46 what my result should be is a new dataframes which have only firms which have data in both years (2005,2006) CFISCA FIRMS YEAR VAR VALUE 20345 nike 2005 EC01 34 20345 nike 2006 EC01 45 64568 agazzini 2005 EC01 78 64568 agazzini 2006 EC01 56 Thanks for your attention!!!
Dear list,>I have a question about the selection of Variables in dataframes. >I have a dataframes like this: > >CFISCA FIRMS YEAR VAR VALUE >20345 nike 2005 EC01 34 >20345 nike 2006 EC01 45 >56779 mediaset 2005 EC01 65 >64568 agazzini 2005 EC01 78 >64568 agazzini 2006 EC01 56 >78907 uniteam 2006 EC01 46 > > >what my result should be is a new dataframes which have only firms which have >data in both years (2005,2006) > >CFISCA FIRMS YEAR VAR VALUE >20345 nike 2005 EC01 34 >20345 nike 2006 EC01 45 >64568 agazzini 2005 EC01 78 >64568 agazzini 2006 EC01 56 > > >Thanks for your attention!!![[alternative HTML version deleted]]