Comments (4)
Does it work if you specifically call print.ggplot
(or what the specific print method should dispatch to)?
from magrittr.
You would still need to wrap the ggplot call with (). + takes precedence.
for (i in 1:3) {
(ggplot(data.frame(x=rnorm(1e3)), aes(x=x)) + geom_histogram()) %>%
print
}
See SO for a related question: http://stackoverflow.com/questions/27264266/multiple-ggplots-with-magrittr-tee-operator
Edit based on @smbache's comment below:
for (i in 1:3) {
ggplot(data.frame(x=rnorm(1e3)), aes(x=x)) %>%
add(geom_histogram()) %>%
print
}
from magrittr.
Didn't even notice that (my excuse is being on the phone ;)).
@dustinvtran you could use one the add
alias here to avoid enclosing in parens.
from magrittr.
Oh wow, can't believe I missed that. Thanks! (How funny that it comes down to the exact same issue I mentioned before: #49)
from magrittr.
Related Issues (20)
- Feature request: Assignment expression operator HOT 1
- Move `master` branch to `main` HOT 1
- `magrittr::freduce()` doesn't support lambda functions HOT 4
- Add warning when piped object overwrites keyword arguments when not used as first argument HOT 1
- Inconsistent assign() behavior in simple piping with Magrittr HOT 1
- Bug: Rstudio completion with "mrgmod" S4 class object HOT 4
- Feature: Function to create functional sequences HOT 1
- Suggest alias for `Encoding<-` HOT 1
- Hartmann pipelines HOT 3
- Magrittr Logo HOT 1
- difference in performance HOT 2
- Different results using pipes HOT 2
- introspection HOT 2
- magrittr upkeep 2023
- Add function not behaving correctly when being fed an expression
- Pipe doesn't work in basic round function HOT 1
- Question: magrittr's pipes not hyperlinked in docs, why not? HOT 1
- Question: UN or UNE pipe? HOT 1
- Assignment pipe `%<>%` breaks if R-native `|>` pipes used in chain instead of magrittr-native pipes `%>%` HOT 1
- How to quote magrittr library/package in function call: `magrittr::%<>%` doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magrittr.