Get_forecast_for (Darksky API)

Hi all!

This must be a simple question but this is my first Rstudio project, my thesis deadline is approaching and something just does not seem to work so I need your help :slight_smile:

I installed the darksky package, connected my Rstudio to the Darksky database through an API key. I made a csv file containing the information needed (longitude, latitude and the date) and now I need the weather information for every place on a certain day for this date.

It needs to look something like this:

Get_forcast_for(data$lontitude, data$latitude, date(in asdate format)) and then looping it for every row in the 800.000 rows containing csv file.

The data looks like this:

dateofwriting lon lat
28-02-2011 114,1693611 22,3193039
18-03-2010 -3,7037902 40,4167754
31-05-2010 -3,188267 55,953252
29-05-2010 17,6389267 59,8585638

The only examples on the internet explain the function inserting coordinates manually and I keep getting error messages. Hope someone can help.

Thank you in advance,

Kind regards,

Evelien

There are a few examples in the github repo README, what happens when you try those examples with your data?

This is what I would make from the github files:

test <- pmap(list(data_weer$lat, data_weer$lon, as.Date(data_weer$dateofwriting, format("%D/%M/%Y"))), get_forecast_for)

But this doesn't work, maybe you know what I'm doing wrong?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.