--
You received this message because you are subscribed to the Google Groups "rapport-package" group.
To post to this group, send email to rapport...@googlegroups.com
To unsubscribe from this group, send email to
rapport-packa...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rapport-package?hl=en?hl=en or project homepage at http://rapport-package.info/
Oh, and note that you don't need to provide data in that case, as it defaults to NULL.
So I'd say: just define some metadata (Author, Title, Description), and put a chunk like this one:
<%
source("script.R")
%>
And now we'll print the dataset "foobar":
<%
foobar
%>
That's pretty much it...
f <- ftable(Titanic, row.vars = 1:2, col.vars = "Survived")df <- as.data.frame(f)
<!--headTitle: Print HTML tablesAuthor: Roman LuštrikDescription: Report that prints pretty HTML tables.Packages: baseData required: TRUE
head-->
ftable of _<%names(rp.data)[ncol(rp.data)-1]%>_:<%df <- rp.datadf <- cast(df, as.formula(sprintf('%s ~ %s', paste(names(df)[1:(ncol(df)-2)], collapse = ' + '), names(df)[ncol(df)-1])), value = tail(names(df), 1))df%>
<%df <- rp.datadf <- cast(df, as.formula(sprintf('%s ~ %s', paste(names(df)[1:(ncol(df)-2)], collapse = ' + '), names(df)[ncol(df)-1])), value = tail(names(df), 1))for (i in 1:ncol(df)) {df[c(FALSE, as.character(df[2:nrow(df), i]) == as.character(df[1:nrow(df)-1, i])), i] <- NA}df%><%df <- rp.datadf <- cast(df, as.formula(sprintf('%s ~ %s', paste(names(df)[1:(ncol(df)-2)], collapse = ' + '), names(df)[ncol(df)-1])), value = tail(names(df), 1))paste(capture.output(ascii(df[, 2:ncol(df)], lgroup = names(table(df[ ,1])), include.rownames = FALSE)), collapse = '\n')%>
This is pretty similar to what I have:library(ftable)
ftable(Titanic, row.vars = 1:2, col.vars = "Survived")Cheers,Roman
--
In God we trust, all others bring data.