Displaying 5 results from an estimated 5 matches for "tidydata".
2024 Jul 21
3
Using the pipe, |>, syntax with "names<-"
Wow!
Yes, this is very clever -- way too clever for me -- and meets my
criteria for a solution.
I think it's also another piece of evidence of why piping in base R is
not suited for complex/nested assignments, as discussed in Deepayan's
response.
Maybe someone could offer a better Tidydata piping solution just for
completeness?
Best,
Bert
On Sun, Jul 21, 2024 at 7:48?AM Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
>
> This
> - is non-destructive (does not change z)
> - passes the renamed z onto further pipe legs
> - does not use \(x)...
>
> It w...
2024 Jul 21
1
Using the pipe, |>, syntax with "names<-"
...ever -- way too clever for me -- and meets my
> criteria for a solution.
>
> I think it's also another piece of evidence of why piping in base R is
> not suited for complex/nested assignments, as discussed in Deepayan's
> response.
>
> Maybe someone could offer a better Tidydata piping solution just for
> completeness?
>
> Best,
> Bert
>
> On Sun, Jul 21, 2024 at 7:48?AM Gabor Grothendieck
> <ggrothendieck at gmail.com> wrote:
> >
> > This
> > - is non-destructive (does not change z)
> > - passes the renamed z onto further...
2024 Jul 21
1
Using the pipe, |>, syntax with "names<-"
...d meets my
> > criteria for a solution.
> >
> > I think it's also another piece of evidence of why piping in base R is
> > not suited for complex/nested assignments, as discussed in Deepayan's
> > response.
> >
> > Maybe someone could offer a better Tidydata piping solution just for
> > completeness?
> >
> > Best,
> > Bert
> >
> > On Sun, Jul 21, 2024 at 7:48?AM Gabor Grothendieck
> > <ggrothendieck at gmail.com> wrote:
> > >
> > > This
> > > - is non-destructive (does not chang...
2024 Jul 21
0
Using the pipe, |>, syntax with "names<-"
...e -- and meets my
>> criteria for a solution.
>>
>> I think it's also another piece of evidence of why piping in base R is
>> not suited for complex/nested assignments, as discussed in Deepayan's
>> response.
>>
>> Maybe someone could offer a better Tidydata piping solution just for
>> completeness?
>>
>> Best,
>> Bert
>>
>> On Sun, Jul 21, 2024 at 7:48?AM Gabor Grothendieck
>> <ggrothendieck at gmail.com> wrote:
>> >
>> > This
>> > - is non-destructive (does not change z)
>&...
2024 Jul 21
1
Using the pipe, |>, syntax with "names<-"
This
- is non-destructive (does not change z)
- passes the renamed z onto further pipe legs
- does not use \(x)...
It works by boxing z, operating on the boxed version and then unboxing it.
z <- data.frame(a = 1:3, b = letters[1:3])
z |> list(x = _) |> within(names(x)[2] <- "foo") |> _$x
## a foo
## 1 1 a
## 2 2 b
## 3 3 c
On Sat, Jul 20, 2024 at