Giter Site home page Giter Site logo

p to fig about plotly.r-docs HOT 6 CLOSED

plotly avatar plotly commented on September 19, 2024
p to fig

from plotly.r-docs.

Comments (6)

nicolaskruchten avatar nicolaskruchten commented on September 19, 2024

@rpkyle @sacul-git @HammadTheOne any strong feelings here?

from plotly.r-docs.

sacul-git avatar sacul-git commented on September 19, 2024

@nicolaskruchten is this just for readability? I personally tend to use something along the lines of the original example, creating the fig in one go rather than creating it and overwriting, but what are the disadvantages to having something like this in the documentation?

fig <- plot_ly(x = ~s, y = ~s) %>%
    layout(xaxis = a, yaxis = a)
fig

from plotly.r-docs.

HammadTheOne avatar HammadTheOne commented on September 19, 2024

I don't feel too strongly about it, but from a user standpoint, the rewritten version might be better to follow for individuals who aren't as familiar with the tidyverse. In their style guide they actually recommend using shorter pipes for readability, so the rewrite is a better option from that standpoint.

from plotly.r-docs.

nicolaskruchten avatar nicolaskruchten commented on September 19, 2024

@sacul-git the idea is to more clearly break out the various steps for users, so they can copy-paste individual lines into their script more easily:

fig <- plot_ly(x = ~s, y = ~s)  # create fig
fig <- fig %>% layout(xaxis = a, yaxis = a)  # mutate fig
fig # display fig

from plotly.r-docs.

nicolaskruchten avatar nicolaskruchten commented on September 19, 2024

agreed on that on the command-line you would likely just use the pipe without any assignment :)

from plotly.r-docs.

rpkyle avatar rpkyle commented on September 19, 2024

For posterity's sake, just noting here that I made a comment along the lines of what @sacul-git said above to @nicolaskruchten, but the explanation (being able to easily copy the line and reuse) makes a lot of sense, so I have no objections to this syntax personally.

from plotly.r-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.