R: loop through data frame extracting subset of data depending on date

后端 未结 5 1670
被撕碎了的回忆
被撕碎了的回忆 2021-02-06 14:29

I have a large data frame that consists of data that looks something like this:

        date    w    x    y    z    region
1    2012 01    21   43   12    3   NO         


        
5条回答
  •  情深已故
    2021-02-06 14:47

    Loop through each unique date and build the subset.

    uniq <- unique(unlist(data$Date))
    for (i in 1:length(uniq)){
        data_1 <- subset(data, date == uniq[i])
        #your desired function
    }
    

提交回复
热议问题