This repository has been archived by the owner on Oct 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'data' added and internal function 'checkClass' added.
- Loading branch information
agaye
committed
Jul 11, 2014
1 parent
984513a
commit 96c4aa7
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' | ||
#' @title Checks that an object has the same class in all studies | ||
#' @description This is an internal function. | ||
#' @details In DataSHIELD an object included in analysis must be of the same type in all | ||
#' the collaborating studies. If that is not the case the process is stopped | ||
#' @param datasources a list of opal object(s) obtained after login in to opal servers; | ||
#' these objects hold also the data assign to R, as \code{dataframe}, from opal datasources. | ||
#' @param obj a string charcater, the name of the object to check for. | ||
#' @keywords internal | ||
#' @return a message or the class of the object if the object has the same class in all studies. | ||
#' | ||
checkClass <- function(datasources=NULL, obj=NULL){ | ||
# check the class of the input object | ||
cally <- paste0("class(", obj, ")") | ||
objtype <- unique(unlist(datashield.aggregate(datasources, cally))) | ||
if(length(objtype) > 1){ | ||
message("The input data is not of the same class in all studies!") | ||
message("Use the function 'ds.class' to verify the class of the input object in each study.") | ||
stop(" End of process!", call.=FALSE) | ||
}else{ | ||
return(objtype) | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
\name{checkClass} | ||
\alias{checkClass} | ||
\title{Checks that an object has the same class in all studies} | ||
\usage{ | ||
checkClass(datasources = NULL, obj = NULL) | ||
} | ||
\arguments{ | ||
\item{datasources}{a list of opal object(s) obtained | ||
after login in to opal servers; these objects hold also | ||
the data assign to R, as \code{dataframe}, from opal | ||
datasources.} | ||
|
||
\item{obj}{a string charcater, the name of the object to | ||
check for.} | ||
} | ||
\value{ | ||
a message or the class of the object if the object has the | ||
same class in all studies. | ||
} | ||
\description{ | ||
This is an internal function. | ||
} | ||
\details{ | ||
|
||
|
||
In DataSHIELD an object included in analysis must be of the | ||
same type in all the collaborating studies. If that is not | ||
the case the process is stopped | ||
} | ||
\keyword{internal} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
\name{logindata} | ||
|
||
\alias{logindata} | ||
|
||
\docType{data} | ||
|
||
\title{Information required to login to opal servers} | ||
|
||
\description{ | ||
A table of with 5 columns: study name, URL, username, password and opal datasource. | ||
} | ||
|
||
\usage{data(logindata)} | ||
|
||
\format{ | ||
A data frame where the number of servers corresponds to the number of rows | ||
\describe{ | ||
\item{\code{server}}{a character, the formal name of the study} | ||
\item{\code{url}}{URL of the opal server} | ||
\item{\code{user}}{a character, a formal username or a | ||
path to a valid ssl certificate, if required} | ||
\item{\code{password}}{a character, a formal password or a | ||
path to a valid ssl key if required} | ||
\item{\code{table}}{a character, the path to the opal datasource that holds the data | ||
to analyse} | ||
} | ||
} | ||
|
||
\examples{data(logindata)} |