edwindj / whisker

{{mustache}} for R
https://mustache.github.io
213 stars 19 forks source link

no example for rowSplit() #9

Closed nbest937 closed 10 years ago

nbest937 commented 10 years ago

Do you happen to have a simple example to illustrate how to use rowSplit()? It would be a big help. Dank u vriendelijk!

edwindj commented 10 years ago

Thanks for trying out whisker, the following example should work.

dat <- head(InsectSprays)
dat <- unname(rowSplit(dat))

template <- 
"{{#dat}}
count: {{count}}, spray: {{spray}}\n
{{/dat}}"

whisker.render(template)

Seems you found a small bug in rowSplit (the unname will be part of rowSplit in the next release).