I'm trying to specify the data types for each column and name them. So basically I'm trying to create a data frame without any rows.
I have tried doing something like this:
data <- data.frame(Date=as.Date("02/02/2001", format="%m/%d/%Y"),
File="", User="", stringsAsFactors=FALSE)
data <- data[-1,]
The above code creates a data frame with a single row containing all the data types and the column names, but this also creates a useless row which needs ti be removed.
Is there any better way to implement this?