Giter Club home page Giter Club logo

Comments (4)

bart6114 avatar bart6114 commented on July 29, 2024

@rpietro would #4 be sufficient for your use case? If not can you give me a concrete example? How would you structure the file?

from infuser.

rpietro avatar rpietro commented on July 29, 2024

hey @bart6114 this definitely helps, but I think that creating a csv would be easier for a really large number of fields, say 30 or more as in my case. for example, if you have a csv like:

a,1
b,2
c,3
...

a function within infuser taking a csv would parse the file using something like:

v1 <- read.csv("data.csv", header=FALSE)$V1
v2 <- read.csv("data.csv", header=FALSE)$V2
mylist <- as.list(paste(v1,"=",v2))

from infuser.

bart6114 avatar bart6114 commented on July 29, 2024

As your example shows it is very easy to read in the csv yourself and convert it in a named list. I'm not going to implement this because I don't believe there is a consensus on what is the best text file structure for this is, nor want to specify the text file structure myself.

The extra code required is quite limited and, as is its up to the end-user, he retains flexibility in file structuring.

## extra needed code
mydata<-read.csv("data.csv", header=FALSE)
my_list <- as.list(mydata$V2)
names(my_list) <- mydata$V1

## the infuse code
infuse(template, my_list)

from infuser.

rpietro avatar rpietro commented on July 29, 2024

makes sense, thanks

from infuser.

Related Issues (11)

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.