feVehicle <-
function(id = NULL, pick = FALSE, ...) {
if (pick) {
id <- pickVehicle(...)
}
response <- feQuery(paste("vehicle", id, sep = "/"))
if (is.null(response)) {
return(NULL)
}
out <- xmlToList(response)
class(out) <- c("feVehicle", class(out))
return(out)
}
print.feVehicle <- function(x, ...) {
d <- setNames(data.frame(t(rbind(x))), "value")
cat("Vehicle data:\n")
print(d[!rownames(d) == "emissionsList", , drop = FALSE])
if (!is.null(x$emissionsList)) {
cat("\nEmissions List:\n")
print.feVehicleEmissions(x$emissionsList)
}
return(invisible(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.