Create empty data frame with 200 rows and no columns

What about this?

data.frame(row.names = 1:200)

This is what I discovered via dput:

structure(
   list(), 
   .Names = character(0), 
   row.names = c(NA, -200L), 
   class = "data.frame"
 )

This can work (if the call to 2 functions is not considered 2 commands):

data.frame(matrix(, nrow=200, ncol=0))
#data frame with 0 columns and 200 rows

Edit: Another option is data.frame()[1:200, ]:

data.frame()[1:200, ]
# data frame with 0 columns and 200 rows

Tags:

R

Dataframe