I am new to Stack overflow, and also to R programming so please forgive if the question is a bit silly sounding.
What I would like to ask anyone in the know is if it is possible to display multiple summaries from just one code command.
Just to give an example of what I am trying to achieve: The data frame consists of daily climate data over a number of years (includes around 6 various variables)
sub <- subset(data, Month == "Sep" & Day==2, !is.na(data), select = MSLP:Temp)
summary(sub,mean)
MSLP Direction Speed Temp
Min. : 976 Min. : 8.4 Min. : 1.680 Min. : 8.18
1st Qu.:1007 1st Qu.:167.8 1st Qu.: 6.095 1st Qu.:13.04
Median :1016 Median :229.7 Median :10.010 Median :14.73
Mean :1014 Mean :213.0 Mean :10.042 Mean :14.68
3rd Qu.:1022 3rd Qu.:270.4 3rd Qu.:13.320 3rd Qu.:16.40
Max. :1034 Max. :353.6 Max. :25.640 Max. :21.58
All good so far. But what I would like to ask, if anybody would know, is if it would be possible to include something in the above code to display a summary for each day over a set period? Say from day 2 through to day 10.
Also if OK, would it be possible to include another critera in the above code to include a specific year? IE:
sub <- subset(data, Month == "Sep" & Day==2 - include year etc.
as I just cannot figure it out at all. For eg, if I do
sub <- subset(data, Month == "Sep" & Day==2 & Year == 1967 #etc ...)
I just get an error code like this:
Error in eval(expr, envir, enclos)
Apologies again if these questions seem a little idiotic but if anybody has any solutions to the above I would be very grateful.