我想以groupBy的方式将数据帧拆分为数据帧列表。我目前有以下代码:
from Spotfire.Dxp.Data import CalculatedColumn
cols = Document.Data.Tables["TIBER"].Columns
cols.AddCalculatedColumn("NEWCOLUMN","[oldcolumn] * 3.289");
然而,这给了我一份清单。
infrastructure_by_day <- read.csv("allInfrastructure.csv")
countries <- levels(infrastructure_by_day$country)
categories <- levels(infrastructure_by_day$category)
segregate <- function(country, category) {
infrastructure_by_day[
which(infrastructure_by_day$country == country &
infrastructure_by_day$category == category), ]
}
infrastructure_data_frames <- mapply(segregate, countries, categories)
如何获取数据框列表?