Replies

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

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hive: has anyone resubmitted a package to CRAN and been asked to fix their use of SET_TRUELENGTH?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@LukeTierney4 thanks for the info. It was unclear whether the NOTE was a blocker to package updates.

I do recall a checkbox when submitting to CRAN along the lines of "I have checked the CRAN checks and fixed all the errors and warnings and notes(?)".

I am mis-remembering the exact text and extents of the assertion - but that was the gist.

yutannihilation, to random
@yutannihilation@fosstodon.org avatar

Some days ago, the CRAN check with R-devel started to raise "Found non-API calls to R" NOTE. I'm not sure if they are serious on disallowing these not-so-minor APIs, but what should I do? Do you take some action or just wait?

For example, rlang package now has these NOTE:

File ‘rlang/libs/rlang.so’:
Found non-API calls to R: ‘R_ClosureExpr’, ‘R_PromiseExpr’,
‘SETLENGTH’, ‘SET_ENCLOS’, ‘SET_ENVFLAGS’, ‘SET_TRUELENGTH’

https://cran.r-project.org/web/checks/check_results_rlang.html

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@yutannihilation what's the process for handling these checks?

Do I not need to do anything unless I get an email?

I guess next time I submit a package, I have to say that I've dealt with all these NOTEs

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

I am paying close attention to the R-devel discussion on R API definition.

A package I'm working on (rmonocypher) uses connections to enable encryption in lots of useful places in R for seamless/easy data encryption.

But connection registration in R code is "non API", meaning that you can't write a new connection in a package!

The connection API has been stable for 10 years. Not sure why its use is verboten.

#RStats

https://github.com/coolbutuseless/rmonocypher

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@LukeTierney4 :/

I would've thought I could just use/check the R_CONNECTIONS_API version and update the package when it gets updated ?

Just like we do with R_GE_version for the graphics system.

It feels limiting to have a stable API for enhancing R marked as "don't use"

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Is there a blessed way to create a RAWSXP from an existing chunk of memory within C?

Specifics:

  • The memory is already allocated elsewhere
  • I don't want to use memcpy, just wrap the memory where it is such that the RAWSXP points to it.
  • I don't want the garbage collector to know about it - I will free the memory myself later.
  • It still has to be valid RAWSXP that I can use in R

This is a bit of a callback to this post: https://fosstodon.org/@coolbutuseless/111956983679205597

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

The reason I want to wrap existing memory in a raw vector:

  • R does not expose handling of "connections" within C
  • In C, I have existing memory to write to an R connection
  • I have to alloc a RAWSXP of the appropriate size & copy the memory into it
  • Then call out to R (from C) to the function writeBin()
  • And writeBin() is just going to unbox this & use the raw memory

So a 'fake' SEXP header would save a bit of unnecessary overhead & copying

And there is lots of data to write!

#RStats

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Obviously, I'm going to try and write it, but I was hoping it was a known thing that was already exposed in the R API.

#RStats

gaborcsardi, to random
@gaborcsardi@fosstodon.org avatar

R 4.4.0 is coming in less than one month!

With rig you can try the first alpha easily while keeping your current R version. Run

rig add next

to install, and then

R-next

to start R 4.4.0 alpha.

On Windows, macOS or one of the many supported Linux distributions.

See https://github.com/r-lib/rig#readme

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

{rig} is brilliant! In half-an-hour I:

  • Installed rig for the first time on macOS
  • Installed R 4.2 and 4.4
  • Used the handy shortcuts to start my project in Rstudio with these alternate R versions
  • Tested my new package locally to see some version-specific options worked

@gaborcsardi

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hivemind:

What's the current preferred solution for running multiple R versions on macOS?

rig?
rswitch?

something else?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

Thanks all - the answer to running multiple R versions on macOS is 'rig'

https://github.com/r-lib/rig

I just installed and tested new pkg on R4.1, 4.2, 4.3 and 4.4

It's helping me to decide minimum R version requirements, and to test on new 4.4

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

Survey: what new bit of syntax would you like in base ?

What should the following bits of syntax do?

  • ===
  • ++ And --
  • +=
  • //
  • ?
  • {{ }}
  • [[[ ]]]
  • <<==
  • (?: X)
coolbutuseless,
@coolbutuseless@fosstodon.org avatar

syntax hypothetical

f <- function(year, x) {

lunar phase for xth day of year

...
}

Three dots in a row is known as The Friday Operator.

R will call an LLM and get it to write the rest of the code.

henrikbengtsson, to random
@henrikbengtsson@mastodon.social avatar

FYI, CRAN requires package titles to be of length < 65 characters. Just received the following feedback for a new package:

> Please reduce the length of the title to less than 65 characters.

Do we have a community-driven place where we track these "hidden" CRAN requirements? I think there was a discussion about it, but I cannot remember if it happened.

#RStats

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@Mehrad @henrikbengtsson I wonder how long it takes for new checks to filter out.

Have to wait for new r version I guess...

tylermorganwall, to random
@tylermorganwall@fosstodon.org avatar

Got my algorithm improvements working--now that's fast convergence!

fast convergence of stippled points into a face

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@tylermorganwall I am dying to know where this is heading!

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@tylermorganwall I will wait quietly for whatever this becomes :)

Very cool!

danwwilson, to random
@danwwilson@rstats.me avatar

How nice would it be if gracefully handled trailing commas in lists and vectors.

I bet no one can guess what is giving me the most grief today. 🤦‍♂️

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@danwwilson I recall a presentation from about 5 years ago which talked about a possible implementation. Can't seem to find it now :(

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi @danwwilson that feels like it. Interesting to see quite a few things from that talk actually make it into R!

coolbutuseless, to random
@coolbutuseless@fosstodon.org avatar

hypothetical: what would happen if I

  • manually allocated some memory in C (with malloc)
  • Crafted the memory to be an R object by writing a proper SEXP header for it
  • Returned this to R

Would R consider this cuckoo object to be real? It wouldn't appear in the list of objects to be garbage collected - would that impact its validity?

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

I think with a malloc and a memcpy I can quickly fake a real R SEXP object.

I will report back!

I will also see what PROTECT()/UNPROTECT() want to do, and see if it'll crash :)

coolbutuseless,
@coolbutuseless@fosstodon.org avatar

@gaborcsardi any gut intuition what would lead to a crash here?

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