Create an empty data.frame

前端 未结 17 1070
猫巷女王i
猫巷女王i 2020-11-22 16:06

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

17条回答
  •  春和景丽
    2020-11-22 16:19

    If you are looking for shortness :

    read.csv(text="col1,col2")
    

    so you don't need to specify the column names separately. You get the default column type logical until you fill the data frame.

提交回复
热议问题