[R] is.numeric () FALSE
Jim Lemon
jim at bitwrit.com.au
Wed May 8 07:08:48 CEST 2013
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
More information about the R-help
mailing list