Comments (4)
@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.
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.
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.
makes sense, thanks
from infuser.
Related Issues (11)
- Add SQL escaping HOT 6
- Suggestion for parameters HOT 1
- naive question HOT 1
- Incorrect replacing for parameters with same prefix HOT 1
- issues when using specific variable_identifier HOT 3
- control flow? HOT 1
- misplaced brackets in `read_template` HOT 2
- set warn to FALSE on default
- Add option to stop when failing to fill template HOT 6
- Infuser removed from cran? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infuser.