0
鬆動rownames我有以下的數據幀(rmse1):刪除從數據幀的行沒有中的R
> rmse1
matrix..
1 NA
sGARCH - norm 0.0004717566
eGARCH - norm 0.0004522429
apARCH - norm 0.0004640376
sGARCH - std 0.0004173882
eGARCH - std 0.0004546693
apARCH - std 0.0004132033
sGARCH - ged 0.0004359045
eGARCH - ged 0.0004483274
apARCH - ged 0.0004247326
或dput格式:
> dput(rmse1)
structure(list(matrix.. = c(NA, 0.0004717565532856, 0.000452242891965358,
0.000464037577947331, 0.000417388230016878, 0.000454669306307564,
0.00041320327280016, 0.00043590445999408, 0.00044832739721304,
0.000424732596935747)), .Names = "matrix..", row.names = c("1",
"sGARCH - norm", "eGARCH - norm", "apARCH - norm", "sGARCH - std",
"eGARCH - std", "apARCH - std", "sGARCH - ged", "eGARCH - ged",
"apARCH - ged"), class = "data.frame")
第一行是不想要的行(其中rowname爲1 :)
所以要刪除它,我鍵入下面的代碼:
rmse1<-rmse1[-1,]
然而,這一次我失去了數據幀的rownames:
> rmse1
[1] 0.0004717566 0.0004522429 0.0004640376 0.0004173882 0.0004546693 0.0004132033 0.0004359045 0.0004483274 0.0004247326
如何刪除第一行沒有鬆動的rownames。
我會很樂意提供任何幫助。非常感謝。
非常感謝@bouncyball – oercim