Heya,
I'm not familiar with R, but I am using a package to extract weather data from the Bureau of Meteorology in Australia (https://docs.ropensci.org/bomrang/articles/bomrang.html#introduction).
I want to update a field to change the (Station_ID).
which is shown in the line.
Normal Syntax:
df2 <- get_historical(stationid = "32078, type = "max")
## 32078 is the Station_ID
df2 <- get_historical(stationid = "ValuetoADD", type = "max")
## ~48,000+ daily records
I'm using the
Station_ID <- '%Question.ValuetoADD%'
for the interface.
Attached my workflow.
Also, want to know if it is possible to create a batch macro that would extract weather data for all of Station_IDs???
Cheers,
Nick
Solved! Go to Solution.
Hey @hillsn92, no need for a batch macro here. R has looping commands you can use. The basic process is this:
The code to do this looks something like the following:
library(bomrang)
df <- read.Alteryx("#1",mode="data.frame")
for (site in df[,'Site']) {
df2 <- get_historical(stationid = site, type = "max")
write.table(df2, row.names = TRUE, col.names = TRUE)
write.Alteryx(df2, 1)
}