I have a variable in R that looks like so
> q
[1] 0.4231
Levels: 0.4231
I want to get rid of that crazy levels thing. I just want the value. How do I do this. I tried
> as.numeric(q)
[1] 1
Which doesn't work.
For example, I want to do some simple arithmetic, such as q+1
, which I currently cannot do
> q+1
[1] NA
Warning message:
In Ops.factor(q, 1) : + not meaningful for factors