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

java - Sql binding in Spring throws org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException -

apache - Cloudflare bug random 302 redirections -