Giter Site home page Giter Site logo

Comments (5)

mikemahoney218 avatar mikemahoney218 commented on May 26, 2024 1

To be clear, I'm suggesting that we keep a "saving plots" challenge, just suggesting that it changes to the more useful ggsave() topic rather than focusing on a legacy approach.

I don't know that we necessarily want to teach learners all the different ways they might approach a problem, or all the ways they might see in the wild. We only teach ggplot2 in this lesson, and we don't get into the details of base plotting, even though there's plenty of code still generating base plots. If we do keep references to the graphics device functions here, then I think we should minimize it as much as possible, and give learners challenges relating to the tools they're more likely to use instead.

That said, I feel like any changes to focus more on ggsave() are good, and if the fastest/easiest version of that is simply adding it after the challenge then that's at least an improvement!

from r-intro-geospatial.

albhasan avatar albhasan commented on May 26, 2024

You're right. Lesson 8 was written using the function pdf and dev.off but using ggsave is more convenient when the plots are built using the package ggplot, which is our case.

However, challenge 1 in lesson 8 asks the readers to save in a single file several plots in different pages; which ggsave doesn't support currently, unless using the function marrangeGrob from the package gridExtra (Check Masood Sadat's answer to this question). I'm against adding the package gridExtra to lesson 8 just for solving one challange.

I guess we could add code using ggsave as an alternative to pdf & dev.off just after the challenge.

from r-intro-geospatial.

mikemahoney218 avatar mikemahoney218 commented on May 26, 2024

Is there a reason we need that challenge? How often is that a task people are trying to accomplish? This isn't something I am commonly trying to do; I feel like I'm either sending people multiple PNGs, or incorporating graphs into an R Markdown/Quarto document to get a single PDF.

We could maybe change the challenge to a ggsave()-based task if that's more relevant for learners.

from r-intro-geospatial.

albhasan avatar albhasan commented on May 26, 2024

I think challenge 1 is needed. Lesson 8 contains 2 topics, saving plots and writing CSV data, and accordingly, it has one challenge for each topic.

I'm also in favor of showing readers how to use both pdf & dev.off functions, because they're the traditional way of saving plots (by traditional I mean before the tidyverse) and there is a lot of code still using them.

from r-intro-geospatial.

albhasan avatar albhasan commented on May 26, 2024

I see your point @mikemahoney218, I think you're right. I'm going to change both the text and the challenge to use only ggsave.

from r-intro-geospatial.

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.