RInno icon indicating copy to clipboard operation
RInno copied to clipboard

Error in if (latest_R_version == R_version)

Open jessekps opened this issue 1 year ago • 4 comments

When using create_app with usual arguments and include_R=TRUE I get the error:

Error in if (latest_R_version == R_version) { : argument is of length zero

I believe the error is in get_R.R on line 23:

latest_R_version <- readLines("https://cran.rstudio.com/bin/windows/base/", warn = F) %>%
    stringr::str_extract("[1-3]\\.[0-9]+\\.[0-9]+") %>% stats::na.omit() %>% unique()

The regular expression should start with [1-4], since R4.+ is now the current R version.

jessekps avatar Aug 03 '22 08:08 jessekps

Coming to say I still have the same issue in January 2023 - but also just wondering why the regular expression could not be dynamic - why isn't the first part of the regular expression just [0-9]? That would last a good while longer...

AmyMikhail avatar Jan 13 '23 20:01 AmyMikhail

And if you don't feel like maintaining that code, you can simply rely on rversions. It seems to be actively maintained by some well known names in the R community.

> rversions::r_release()
version                date              nickname
4.2.2 2022-10-31 08:05:54 Innocent and Trusting

jessekps avatar Jan 16 '23 06:01 jessekps

I am facing the same error with create_app with argument include_R = TRUE, R_version = "4.0.0"

Error in if (latest_R_version == R_version) { : 
  argument is of length zero

However when I change the 3 to 4 in the latest_R_version in trace(RInno::get_R,edit=T) and trace(RInno::code_section,edit=T)

I am still getting an error

Error in if (latest_R_version == R_version) { : 
  the condition has length > 1

How to fix this?

vekinoir avatar Jan 04 '24 10:01 vekinoir