and subsequent arguments match up to.
-Original Message-
From: R-help On Behalf Of Richard O'Keefe
Sent: Wednesday, January 4, 2023 1:56 AM
To: Milan Glacier
Cc: R-help Mailing List
Subject: Re: [R] Pipe operator
This is both true and misleading.
The shell pipe operation came from functio
Maybe I missed it in the whole discussion, but since R 4.2.0 the base R
pipe operator also has a placeholder '_' to specify where the result of
the left-hand side should be used in the right-hand side (see
https://stat.ethz.ch/pipermail/r-announce/2022/000683.html).
So the only difference
This is both true and misleading.
The shell pipe operation came from functional
programming. In fact the shell pipe operation
is NOT "flip apply", which is what |> is, but
it is functional composition. That is
out = let out = command
cmd1 | cmd2 = \x.cmd2(cmd1(x)).
Pragmatically, the Unix shell
With 50 years of programming experience, just think about how useful
pipe operator is in shell scripting. The output of previous call becomes
the input of next call... Genious idea from our beloved unix
conversion...
On 01/03/23 16:48, Sorkin, John wrote:
I am trying to understand the reason
does the same thing as %>%, or at my level of programing I
> have not encountered a difference.
>
> Tim
>
> -Original Message-
> From: R-help On Behalf Of Sorkin, John
> Sent: Tuesday, January 3, 2023 11:49 AM
> To: 'R-help Mailing List'
> Subject: [R] Pipe op
s complex in situations
like this. Just use a simple assignment pre or post as meets your needs.
-Original Message-
From: Boris Steipe
Sent: Tuesday, January 3, 2023 2:01 PM
To: R-help Mailing List
Cc: avi.e.gr...@gmail.com
Subject: Re: [R] Pipe operator
Working off Avi's example - would
The simplest and best answer is "fashion".
In FSharp,
> (|>);;
val it: ('a -> ('a -> 'b) -> 'b)
The ability to turn f x y into y |> f x
makes perfect sense in a programming language
where Currying (representing a function of n
arguments as a function of 1 argument that
returns a function of n-1
Jeff,
Thank you for contributing important information to this thread.
From: Jeff Newmiller
Sent: Tuesday, January 3, 2023 2:07 PM
To: r-help@r-project.org; Sorkin, John; Ebert,Timothy Aaron; 'R-help Mailing
List'
Subject: Re: [R] Pipe operator
> R is a functional language, hence the pipe operator is not needed.
Not factual... just opinion. Please be conscious of your biases and preface
opinion with a disclaimer.
I heard identical complaints from embedded assembly language programmers when C
became all the rage... "don't need another
R is a functional language, hence the pipe operator is not needed.
Also it makes the code unreadable as it is less obvious how a call stack
looks like and what the arguments to the function calls are.
It is relevant for a shell for piping text streams.
If people cannot live without the pipe
Dear John,
some more experienced users might give you a different and more helpful
answer, but I was not really convinced by the pipe operator until I
tried it out, for the same reasons as you.
In my opinion, the pipe operator is there only to improve the
readability of your code. Think
-Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Tuesday, January 3, 2023 11:49 AM
To: 'R-help Mailing List'
Subject: [R] Pipe operator
I am trying to understand the reason for existence of the pipe operator,
%>%, and when one should use it. It is my understanding
Às 19:14 de 03/01/2023, Rui Barradas escreveu:
Às 17:35 de 03/01/2023, Greg Snow escreveu:
To expand a little on Christopher's answer.
The short answer is that having the different syntaxes can lead to
more readable code (when used properly).
Note that there are now 2 different (but somewhat
nly selected rows and pipe that
>> to a function that drops some of the columns and pipe that to a function
>> that groups the items or sorts them and pipe that to a function that does a
>> join with another object or generates a report or so many other things.
>>
>> So th
Às 17:35 de 03/01/2023, Greg Snow escreveu:
To expand a little on Christopher's answer.
The short answer is that having the different syntaxes can lead to
more readable code (when used properly).
Note that there are now 2 different (but somewhat similar) pipes
available in R (there could be
graming I have not
>encountered a difference.
>
>Tim
>
>-Original Message-
>From: R-help On Behalf Of Sorkin, John
>Sent: Tuesday, January 3, 2023 11:49 AM
>To: 'R-help Mailing List'
>Subject: [R] Pipe operator
>
>[External Email]
>
>I am trying to und
s a report or so many other things.
>
> So the real answer is that piping is another WAY of doing things from a
> programmers perspective. Underneath it all, it is mostly syntactic sugar and
> the interpreter rearranges your code and performs the steps in what seems
> like a differen
Message-
From: R-help On Behalf Of Ebert,Timothy Aaron
Sent: Tuesday, January 3, 2023 12:08 PM
To: Sorkin, John ; 'R-help Mailing List'
Subject: Re: [R] Pipe operator
The pipe shortens code and results in fewer variables because you do not
have to save intermediate steps. Once you get used
--Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Tuesday, January 3, 2023 11:49 AM
To: 'R-help Mailing List'
Subject: [R] Pipe operator
I am trying to understand the reason for existence of the pipe operator,
%>%, and when one should use it. It is my understanding that
To expand a little on Christopher's answer.
The short answer is that having the different syntaxes can lead to
more readable code (when used properly).
Note that there are now 2 different (but somewhat similar) pipes
available in R (there could be more in some package(s) that I don't
know about,
.
Tim
-Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Tuesday, January 3, 2023 11:49 AM
To: 'R-help Mailing List'
Subject: [R] Pipe operator
[External Email]
I am trying to understand the reason for existence of the pipe operator, %>%,
and when one should use it
-Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Tuesday, January 3, 2023 11:49 AM
To: 'R-help Mailing List'
Subject: [R] Pipe operator
[External Email]
I am trying to understand the reason for existence of the pipe operator, %>%,
and when one should use it. It i
I have not encountered a
difference.
Tim
-Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Tuesday, January 3, 2023 11:49 AM
To: 'R-help Mailing List'
Subject: [R] Pipe operator
[External Email]
I am trying to understand the reason for existence of the pipe op
I am trying to understand the reason for existence of the pipe operator, %>%,
and when one should use it. It is my understanding that the operator sends the
file to the left of the operator to the function immediately to the right of
the operator:
c(1:10) %>% mean results in a value of 5.5
24 matches
Mail list logo