m******t 发帖数: 273 | 1 【 以下文字转载自 Quant 讨论区 】
发信人: myregmit (myregmit), 信区: Quant
标 题: load data to a dictionary in R
发信站: BBS 未名空间站 (Sun Mar 16 20:45:51 2014, 美东)
I need to load data from a .csv file and then save it in a dictionary in R.
The data format:
country,region,value
Each row may have different country and region.
I need to save the value with the same country and region together.
Any help would be appreciated. | x****B 发帖数: 103 | 2 很愿意帮助。看起来好像很简单
能不能贴几行数据。 | m******t 发帖数: 273 | 3 The data format:
country,region,value
1 , north , 101
1 , north , 219
2 , south , 308
2 , south , 862
... , ... , ...
This may have the thousands of lines that need to be read from .csv file.
My expected results that can be save in a data structure of R :
country , region, list of values
1 north 101 , 219
2 south 308 , 862
So that I can get the values that are associated with the same country and
region.
Thanks !
【在 x****B 的大作中提到】 : 很愿意帮助。看起来好像很简单 : 能不能贴几行数据。
|
|