Code Monkey home page Code Monkey logo

Comments (4)

jennybc avatar jennybc commented on September 13, 2024

I think I don't understand enough about how fertile is put together and the context for "somebody just tries to use read_csv()" to be helpful at this moment. But maybe it will be more clear after getting an intro in group meeting next week.

from fertile.

beanumber avatar beanumber commented on September 13, 2024

So there are at least two importantly different use cases here:

  1. In interactive mode, you might do:
library(tidyverse)
library(fertile)
read_csv("mydata.csv")
  1. In retrospective mode, you might do:
fertile::has_no_absolute_paths()

In the first case, the read_csv() shim writes this action to a log file. But where is it? Well, by default it looks for the project root and puts it in the log file there.

In the second case, it's pointless to look at the same log file, because that file contains the actions the user made interactively. So we have to render the code in the project (using proj_render()), all the while recording the user actions in a different (clean) log file. But how is the shimmed version of read_csv() supposed to know which log file to write to? It can't be an option to fertile::read_csv() (because no user is ever going to specify that location), so it has to be some kind of global variable.

Right??

So I'm wondering whether fertile should explicitly maintain:

  1. a per-session log file (e.g., file_temp())
  2. a persistent log file that lives in the project root (e.g., maybe just concatenate the per-session log files?)
  3. other per-session log files generated by proj_render()

It's seems likely to me that this is an easy problem to solve, but I just don't understand sessions, environments, and global variables well enough at the moment.

The answer will help with #34.

from fertile.

jennybc avatar jennybc commented on September 13, 2024

I continue to not be immersed enough in fertile to have ready and great answers.

But I think another candidate location to have on your radar is ~/.R/fertile, if you end up feeling like something should be recorded but has no natural and specific home.

from fertile.

beanumber avatar beanumber commented on September 13, 2024

@hadley agrees with @jennybc about keeping track of it in a .fertile file somewhere.

Also, possible use Sys.setenv() to keep track of it.

from fertile.

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.