Description Usage Arguments Details Value Author(s) Examples
This function adds attachments to a database document that already exists.
1 | cdbAddAttachment(cdb)
|
cdb |
The list |
The function uses the RCurl
- function
guessMIMEType()
to do exactly this: guessing the mime type of
cdb$fileName
.
If the switch cdb$attachmentsWithPath
is set to TRUE
the attachment is saved with the path. This behavior is default
since version 0.2.5 of R4CouchDB
cdb |
The result is stored in |
wactbprot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
ccc <- cdbIni(DBName="r4couch_db")
ccc$dataList <- list(normalDistRand = rnorm(20))
ccc <- cdbAddDoc(ccc)
# make a 3d plot (stolen from ?persp)
x <- seq(-10, 10, length= 30)
y <- x
f <- function(x,y) {r <- sqrt(x^2+y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
z[is.na(z)] <- 1
op <- par(bg = "black")
ccc$fileName <- "3dplot.pdf"
pdf(ccc$fileName)
persp(x, y, z,
theta = 30,
phi = 30,
expand = 0.5,
col = "lightblue")
dev.off()
# add the plot as attachment to the database
# it workes over ccc$fileName
ccc <- cdbAddAttachment(ccc)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.