rOpenSpain / climaemet

R Climate AEMET Tools
https://ropenspain.github.io/climaemet/
GNU General Public License v3.0
41 stars 2 forks source link

Issue with `.name_repair` #35

Closed indycool79 closed 1 year ago

indycool79 commented 1 year ago

Hello,

I was trying to create a Walter Lieth climate diagram when I had an error message teling me to report here. The complete error message is:

Error in ggplot2::geom_segment(): ! Problem while computing aesthetics. ℹ Error occurred in the 3rd layer. Caused by error in .data$x: ! Column x not found in .data. Run rlang::last_error() to see where the error occurred. Warning message: The x argument of as_tibble.matrix() must have unique column names if .name_repair is omitted as of tibble 2.0.0. ℹ Using compatibility .name_repair. ℹ The deprecated feature was likely used in the climaemet package. Please report the issue at https://github.com/rOpenSpain/climaemet/issues. This warning is displayed once every 8 hours. Call lifecycle::last_lifecycle_warnings() to see where this warning was generated.

Hope it helps, have a nice day.

dieghernan commented 1 year ago

Could you please provide a sample of your data & code? Ideally a full reprex so I can figure out

Thanks

indycool79 commented 1 year ago

Here are the sample and the code

library(tidyverse)
library(climaemet)

#import data
dat_climat <-
read.csv(file = "dat_climat.csv",
         sep = ";",
         dec = ".")

#create WL diagram
ggclimat_walter_lieth(dat = dat_climat,
                        est="Location Name",
                        alt=40,
                        per="2000-2023",
                        mlab="en",
                        pcol = "blue",
                        tcol = `"red")

dat_climat.csv

dieghernan commented 1 year ago

Thanks, after #36 I can see

dat_climat  <- read.csv("https://github.com/rOpenSpain/climaemet/files/10731041/dat_climat.csv",
                        sep = ";",
                        dec = ".")

library(climaemet)
ggclimat_walter_lieth(dat = dat_climat,
                      est="Location Name",
                      alt=40,
                      per="2000-2023",
                      mlab="en",
                      pcol = "blue",
                      tcol = "red")

And for double checking, with climatol::diagwl() I see:


library(climatol)
#> Loading required package: maps
#> Loading required package: mapdata

diagwl(dat = dat_climat,
       est="Location Name",
       alt=40,
       per="2000-2023",
       mlab="en",
       pcol = "blue",
       tcol = "red")

Created on 2023-02-14 with reprex v2.0.2

Please @indycool79 let me know if that's the expected result

indycool79 commented 1 year ago

Yes, that's the expected output, thank you!