0

I created a data frame using read.csv(file , header=FALSE)

My first column has been given an incorrect factor ordering. when i execute data$V1 the order is correct but the levels are not?

Executing c(data$V1) reveals the order is not correct, how can I independently reorder these levels and keep the values in the same location.

Outputs below

> data$V1
[1] 0              < 1 in 100000  < 1 in 10000   < 1 in 1000    < 1 in 100     < 1 in 10      > 1 in 10     
Levels: < 1 in 10  < 1 in 100  < 1 in 1000  < 1 in 10000  < 1 in 100000  > 1 in 10  0 
> c(data$V1)
[1] 7 5 4 3 2 1 6
user3234810
  • 482
  • 2
  • 5
  • 18

0 Answers0