r - Print colnames with spaces -


df = readrds('mydata.rds') message('column names: ',colnames(df)) 

output

column names: col1col2col2col4 

how can print spaces like

column names: col1 col2 col3 col4 

you can use paste(). used mtcars data set , added line-break.

message(     "now have following columns: ",     paste(colnames(mtcars), collapse = " "),      "\nand following rows: ",      nrow(mtcars) ) # have following columns: mpg cyl disp hp drat wt qsec vs gear carb # , following rows: 32 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -