Hi Reading numeric as factor can have many causes from weird formating to some nonumeric characters. If you can not clean it when making *.csv file you shall either adopt reading function by using different options
see ?read.table or if it does not help, you can either polish your values by some regular expressions. For simple changing factor values to numeric you shall use fb <- as.numeric(as.character(fb)) But all values which are not transferable to numeric will be changed to NA Regards Petr > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Bill > Sent: Sunday, October 27, 2013 10:33 PM > To: r-help@r-project.org > Subject: [R] numeric data being interpreted as a factor -trouble with > reading data into a dataframe in R > > Hello. > trying to do one of the simplest actions -read in data into R. > I don't know why the FBfollowers column is being read as a factor and > also if I use as.numeric on it, it looks really strange and actually > complety alters the data. > I am attaching the data set here called ddd.csv I used > data=read.csv("ddd.csv",header=TRUE) > > fb=data$FBfollowers > fb > fb=as.numeric(fb) > fb > > Thnxs in advance ______________________________________________ R-help@r-project.org 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.