To select a specific column, you can also type in the name of the dataframe, followed by a $, and then the name of the column you are looking to select. In this example, we will be selecting the payment column of the dataframe. When running this script, R will simplify the result ...
2、双括号 [[ ]] 用来提取list或者dataframe中的元素,仅可以用来提取一个单个元素 返回的对象并不一定和原list或者dataframe类型相同 3、美元符号 $ 提取list或者dataframe中的某个元素,需要有名字 返回的对象和[[ ]]一样,类型很可能和原来不同 #example, creat a list name "x" > x <- list(foo = 1:4...
[R-sig-Geo] subsetting SpatialGridDataFrame M Ruser 被引量: 0发表: 0年 The mesothermal gold-lamprophyre association: significance for an accretionary geodynamic setting, supercontinent cycles, and metallogenic processes Archean shoshonitic lamprophyres are cotemporal and cospatial with gold ...
subset(cash, company == "A") Powered By company cash_flow year 1 A 1000 1 2 A 4000 3 3 A 550 4 Powered By Rappelez-vous : Le premier argument que vous transmettez à subset() est le nom de votre DataFrame, cash. Notez que vous ne devez pas mettre company entre guillemet...