VeruGHub / easyclimate

Easy access to high-resolution daily climate data for Europe
https://verughub.github.io/easyclimate/
GNU General Public License v3.0
45 stars 1 forks source link

examples: easier to start with data.frame than matrix? #52

Open Pakillo opened 3 months ago

Pakillo commented 3 months ago

Function examples (both for daily and monthly data) start with matrices, then convert to data.frame or tibble. I think most people are much more familiar with data.frames or tibbles than matrices nowadays. So I'd revise examples, i.e. starting examples with:

coords <- data.frame(lon = -5.36, lat = 37.40)

rather than starting with

coords <- matrix(c(-5.36, 37.40), ncol = 2)

and then converting to data.frame, which requires naming columns afterwards.

coords <- as.data.frame(coords)
names(coords) <- c("lon", "lat")  # must have these columns

We already made a similar change in the README a while ago