[R] the opposite of pluck() in purrr

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Nov 18 23:01:24 CET 2021


tidyverse is an RStudio ecosystem of packages -- it is not part of R's
"standard" package distro, so as the posting guide linked below says:

"For questions about functions in standard packages distributed with R (see
the FAQ Add-on packages in R
<https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R>), ask
questions on R-help.
If the question relates to a *contributed package* , e.g., one downloaded
from CRAN, try contacting the package maintainer first. You can also use
find("functionname") and packageDescription("packagename") to find this
information. *Only* send such questions to R-help or R-devel if you get no
reply or need further assistance. This applies to both requests for help
and to bug reports."

While you may nevertheless get lucky here, a better bet is to post on
RStudio's own forum, set up specifically to provide such help:
https://community.rstudio.com/

Cheers,

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Nov 18, 2021 at 1:40 PM Christopher W. Ryan via R-help <
r-help using r-project.org> wrote:

> I've just learned about pluck() and chuck() in the purrr package. Very
> cool!  As I understand it, they both will return one element of a list,
> either by name or by [[]] index, or even "first"  or "last"
>
> I was hoping to find a way to return all *but* one specified element of
> a list. Speaking loosely, pluck(-1) or pluck(!1) or !pluck(1), but none
> of those of course work. Thinking of English language, I had hopes for
> chuck(1) as in "chuck element 1 away, leaving the rest"  but that's now
> how it works.
>
> Any tidyverse-centric ways to return all except one specified element of
> a list?
>
> Thanks.
>
> --Chris Ryan
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list