Created
October 19, 2022 19:52
-
-
Save aurielfournier/17b3d180b4030ade60d07bd21497cafb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stringr) | |
library(tidyverse) | |
fromdat <- data.frame(site = c("syr1","syr2","syr3"), | |
date1 = c("01/02/22","02/03/2022", "datestuff"), | |
temp1 = c(35), | |
count1 = c(4,5,6), | |
date2 = c("date2stuff"), | |
temp2 =c(37), | |
count2 = c(99,100,101)) | |
numlist <- list() | |
for(i in seq(from=2,to=5, by=3)){ | |
thing <- fromdat[,c(1,i:(i+2))] | |
colnames(thing) <- c("site","date","temp","count") | |
numlist[[i]] <- thing | |
} | |
todat <- do.call(rbind, numlist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment