syrvn wrote:
Thanks again for your quick reply.
I understood your procedure but now it is even more strange why my
conversion does not work.
In your example, the NA values are in "brackets" and what your
procedure does is to
convert these values into NA and then it seems to be possible to us
Thanks again for your quick reply.
I understood your procedure but now it is even more strange why my
conversion does not work.
In your example, the NA values are in "brackets" and what your
procedure does is to
convert these values into NA and then it seems to be possible to use
data.matrix to
More importantly than just that they are factors, NA is actually a
level of X3. If it was a factor column, but NA was not a level, than
in the conversion to numeric, it would not change into a 4, but it is
a level (in fact the 4th level), so it becomes a 4. From ?factor here
is the recommended wa
Hi,
I used str() on my data set:
$ X1: num 1 1 0 1 1 1 1 1 1 1 ...
$ X2: num 0 1 0 2 1 2 0 2 2 0 ...
$ X3: Factor w/ 4 levels "0","1","2","NA": 2 1 3 1 1 1 1 1 1 3
...
The difference to your str() output is that in your case NA columns are
"num" colum
Hi,
Can you show the results of str() on your original dataframe? Also it
would help if you could make an example that demonstrates your
problem. I used this little example, and did not notice any problems:
samp.frame <- data.frame(a = 1:10, b = c(3,2,5,3,1,5,NA,4,5,NA))
str(samp.frame)
samp.ma
Hi list,
I tried to convert a data.frame into a matrix using data.matrix.
Unfortunately my matrix contains missing values (NA) wherefore all columns
including NA's were changed into factors.
I thought that many people stumbled across that problem already wherefore
there must be a
simple solution
6 matches
Mail list logo