Giter Site home page Giter Site logo

Comments (5)

mikemahoney218 avatar mikemahoney218 commented on May 26, 2024 2

re: 2, I believe (though haven't confirmed) that you can use forward slashes on Windows, it's just not how system commands return file paths 😄 (Update around 12:30 Eastern time -- I got a friend to run file.exists(gsub("\\\\", "/", list.files(full.names = TRUE)[[1]])) for me to confirm that, yes, forward slashes are at least fine on their Windows machine)

As for the main conversation, I'm going to tag in @datacarpentry/curriculum-advisors-geospatial for some additional opinions! It's worth noting that we use relative paths throughout the workshop (for instance, https://preview.carpentries.org/r-raster-vector-geospatial/01-raster-structure.html ) and not just in this lesson, so if we made this change I think it'd ideally be applied across lessons.

from r-intro-geospatial.

mikemahoney218 avatar mikemahoney218 commented on May 26, 2024 1

Sorry for the delay on this issue! After talking with the rest of the CAC, we decided:

  1. We currently don't want to switch the workshop (both this lesson as well as the other lessons) over to using here; while we use and love the package, we worry that introducing the package at the start of the project management lesson will confuse learners. We'd rather keep focusing on using R projects and relative paths for filesystem management.
  2. That said, we think it's worth adding an instructor note both to mention "if you want to introduce here, this is a good place to do it" and to have instructors ensure all learners are using a new project.

from r-intro-geospatial.

lquayle88 avatar lquayle88 commented on May 26, 2024 1

@mikemahoney218 Thanks for the reply. I had forgotten about this to be honest 😅 I think based on what you said that's a good compromise. I hope it was a useful conversation. I love here and find that my students find it easy to understand for managing paths within a project so just thought it was a suggestion worth raising 😊

from r-intro-geospatial.

mikemahoney218 avatar mikemahoney218 commented on May 26, 2024

Howdy @lquayle88 ! I'm one of the maintainers for this lesson 😄

Would you be able to show me where in the lesson you'd like to change to use here? I see getwd() in the episode 2 intro, but not anywhere else in the project. I agree that using here is a good practice, but would be a bit worried about losing focus if we went into the details of the here package, especially if the rest of the lesson is using relative paths and not moving the working directory around.

from r-intro-geospatial.

lquayle88 avatar lquayle88 commented on May 26, 2024

Hi @mikemahoney218. Thanks for the speedy reply!

Yes, getwd() is used in the introduction of the project so I was suggesting replacing that with a brief introduction to here for two reasons:

  1. getwd() works in the manner suggested when the working directory has defaulted to the project top level upon opening a project but will not work if this changes for some reason (nor will any relative path used later in the lesson) but here() will always find the path to the top level of an open project; in essence it is just more robust

  2. later in the lesson relative paths are built (to read the data for example) and using here will not only ensure these paths are robust in the event that the working directory becomes altered (this can happen), but also means that the paths can be built in a system agnostic manner; some users may be using windows machines on which backslashes are used rather than forward slashes and the relative paths in the later episodes all show forward slashes.

I understand the balancing act when it comes to focus but given that using here appears to be creeping in as the "best practice" when it comes to writing portable R code and how quickly it could be covered to a sufficient level, it is my opinion that an episode called "Project Management in RStudio" would be the ideal place to lay this foundation for novice users.

All of this is just a suggestion of course 😊

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.