Write a R program to create an empty data frame.
df = data.frame(Ints=integer(), Doubles=double(), Characters=character(), Logicals=logical(), Factors=factor(), stringsAsFactors=FALSE) print("Structure of the empty dataframe:") print(str(df))
Sample Output:
[1] "Structure of the empty dataframe:" 'data.frame': 0 obs. of 5 variables: $ Ints : int $ Doubles : num $ Characters: chr $ Logicals : logi $ Factors : Factor w/ 0 levels: NULL
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer