-1

I am new to R and reading 19 variables (Import_1 to Import_19) from a CSV file x <- (as.data.frame(final_data[,c(15:33)]))

When I summarized one variable I got following display (possibly character variable)

Import_1  
 EXTREMELY IMPORTANT-10:177  
 09                    :176  
 08                    : 89  
 07                    : 45  
 06                    : 15  
 05                    :  6  
 04                    :  3
 03                    :  3
 02                    :  3

 NOT AT ALL IMPORTANT-01 : 2 

Now I need to convert these 19 variables into numeric 1-10 values, so that I can do regression. Let me know how can I do that.

Mekki MacAulay
  • 1,727
  • 2
  • 12
  • 23
  • Hello @Rajesh and welcome to the R tag on Stack Overflow. It is generally considered good practice to provide the code that you have attempted so far along with the desired output to help people help you. Please see: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610 for details on how to write a great R question. – Mekki MacAulay Apr 10 '16 at 15:11

1 Answers1

1

You can convert variables to numeric using the functions as.numeric, as.double, as.integer. See this Introduction to R DataTypes to get you started.

Mekki MacAulay
  • 1,727
  • 2
  • 12
  • 23
  • 1
    Normally I'd say to add more to this answer, but it's pretty obvious that the OP put in zero effort on his part. So +1! – Rich Scriven Apr 10 '16 at 15:26