The following instructions work in the DataSHIELD test environment only. |
write.csv
or write.table
R functions to write tables to file# output to the R console > ds.table(rvar='D$DIS_DIAB', cvar='D$GENDER') # prints into a file called test_table.csv in the current working directory > write.csv(x=ds.table(rvar='D$DIS_DIAB', cvar='D$GENDER'), file = "test_table.csv") |
In R it is possible to print sequential images on sequential pages.
png()
, pdf()
or postscript()
needs to be opened.# a png example png(filename = "image_name.png", width = 900, height = 700, units = "px", pointsize = 12, bg = "white", type = "cairo") ds.histogram(x='D$LAB_HDL') dev.off() |
ds.histogram
commands onto seperate pages. Each line is output to a seperate page in the pdf.# a pdf example pdf(file = "image_name.pdf") ds.histogram(x='D$LAB_HDL') ds.histogram(x='D$LAB_HDL', type='split') dev.off() |
# a postscript example postscript(file = "image_name.ps", paper = "special", width = 9, height = 7, onefile = TRUE, horizontal = FALSE) ds.histogram(x='D$LAB_HDL') ds.histogram(x='D$LAB_HDL', type='split') dev.off() |
In some cases the non-disclosive data used to create an image may be required, this can be printed to file using the capture.output
R function:
# print to file the non-disclosive data that comprises a histogram out <- capture.output(ds.histogram(x='D$LAB_HDL')) cat(out, file="name.txt", sep="\n", append=TRUE) |
All arguments to customise the above functions can be found in their respective function manual pages. |