r - Unable to reference an object in a variable within colnames -


i unable reference object contained in variable "symb" within colnames function. example:

symb <- "ibm"  colnames(paste0(symb)) <- c("open","high","low","close","volume","adjusted")  

if understand question correctly, name columns of data frame called ibm, , variable symb character vector contains string "ibm". if so, might try

df <- get(symb) colnames(df) <- c("open","high","low","close","volume","adjusted") assign(symb, df) 

Comments

Popular posts from this blog

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -