Can the use of return() after a magrittr pipeline to write an object break something?how to feed the result of a pipe chain (magrittr) to an objectUse $ dollar sign at end of of an R magrittr pipeline to return a vectordata.table vs dplyr: can one do something well the other can't or does poorly?how to feed the result of a pipe chain (magrittr) to an objectmagrittr and date objectsHow to build a pipeline from data.table to magrittr and back to data.tableHow to write a subsetting operation in magrittr/dplyr: x[!is.na(x)]How can I achieve partial application of a function before using it within a magrittR pipeline?Writing non-standard evaluation syntax with use of magrittr reverse pipeUse $ dollar sign at end of of an R magrittr pipeline to return a vectorHow to call an element of an object created with a magrittr pipe?enquo() inside a magrittr pipeline
There is only s̶i̶x̶t̶y one place he can be
What defines a dissertation?
Curses work by shouting - How to avoid collateral damage?
What would be the benefits of having both a state and local currencies?
How will losing mobility of one hand affect my career as a programmer?
apt-get update is failing in debian
Have I saved too much for retirement so far?
Time travel short story where a man arrives in the late 19th century in a time machine and then sends the machine back into the past
The baby cries all morning
Hide Select Output from T-SQL
Bash method for viewing beginning and end of file
How to be diplomatic in refusing to write code that breaches the privacy of our users
Can I convert a rim brake wheel to a disc brake wheel?
Opposite of a diet
Should my PhD thesis be submitted under my legal name?
What will be the benefits of Brexit?
HashMap containsKey() returns false although hashCode() and equals() are true
Print name if parameter passed to function
Cynical novel that describes an America ruled by the media, arms manufacturers, and ethnic figureheads
Valid Badminton Score?
What to do with wrong results in talks?
How does residential electricity work?
Will it be accepted, if there is no ''Main Character" stereotype?
What are the ramifications of creating a homebrew world without an Astral Plane?
Can the use of return() after a magrittr pipeline to write an object break something?
how to feed the result of a pipe chain (magrittr) to an objectUse $ dollar sign at end of of an R magrittr pipeline to return a vectordata.table vs dplyr: can one do something well the other can't or does poorly?how to feed the result of a pipe chain (magrittr) to an objectmagrittr and date objectsHow to build a pipeline from data.table to magrittr and back to data.tableHow to write a subsetting operation in magrittr/dplyr: x[!is.na(x)]How can I achieve partial application of a function before using it within a magrittR pipeline?Writing non-standard evaluation syntax with use of magrittr reverse pipeUse $ dollar sign at end of of an R magrittr pipeline to return a vectorHow to call an element of an object created with a magrittr pipe?enquo() inside a magrittr pipeline
I often have to manually clean up entries in datasets.
For flexibility and readability, I like to use pipes.
Sometimes I later come across another thing I need to clean up, so I keep a copy-paste'able line in my magrittr pipeline.
In ggplot2, calling an empty theme() at the end helps me to keep coding flexible for later additions. I never encountered problems with that and thought I could do the same with return() in a pipeline.
I think return() is not be meant to use outside functions, so: is there a conceivable way this could break my code?
I also stumbled upon . ans an alternative, but I don't really know what it does and searching info (even using advanced search on SO) is not helping.
Example:
starwars %<>%
mutate(hair_color = ifelse(name == "Captain Phasma", "blond", hair_color)) %>%
mutate(skin_color = ifelse(name == "Captain Phasma", "fair", hair_color)) %>%
mutate(hair_color = ifelse(name == "Zam Wesell", "blond", hair_color)) %>%
#mutate(var = ifelse(name == "cond", "replacement", var)) %>% ### for future c/p
return() #
NB: I realise this is borderline the tag "coding-style", so I like point out I'm not interested in an opinion-based discussion but advice if this could break my code in certain circumstances. Examples where it does break code are welcome, as are alternative suggestions.
I think these topics/threads are related:
https://github.com/tidyverse/magrittr/issues/32- Use $ dollar sign at end of of an R magrittr pipeline to return a vector
- how to feed the result of a pipe chain (magrittr) to an object
r tidyverse magrittr
add a comment |
I often have to manually clean up entries in datasets.
For flexibility and readability, I like to use pipes.
Sometimes I later come across another thing I need to clean up, so I keep a copy-paste'able line in my magrittr pipeline.
In ggplot2, calling an empty theme() at the end helps me to keep coding flexible for later additions. I never encountered problems with that and thought I could do the same with return() in a pipeline.
I think return() is not be meant to use outside functions, so: is there a conceivable way this could break my code?
I also stumbled upon . ans an alternative, but I don't really know what it does and searching info (even using advanced search on SO) is not helping.
Example:
starwars %<>%
mutate(hair_color = ifelse(name == "Captain Phasma", "blond", hair_color)) %>%
mutate(skin_color = ifelse(name == "Captain Phasma", "fair", hair_color)) %>%
mutate(hair_color = ifelse(name == "Zam Wesell", "blond", hair_color)) %>%
#mutate(var = ifelse(name == "cond", "replacement", var)) %>% ### for future c/p
return() #
NB: I realise this is borderline the tag "coding-style", so I like point out I'm not interested in an opinion-based discussion but advice if this could break my code in certain circumstances. Examples where it does break code are welcome, as are alternative suggestions.
I think these topics/threads are related:
https://github.com/tidyverse/magrittr/issues/32- Use $ dollar sign at end of of an R magrittr pipeline to return a vector
- how to feed the result of a pipe chain (magrittr) to an object
r tidyverse magrittr
1
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe.just calls the{function. You could probably also useidentityinstead.
– Roland
Mar 8 at 9:44
1
for your purpose,identityindeed is the appropriate function rather thanreturn
– RolandASc
Mar 8 at 10:01
add a comment |
I often have to manually clean up entries in datasets.
For flexibility and readability, I like to use pipes.
Sometimes I later come across another thing I need to clean up, so I keep a copy-paste'able line in my magrittr pipeline.
In ggplot2, calling an empty theme() at the end helps me to keep coding flexible for later additions. I never encountered problems with that and thought I could do the same with return() in a pipeline.
I think return() is not be meant to use outside functions, so: is there a conceivable way this could break my code?
I also stumbled upon . ans an alternative, but I don't really know what it does and searching info (even using advanced search on SO) is not helping.
Example:
starwars %<>%
mutate(hair_color = ifelse(name == "Captain Phasma", "blond", hair_color)) %>%
mutate(skin_color = ifelse(name == "Captain Phasma", "fair", hair_color)) %>%
mutate(hair_color = ifelse(name == "Zam Wesell", "blond", hair_color)) %>%
#mutate(var = ifelse(name == "cond", "replacement", var)) %>% ### for future c/p
return() #
NB: I realise this is borderline the tag "coding-style", so I like point out I'm not interested in an opinion-based discussion but advice if this could break my code in certain circumstances. Examples where it does break code are welcome, as are alternative suggestions.
I think these topics/threads are related:
https://github.com/tidyverse/magrittr/issues/32- Use $ dollar sign at end of of an R magrittr pipeline to return a vector
- how to feed the result of a pipe chain (magrittr) to an object
r tidyverse magrittr
I often have to manually clean up entries in datasets.
For flexibility and readability, I like to use pipes.
Sometimes I later come across another thing I need to clean up, so I keep a copy-paste'able line in my magrittr pipeline.
In ggplot2, calling an empty theme() at the end helps me to keep coding flexible for later additions. I never encountered problems with that and thought I could do the same with return() in a pipeline.
I think return() is not be meant to use outside functions, so: is there a conceivable way this could break my code?
I also stumbled upon . ans an alternative, but I don't really know what it does and searching info (even using advanced search on SO) is not helping.
Example:
starwars %<>%
mutate(hair_color = ifelse(name == "Captain Phasma", "blond", hair_color)) %>%
mutate(skin_color = ifelse(name == "Captain Phasma", "fair", hair_color)) %>%
mutate(hair_color = ifelse(name == "Zam Wesell", "blond", hair_color)) %>%
#mutate(var = ifelse(name == "cond", "replacement", var)) %>% ### for future c/p
return() #
NB: I realise this is borderline the tag "coding-style", so I like point out I'm not interested in an opinion-based discussion but advice if this could break my code in certain circumstances. Examples where it does break code are welcome, as are alternative suggestions.
I think these topics/threads are related:
https://github.com/tidyverse/magrittr/issues/32- Use $ dollar sign at end of of an R magrittr pipeline to return a vector
- how to feed the result of a pipe chain (magrittr) to an object
r tidyverse magrittr
r tidyverse magrittr
asked Mar 8 at 9:30
R'n'ER'n'E
137214
137214
1
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe.just calls the{function. You could probably also useidentityinstead.
– Roland
Mar 8 at 9:44
1
for your purpose,identityindeed is the appropriate function rather thanreturn
– RolandASc
Mar 8 at 10:01
add a comment |
1
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe.just calls the{function. You could probably also useidentityinstead.
– Roland
Mar 8 at 9:44
1
for your purpose,identityindeed is the appropriate function rather thanreturn
– RolandASc
Mar 8 at 10:01
1
1
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe
. just calls the { function. You could probably also use identity instead.– Roland
Mar 8 at 9:44
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe
. just calls the { function. You could probably also use identity instead.– Roland
Mar 8 at 9:44
1
1
for your purpose,
identity indeed is the appropriate function rather than return– RolandASc
Mar 8 at 10:01
for your purpose,
identity indeed is the appropriate function rather than return– RolandASc
Mar 8 at 10:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060276%2fcan-the-use-of-return-after-a-magrittr-pipeline-to-write-an-object-break-somet%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060276%2fcan-the-use-of-return-after-a-magrittr-pipeline-to-write-an-object-break-somet%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Well, it might break as soon as the first example in issue 32 returns a different result, i.e., the issue gets fixed. I believe
.just calls the{function. You could probably also useidentityinstead.– Roland
Mar 8 at 9:44
1
for your purpose,
identityindeed is the appropriate function rather thanreturn– RolandASc
Mar 8 at 10:01