diff --git a/R/ZenodoManager.R b/R/ZenodoManager.R index a19da42..7862d19 100644 --- a/R/ZenodoManager.R +++ b/R/ZenodoManager.R @@ -327,6 +327,17 @@ ZenodoManager <- R6Class("ZenodoManager", return(out) }, + #' @description Get grants by name. + #' @param name name + #' @param pretty Prettify the output. By default the argument \code{pretty} is set to + #' \code{TRUE} which will returns the list of grants as \code{data.frame}. + #' Set \code{pretty = FALSE} to get the raw list of grants + #' @return list of grants as \code{data.frame} or \code{list} + getGrantsByName = function(name, pretty = TRUE){ + query = sprintf("title:%s", URLencode(paste0("\"",name,"\""))) + self$getGrants(q = query, pretty = pretty) + }, + #' @description Get grant by Id. #' @param id grant id #' @return the grant diff --git a/man/ZenodoManager.Rd b/man/ZenodoManager.Rd index a3806a4..6b6ac6b 100644 --- a/man/ZenodoManager.Rd +++ b/man/ZenodoManager.Rd @@ -95,6 +95,7 @@ Emmanuel Blondel \item \href{#method-ZenodoManager-getCommunities}{\code{ZenodoManager$getCommunities()}} \item \href{#method-ZenodoManager-getCommunityById}{\code{ZenodoManager$getCommunityById()}} \item \href{#method-ZenodoManager-getGrants}{\code{ZenodoManager$getGrants()}} +\item \href{#method-ZenodoManager-getGrantsByName}{\code{ZenodoManager$getGrantsByName()}} \item \href{#method-ZenodoManager-getGrantById}{\code{ZenodoManager$getGrantById()}} \item \href{#method-ZenodoManager-getFunders}{\code{ZenodoManager$getFunders()}} \item \href{#method-ZenodoManager-getFundersByName}{\code{ZenodoManager$getFundersByName()}} @@ -293,6 +294,30 @@ list of grants as \code{data.frame} or \code{list} } } \if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ZenodoManager-getGrantsByName}{}}} +\subsection{Method \code{getGrantsByName()}}{ +Get grants by name. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{ZenodoManager$getGrantsByName(name, pretty = TRUE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{name}}{name} + +\item{\code{pretty}}{Prettify the output. By default the argument \code{pretty} is set to +\code{TRUE} which will returns the list of grants as \code{data.frame}. +Set \code{pretty = FALSE} to get the raw list of grants} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +list of grants as \code{data.frame} or \code{list} +} +} +\if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-ZenodoManager-getGrantById}{}}} \subsection{Method \code{getGrantById()}}{