Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 211004

turning a character vector into a single row dataframe in R

$
0
0

I have a vector that I want to turn into a single row dataframe, this code works:

vec <- c("a","b","c","d","e") 
df<- as.data.frame(t(as.data.frame(vec)))

but is so clunky, does anyone have a more elegant (and preferably less computationally expensive) solution


Viewing all articles
Browse latest Browse all 211004

Latest Images

Trending Articles



Latest Images