Hi there, I am reading into R a dataset with 30 variables. It is in csv file format but have also tried txt. While my dataset loads without warning, when I tried to use Geomorph package (my dataset is from a 3D model) I get a warning that is.atomic(x) is not true. I understand this is a broad problem with my dataset now being read as numbers. Thus, is.numeric comes back FALSE. How do I fix this problem so my numeric dataset is read as numeric? Cheers -- View this message in context: http://r.789695.n4.nabble.com/is-numeric-FALSE-tp4666530.html Sent from the R help mailing list archive at Nabble.com.
On May 7, 2013, at 8:38 PM, Alannah wrote (from Nabble):> Hi there, I am reading into R a dataset with 30 variables. It is in csv file > format but have also tried txt. While my dataset loads without warning, when > I tried to use Geomorph package (my dataset is from a 3D model) I get a > warning that is.atomic(x) is not true. I understand this is a broad problem > with my dataset now being read as numbers. Thus, is.numeric comes back > FALSE. > > How do I fix this problem so my numeric dataset is read as numeric?You post the code you used for input , and a couple of lines of data from the file. Obviously, if "x" is the result from a read operation, it would be a list rather than a numeric-vector. (And in responding please avoid the typical Nabble practice of not including context.) -- David Winsemius Alameda, CA, USA
This is an imponderable question, since we would have to be psychic to know what you are doing wrong without seeing what you are actually doing. I can hypothesize that you are testing whether a data frame is numeric, and can warn you that a data frame will NEVER be numeric. The individual columns may or may not be numeric, but without a sample of your data I am stuck there. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Alannah <alannah.pearson at anu.edu.au> wrote:>Hi there, I am reading into R a dataset with 30 variables. It is in >csv file >format but have also tried txt. While my dataset loads without warning, >when >I tried to use Geomorph package (my dataset is from a 3D model) I get a >warning that is.atomic(x) is not true. I understand this is a broad >problem >with my dataset now being read as numbers. Thus, is.numeric comes back >FALSE. > >How do I fix this problem so my numeric dataset is read as numeric? > >Cheers > > > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/is-numeric-FALSE-tp4666530.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at 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.
On 05/08/2013 01:38 PM, Alannah wrote:> Hi there, I am reading into R a dataset with 30 variables. It is in csv file > format but have also tried txt. While my dataset loads without warning, when > I tried to use Geomorph package (my dataset is from a 3D model) I get a > warning that is.atomic(x) is not true. I understand this is a broad problem > with my dataset now being read as numbers. Thus, is.numeric comes back > FALSE. > > How do I fix this problem so my numeric dataset is read as numeric? >Hi Alannah, The "str" function might be helpful. Say your dataset is named "alannahdat". "str" will tell you what is in the dataset: str(alannahdat) The output is a listing of the components with information about the "class" of each. If you see that one or more components of the dataset are not what you expect, you can then trace them back into your CSV data file to see what is going wrong. Often a single typographic error in a numeric field will cause the entire field to be read as a factor rather than numeric. Jim