[R] Extracting wind direction and wind speed from wind rose plot
@vi@e@gross m@iii@g oii gm@ii@com
@vi@e@gross m@iii@g oii gm@ii@com
Wed Oct 30 19:16:07 CET 2024
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 using r-project.org> On Behalf Of javad bayat
Sent: Wednesday, October 30, 2024 6:48 AM
To: R-help <R-help using 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 using yahoo.com
[[alternative HTML version deleted]]
______________________________________________
R-help using 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.
More information about the R-help
mailing list