I\'m trying to initialize a data.frame without any rows. Basically, I want to specify the data types for each column and name them, but not have any rows created as a result
I keep this function handy for whenever I need it, and change the column names and classes to suit the use case:
make_df <- function() { data.frame(name=character(),
profile=character(),
sector=character(),
type=character(),
year_range=character(),
link=character(),
stringsAsFactors = F)
}
make_df()
[1] name profile sector type year_range link
<0 rows> (or 0-length row.names)