search for: init_day

Displaying 5 results from an estimated 5 matches for "init_day".

2016 Apr 11
3
Query about use of format in strptime
...se strptime because I have to deal with date with hours and minutes. I read the manual for strptime and I also looked at many examples, but when I try to apply it to my code, I always encounter some problems. I try to change the default format, with no success. Why? How can I change the format? 1. init_day <- as.factor("2015-02-24-00-30") strptime(init_day, format="%Y-%m-%d-%H-%M") [1] "2015-02-24 00:30:00" It works, but why also seconds are shown if in format seconds are not specified? 2. init_day <- as.factor("2015-02-24-0-00") strptime(init_day, forma...
2016 Apr 11
0
Query about use of format in strptime
...;The default for the format methods is "%Y-%m-%d %H:%M:%S" if any element has a time component which is not midnight, and "%Y-%m-%d" otherwise. This is because when the result is printed, it uses the default format. If you want a specified output representation: format(strptime(init_day, format="%Y-%m-%d-%H-%M"),"%Y-%M-%d %H:%M") [1] "2015-30-24 00:30" For the "midnight" case: format(strptime(init_day, format="%Y-%m-%d-%H-%M"),"%Y-%m-%d %H:%M") [1] "2015-02-24 00:00" Jim On Mon, Apr 11, 2016 at 5:22 PM, Ste...
2016 Apr 11
2
Query about use of format in strptime
...cause of some days (or part of them) might be missing, given a time interval I want to create a new data frame with all time-steps and then merge the new data frame with the old one. In order to create a new data frame with all time-steps, I thought to use df_new <- data.frame(data_strptime=seq(init_day, fin_day, by="30 mins")) and then Snow_all <- merge(df_new, Snow, by=("data_strptime"), all.x=TRUE) My problem is in dealing with init_day and fin_day, respectively for example "200711190000" and "200711210000". I am not able to create a sequence of cla...
2017 Nov 23
0
How to produce rainfall maps
...ing. My input file (pointfile.csv in the reported example) reports the station code, lat and long of the meteorological station and the rainfall value (which might be the cumulate of a week or ten days or the period I need to investigate). Here a small example: Station_Code, Init_Year, Init_Month, Init_Day, Init_Hour, Init_Minute, Fin_Year, Fin_Month, Fin_Day, Fin_Hour, Fin_Minute, Rainfall_Cumulate, Long, Lat 1056, 2017 , 11 , 1 , 0 , 0 , 2017 , 11 , 11 , 0 , 0 , 28.40, 12.786904, 43.851849 1064, 2017 , 11 , 1 , 0 , 0 , 2017 , 11 , 11 , 0 , 0 , 27.20, 12.967556, 43.762669 1072, 2017 , 11 ,...
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form for input (with no structural normalization), so conversion to points is perfectly proper here, albeit confusing in context. (It's closer to what graphics devices actually use ultimately, but the expansion is laid out very early in ggplot2 because there's no standard for intermediate forms.) Cheers, Mike On Wed,