Applying a function to dataframe column where the function value depends on the value of another column

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Applying a function to dataframe column where the function value depends on the value of another column

TJUN KIAT TEO
Suppose I have a dataframe in this from

a b c
g 2 3
h 4 5
i 6 7

I want to apply a function to individual elements of column C where the function value depends on the value of column A

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Applying a function to dataframe column where the function value depends on the value of another column

Jeff Newmiller
Press send too soon? This is not actually a question.

Do read the Posting Guide... for one thing you need to post in plain text because the automatic text conversion tends to mess up what you send if it is HTML.

On June 5, 2020 12:02:44 AM PDT, TJUN KIAT TEO <[hidden email]> wrote:

>Suppose I have a dataframe in this from
>
>a b c
>g 2 3
>h 4 5
>i 6 7
>
>I want to apply a function to individual elements of column C where the
>function value depends on the value of column A
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] 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.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] 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.