Let's say I have an array
arr = as.array(c(1.1,0.5,3.2,4.3,5.5,6.3,0.4))
I want to convert this into a data frame so I try:
df = as.data.frame(arr)
But this gives me a data frame with nrows = 7 and ncols = 1. I need a data frame with nrows = 1 and ncols = 7. I have tried doing t(df)
but that would return a matrix.
I know there has to be a simple way to do this... thank you!