R/dvMetadata.r

Defines functions dvMetadata

Documented in dvMetadata

dvMetadata <- function(objectid, format.type=NULL, include=NULL, exclude=NULL,
						dv = getOption('dvn'), browser=FALSE, ...){
	if(inherits(objectid, 'dvStudyAtom'))
        objectid <- objectid$objectId
    if(is.null(format.type)){
		query <- objectid
		if(!is.null(include))
			query <- paste(query,"/?partialInclude=",include,sep="")
		if(!is.null(exclude))
			query <- paste(query,"/?partialExclude=",exclude,sep="")
	}
	else{
		query <- paste(objectid,"/?formatType=",format.type,sep="")
		if(!is.null(include))
			query <- paste(query,"&partialInclude=",include,sep="")
		if(!is.null(exclude))
			query <- paste(query,"&partialExclude=",exclude,sep="")
	}
	xml <- dvQuery(verb = "metadata", query = query, dv = dv, browser=browser, ...)
	if(is.null(xml))
		invisible(NULL)
	else if(browser==FALSE){
        class(xml) <- c(class(xml),'dvMetadata')
        attr(xml,'formatName') <- ifelse(!is.null(format.type),format.type,'ddi')
		return(xml)
    }
}

Try the dvn package in your browser

Any scripts or data that you put into this service are public.

dvn documentation built on May 29, 2017, 5:53 p.m.