2013-05-01 37 views
2

我是新來的R鍵訪問欄,我需要對我爲什麼不能訪問我的數據幀正確爲什麼我不能在我的數據幀

> str(new_df) 
List of 1 <~~~~ SEE THIS LINE (note to OP, sorry for commenting on the question - RS) 
$ :'data.frame': 16 obs. of 2 variables: 
    ..$ x: num [1:16] 2002 2003 2004 2005 2006 ... 
    ..$ y: num [1:16] 457320 431640 412090 389090 396020 ... 
> new_df$x 
NULL 

回答

4

使用is(new_df)一些幫助,你會看到它是一個data.frame的列表。在這種情況下,您將不得不使用new_df[[1]]來訪問data.frame列表的第一個元素。

+2

....即。 'new_df [[1]] $ x'。 – joran 2013-05-01 16:34:28

相關問題