if (FALSE) {
# Get info on an image
uuid <- "9fae30cd-fb59-4a81-a39c-e1826a35f612"
image_get(uuid = uuid)
image_get(uuid = uuid, options=c('credit','pngFiles','taxa','canonicalName','string','uri','type'))
image_get(uuid = uuid, options=c('credit','licenseURL','pngFiles','submitted','submitter',
'svgFile','taxa','canonicalName','string','uri','type','citationStart'))
# Count images in Phylopic database
image_count()
image_count(verbose = TRUE)
# Lists images in chronological order, from most to least recently modified
image_list(start=1, length=10)
image_list(start=1, length=10, options="taxa")
# Lists images within a given time range, from most to least recent
image_timerange(from="2013-05-11")
image_timerange(from="2013-05-11", to="2013-05-12")
image_timerange(from="2013-05-11", to="2013-05-12", options='credit')
# Get data for an image
## input uuids
toget <- c("c089caae-43ef-4e4e-bf26-973dd4cb65c5", "41b127f6-0824-4594-a941-5ff571f32378",
"9c6af553-390c-4bdd-baeb-6992cbc540b1")
image_data(toget, size = "64")
image_data(toget, size = "thumb")
## input the output from search_images
x <- search_text(text = "Homo sapiens", options = "names")
output <- search_images(x[1:10], options=c("pngFiles", "credit", "canonicalName"))
image_data(output, size = "64")
## Put a silhouette behind a plot
library('ggplot2')
img <- image_data("27356f15-3cf8-47e8-ab41-71c6260b2724", size = "512")[[1]]
qplot(x=Sepal.Length, y=Sepal.Width, data=iris, geom="point") + add_phylopic(img)
## Use as points in a ggplot plot
library('ggplot2')
uuid <- "c089caae-43ef-4e4e-bf26-973dd4cb65c5"
img <- image_data(uuid, size = "64")[[1]]
(p <- ggplot(mtcars, aes(drat, wt)) + geom_blank())
for(i in 1:nrow(mtcars)) p <- p + add_phylopic(img, 1, mtcars$drat[i], mtcars$wt[i], ysize = 0.3)
p
}
Run the code above in your browser using DataLab