从一组获得特定记录我有以下的DF pid name plan type...
1 v a 10
1 s a 20
1 v b 10
2 s c 20
2 v c 10
3 s a 10
3 v a 20...
和另一DF2,它具有的ID从第一DF和记录位置从采取DF pid position
1 1
2 2
3 2
因此,这意味着对于PID 1,1记录已被选中,为PID
我需要基于一个过滤器操作我需要应用该组 DF id dg cs
1 s 1
1 v 0
2 s 0
2 v 1
2 s 1
2 s 0
3 s 1
3 s 1
3 v 1
一组数的记录数的记录数我需要在“dg”中的“v”之前统计(或标记)'dg-cs'字段中出现's-1'组合的记录数。 因此,出认沽将 id dg cs output
1 s 1 True
1 v 0 Fa
嗨失踪我想使用的R滤光器与选定的COUNTRYCODE过滤所有的行,并与continuous year from 1950 to 2014数据就像 countrycode country currency_unit year rgdpe rgdpo pop emp avh
1 USA United States US Dollar 1950 2279787 2274197 155.
我正在使用R与Jupyter笔记本。我使用这两个文件中的dplyr创建了两个数据帧:CSV files 为了准备数据,我从“自行车”文件中删除了列,并将日期字符串格式化为日期时间。 # drop colums that contain only one value
bikes <- select(bikes,-c(contract_name, bonus,banking))
# convert