@@ -864,6 +864,12 @@ chembl_compare_service <- function(
864864# ' @return A list with the comparison status and any unique elements found in
865865# ' either input.
866866# ' @noRd
867+ # ' @examples
868+ # ' \dontrun{
869+ # ' ws <- chembl_query("CHEMBL1082", resource = "molecule")
870+ # ' off <- chembl_query("CHEMBL1082", resource = "molecule", mode = "offline")
871+ # ' compare_service_lists(ws$CHEMBL1082, off$CHEMBL1082)
872+ # ' }
867873compare_service_lists <- function (ws , offline ) {
868874 ws_na <- length(ws ) == 1 && is.na(ws )
869875 offline_na <- length(offline ) == 1 && is.na(offline )
@@ -904,8 +910,10 @@ compare_service_lists <- function(ws, offline) {
904910 if (is.atomic(ws_elem )) {
905911 if (! identical(ws_elem , off_elem )) {
906912 stop(sprintf(
907- " Atomic element '%s' differs between webservice and offline.\n " ,
908- " Webservice value: %s\n Offline value: %s" ,
913+ paste0(
914+ " Atomic element '%s' differs between webservice and offline.\n " ,
915+ " Webservice value: %s\n Offline value: %s"
916+ ),
909917 n ,
910918 paste0(utils :: capture.output(print(ws_elem )), collapse = " \n " ),
911919 paste0(utils :: capture.output(print(off_elem )), collapse = " \n " )
@@ -926,12 +934,12 @@ compare_service_lists <- function(ws, offline) {
926934 } else {
927935 stop(sprintf(" Element '%s' should be either atomic or a data frame." , n ))
928936 }
929- return (list (
930- status = " OK" ,
931- ws_extra = ws_unique_element ,
932- offline_extra = offline_unique_element
933- ))
934937 }
938+ return (list (
939+ status = " OK" ,
940+ ws_extra = ws_unique_element ,
941+ offline_extra = offline_unique_element
942+ ))
935943}
936944
937945# ' Compare Two Named Lists of Atomic Elements
0 commit comments