Replies

This profile is from a federated server and may be incomplete. Browse more on the original instance.

cedricr, to random
@cedricr@mapstodon.space avatar

PSA for users: consider adding sth like
1 options(Ncpus = parallel::detectCores() - 2) and

2 Sys.setenv(MAKEFLAGS = paste0("-j", max(parallel::detectCores() - 2, 1))) in your .Rprofile.

1 will make packages install in //, 2 will make builds from source parallelized.

On a 32 cores box, building @tylermorganwall rayshader (many dependencies):
none: 718s
2: 327s
1+2 : 138s

duckdb (no dep):
none: 989s
2: 112s

Prepare for some fan noise though !

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@cedricr If you do 1) do you know what's the best way to tell which packages succeeded to install, and which failed?

quantixed, to random
@quantixed@fosstodon.org avatar

is remotes::install_github() currently not working?
Getting HTTP error 401. Bad credentials.
Sys.getenv("GITHUB_PAT”) is empty and anyway, I’m just trying to install from a public repo.
Using R 4.4.0 & remotes_2.5.0 on macOS

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@quantixed Hard to know what is going wrong, but nevertheless I suggest you try pak instead: https://pak.r-lib.org/reference/install.html

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@quantixed you probably have an expired PAT in your git credential store. You can update it or delete it with the gitcreds R package.

zsmith27, to random

I have a private GitHub repo for an R package I developed for my organization. I cannot deploy a pkgdown webpage for my team in a private repo. Does anyone know if I can easily include a pkgdown webpage within my package (maybe in inst?) and have users serve it locally with a function call? I just saw this post from Maëlle Salmon: https://mastodon.social/@maelle/112393952364276977. Maybe servr::httw() could facilitate this?

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@zsmith27 I don't think you need a web server for this. Put the web site in inst, and then open the index.html file from the disk. E.g.

utils::browseURL(system.file(
package = "...",
"inst/docs/index.html"
))

jmcastagnetto, to random
@jmcastagnetto@mastodon.social avatar

@coolbutuseless -- just saw this on the incognito site :-)

https://x.com/JosiahParry/status/1787871177677115698

{yyjsonr} rewlz in speed and size

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@jmcastagnetto Those numbers seem wrong:

❯ du -hs /Users/gaborcsardi/Library/R/arm64/4.4/library/rapidjsonr
780K

❯ du -hs /Users/gaborcsardi/Library/R/arm64/4.4/library/yyjsonr
2.9M

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@jmcastagnetto jsonlite being extremely slow is also just not true:

❯ system.time(x1 <- jsonlite::fromJSON("./biocatgh/cran-full.json", simplifyVector=FALSE))
user system elapsed
2.046 0.245 2.349

❯ system.time(x2 <- yyjsonr::read_json_file("./biocatgh/cran-full.json"))
user system elapsed
0.910 0.095 1.026

❯ system.time(x3 <- jsonify::from_json("./biocatgh/cran-full.json"))
user system elapsed
2.124 0.108 2.248

jrosell, to random
@jrosell@mastodon.social avatar

.@gaborcsardi hi, what do you think is the recommended way to assert params in roxygen2 now that argufy is "read only"? https://github.com/gaborcsardi/argufy

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@jrosell IDK if there is a way via roxygen2, but personally I use assertthat or some lighter version of it embedded into the package. rlang also has a file that you can copy into your package: https://github.com/r-lib/rlang/blob/main/R/standalone-types-check.R

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@jrosell Well, unfortunately that's a dead project right now. R packages do not really have a standard code generation workflow, so this is a pretty hard problem.

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Has anyone ever written a "multi-facetted" package for CRAN?

For example, I have a package that uses the connections API.

I would like the full version available from GitHub and r-universe.

Through clever use of defines and 'if' statements etc, the CRAN version would exclude all forbidden code.

Could this exist in one pkg tarball? Or would the tarballs have to be different?

Are there CRAN-specific ENV vars that can be used to control the inclusion/exclusion of code?

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@coolbutuseless You can create another package for the extra features, and keep that on GitHub.

_wurli, to random
@_wurli@fosstodon.org avatar

Bizarre #RStats discovery of the week: control-flow statements don't necessarily have to be within a set of braces, unless the code it at the 'top level'. Super weird.

https://github.com/r-lib/tree-sitter-r/issues/103#issuecomment-2088580114

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@_wurli That's not entirely true.

for (i in 1:5)
print(i)

and

if (TRUE)
"foobar"

etc. are fine.

if (TRUE) "foo" else "bar"

etc. is also fine.

Basically, if the parser has a complete expression after reading a line, it evaluates it.

This usually works out fine, and does what you'd expect.

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@_wurli https://cran.r-project.org/doc/manuals/r-release/R-lang.html#if-1

"When the if statement is not in a block the else, if present, must appear on the same line as the end of statement2. Otherwise the new line at the end of statement2 completes the if and yields a syntactically complete statement that is evaluated."

lars_dalby, to rstats
@lars_dalby@mstdn.social avatar

Hmm, I'm having trouble connecting to the @Posit package manager at the moment. I get:
Warning: unable to access index for repository <https://packagemanager.posit.co/cran/latest/src/contrib>: cannot open URL '<https://packagemanager.posit.co/cran/latest/src/contrib/PACKAGES'> Is anyone else in the community seeing this? @rstats

gaborcsardi,
@gaborcsardi@fosstodon.org avatar
lwpembleton, to random
@lwpembleton@genomic.social avatar

Does anyone know if this is an error on #CRAN? I went to install the {multcompView} package only to have the error returned:
package ‘multicompView’ is not available for this version of R
So I naturally checked on CRAN what version of R it Depends on, and to my suprise, nothing was listed 🤔 I would have thought listing the R version under Depends would be a hard requirement and would have failed CRAN checks otherwise.
#RStats
https://cran.r-project.org/web/packages/multcompView/index.html

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@lwpembleton The latest version also works on R 4.3.3 for me.

You can get this error for a network error, or if a dependency requires a later versions of R.

You can try
pak::pkg_install("multcompViev")
and if it does not work, pak might tell you why exactly.

brodriguesco, to random
@brodriguesco@fosstodon.org avatar

A vulnerability in #Rstats has been discovered https://nvd.nist.gov/vuln/detail/CVE-2024-27322

gaborcsardi,
@gaborcsardi@fosstodon.org avatar

@_TimTaylor @brodriguesco The supply chain attack part is bogus, because a package can also have an .onLoad() function, or a library init hook in C, so package authors can still run code on your machine, when you load their package.

Running code when loading an RDS is bad, OTOH.

brodriguesco, to random
@brodriguesco@fosstodon.org avatar

why are there two versions of MASS on src/contrib of CRAN?

gaborcsardi, (edited )
@gaborcsardi@fosstodon.org avatar

@brodriguesco It is actually a good thing. This way old metadata that refers to the older version of the package still works. They would ideally keep the older files around for a couple of days.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • rosin
  • Durango
  • cisconetworking
  • mdbf
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • osvaldo12
  • Youngstown
  • ethstaker
  • slotface
  • kavyap
  • JUstTest
  • thenastyranch
  • normalnudes
  • modclub
  • khanakhh
  • everett
  • tacticalgear
  • cubers
  • GTA5RPClips
  • anitta
  • Leos
  • tester
  • provamag3
  • lostlight
  • All magazines