PAR_SENS <- read.csv("PAR_FULL YEAR.csv")
attach(PAR_SENS)
#Eliminate 0s
View(PAR_SENS)
PAR_DAY <- filter(PAR_SENS, Calibrated > 0)
View(PAR_DAY)
class(PAR_DAY$Date)
#make R read Date as a date
PAR_DAY$Date <- as.Date(PAR_DAY$Date)
class(PAR_DAY$Date)
#P.ONK AND L.INS CALC EXP JAN 2016
#Sort by Flumes
#New data.frame for each flume for just Jan-Mar 2016
F1 <- filter(PAR_DAY, Flume == 1)
View(F1)
class(F1$Date)
The above is code for some analysis that I am trying to do. I have a column labeled Date
and a column labeled Calibrated
. There are multiple values of Calibrated
per Date
and almost a year's worth of dates. I have filtered out 0's from my data, and made sure that Date
is read by r as a date
. Now I would like to filter out data for Calibrate
by Date
by using data between two dates. I have tried to make variables for each date (D1
and D2
) and using the subset function e.g.:
D1 <- as.Date(F1$Date, 04/01/2016)
D2 <- as.Date(F1$Date, 03/03/2016)
F1_JM <- subset(F1, D1:D1)
However, this returned an error, saying that "In D1:D2 : numerical expression has 6506 elements: only the first used"
. I am unsure of a better way to do this. Could someone help? I am relatively new to R coding. I could be forgetting some simple syntax.