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
Post a Comment