javad bayat
2024-Oct-30 10:48 UTC
[R] Extracting wind direction and wind speed from wind rose plot
Dear all; I am searching for a way to extract wind direction and speed from a wind rose plot. I have a graph and I want to make a dataframe of 5 years with hourly intervals.> start_date <- as.POSIXct("2019-01-01 00:00:00") > end_date <- as.POSIXct("2023-12-31 23:00:00") > time_sequence <- seq(from = start_date, to = end_date, by = "hour")> df <- data.frame(year = as.integer(format(time_sequence, "%Y")), month = as.integer(format(time_sequence, "%m")), day = as.integer(format(time_sequence, "%d")), hour = as.integer(format(time_sequence, "%H")) )> head(df)year month day hour 1 2019 1 1 0 2 2019 1 1 1 3 2019 1 1 2 4 2019 1 1 3 5 2019 1 1 4 6 2019 1 1 5 And I want to add 2 more cols to this dataframe as Wind_Dir and Wind_Speed that the data extracted from the plot by analyzing it. Is there any library to do this? or any function to write for this purpose? I would be more than happy if you please help me to do this. Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat194 at yahoo.com [[alternative HTML version deleted]]
Jeff Newmiller
2024-Oct-30 13:26 UTC
[R] Extracting wind direction and wind speed from wind rose plot
A wind rose plot omits time information. Your request is simply not possible. On October 30, 2024 3:48:03 AM PDT, javad bayat <j.bayat194 at gmail.com> wrote:>Dear all; >I am searching for a way to extract wind direction and speed from a wind >rose plot. I have a graph and I want to make a dataframe of 5 years with >hourly intervals. > >> start_date <- as.POSIXct("2019-01-01 00:00:00") >> end_date <- as.POSIXct("2023-12-31 23:00:00") >> time_sequence <- seq(from = start_date, to = end_date, by = "hour") > >> df <- data.frame( > year = as.integer(format(time_sequence, "%Y")), > month = as.integer(format(time_sequence, "%m")), > day = as.integer(format(time_sequence, "%d")), > hour = as.integer(format(time_sequence, "%H")) >) > >> head(df) > year month day hour >1 2019 1 1 0 >2 2019 1 1 1 >3 2019 1 1 2 >4 2019 1 1 3 >5 2019 1 1 4 >6 2019 1 1 5 > > >And I want to add 2 more cols to this dataframe as Wind_Dir and Wind_Speed >that the data extracted from the plot by analyzing it. >Is there any library to do this? or any function to write for this purpose? >I would be more than happy if you please help me to do this. >Sincerely > > > > > > >-- Sent from my phone. Please excuse my brevity.
@vi@e@gross m@iii@g oii gm@ii@com
2024-Oct-30 18:16 UTC
[R] Extracting wind direction and wind speed from wind rose plot
I am curious what you mean by "having a graph." If you mean something drawn on paper or an image on your screen, then extracting specific data at various points is an effort, perhaps more so if a wind rose plot does not contain all you need. If you have something like a ggplot2 object, it tends to contain lots of saved info inside you can access, albeit it may not be by the hour. Is there a library that does that? Either way, others have pointed out ways to combine two sets of data if they already match or with a suitable join method. There are quite a few packages that can be used to massage your data, once you have valid data, into that form but you may need to meet some constraints and make some decisions. I hesitate to point out that a data frame with hourly intervals over five years is 24*365*5 rows and would require somehow reading one or more such plots to generate nearly 44K observations. -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of javad bayat Sent: Wednesday, October 30, 2024 6:48 AM To: R-help <R-help at r-project.org> Subject: [R] Extracting wind direction and wind speed from wind rose plot Dear all; I am searching for a way to extract wind direction and speed from a wind rose plot. I have a graph and I want to make a dataframe of 5 years with hourly intervals.> start_date <- as.POSIXct("2019-01-01 00:00:00") > end_date <- as.POSIXct("2023-12-31 23:00:00") > time_sequence <- seq(from = start_date, to = end_date, by = "hour")> df <- data.frame(year = as.integer(format(time_sequence, "%Y")), month = as.integer(format(time_sequence, "%m")), day = as.integer(format(time_sequence, "%d")), hour = as.integer(format(time_sequence, "%H")) )> head(df)year month day hour 1 2019 1 1 0 2 2019 1 1 1 3 2019 1 1 2 4 2019 1 1 3 5 2019 1 1 4 6 2019 1 1 5 And I want to add 2 more cols to this dataframe as Wind_Dir and Wind_Speed that the data extracted from the plot by analyzing it. Is there any library to do this? or any function to write for this purpose? I would be more than happy if you please help me to do this. Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat194 at yahoo.com [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.