data cleaning - Issue in For loop in R -


i new for loops in r. writing code this:

attr <- names(training_data)     attach(training_data) for(i in 1:500) {   temp_var = attr[i] } 

the value of attr[1] abcd.

when try displaying values of temp_var should abcd, getting "abcd". quotes:

> print(attr[1]) "abcd"  

how can below (without quotes):

> print(attr[1]) abcd  

basically, want pass attribute names of table in run time , assign values of vector temp variable. how can achieve this?

since char data type, getting "" around data.


Comments

Popular posts from this blog

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

Android SDK Manager freezes after installation of OSX 10.11 El Capitan public Beta -