我可以通过以下方式轻松地将空行添加到数据框:
if(nrow(df)==0){ df[nrow(df)+1,] <- NA }
我怎样才能对 data.table 做同样的事情?
r dataframe data.table
data.table ×1
dataframe ×1
r ×1