diff --git a/R/Agent.r b/R/Agent.r index 13abe06..b8ec9bd 100644 --- a/R/Agent.r +++ b/R/Agent.r @@ -31,7 +31,7 @@ Agent <- R6::R6Class( AgentList[["agentText"]] <- self[["agentText"]] } ## omit empty nested lists in returned list - AgentList[sapply(AgentList, length) > 0] + AgentList[vapply(AgentList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(AgentList, typeMapping = NULL) { diff --git a/R/AssociatedTaxon.r b/R/AssociatedTaxon.r index bbc457b..7e78ded 100644 --- a/R/AssociatedTaxon.r +++ b/R/AssociatedTaxon.r @@ -40,7 +40,7 @@ AssociatedTaxon <- R6::R6Class( AssociatedTaxonList[["relationType"]] <- self[["relationType"]] } ## omit empty nested lists in returned list - AssociatedTaxonList[sapply(AssociatedTaxonList, length) > 0] + AssociatedTaxonList[vapply(AssociatedTaxonList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(AssociatedTaxonList, typeMapping = NULL) { diff --git a/R/BioStratigraphy.r b/R/BioStratigraphy.r index 37c43d5..e411a10 100644 --- a/R/BioStratigraphy.r +++ b/R/BioStratigraphy.r @@ -156,7 +156,7 @@ BioStratigraphy <- R6::R6Class( BioStratigraphyList[["oldBioStratType"]] <- self[["oldBioStratType"]] } ## omit empty nested lists in returned list - BioStratigraphyList[sapply(BioStratigraphyList, length) > 0] + BioStratigraphyList[vapply(BioStratigraphyList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(BioStratigraphyList, typeMapping = NULL) { diff --git a/R/ChronoStratigraphy.r b/R/ChronoStratigraphy.r index 9b7dae3..1591440 100644 --- a/R/ChronoStratigraphy.r +++ b/R/ChronoStratigraphy.r @@ -255,7 +255,7 @@ ChronoStratigraphy <- R6::R6Class( ChronoStratigraphyList[["oldCertainty"]] <- self[["oldCertainty"]] } ## omit empty nested lists in returned list - ChronoStratigraphyList[sapply(ChronoStratigraphyList, length) > 0] + ChronoStratigraphyList[vapply(ChronoStratigraphyList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(ChronoStratigraphyList, typeMapping = NULL) { diff --git a/R/Crs.r b/R/Crs.r index 2de3cf2..fe8ce32 100644 --- a/R/Crs.r +++ b/R/Crs.r @@ -39,7 +39,7 @@ Crs <- R6::R6Class( CrsList[["properties"]] <- self[["properties"]] } ## omit empty nested lists in returned list - CrsList[sapply(CrsList, length) > 0] + CrsList[vapply(CrsList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(CrsList, typeMapping = NULL) { diff --git a/R/DefaultClassification.r b/R/DefaultClassification.r index 0a66abf..6038f1f 100644 --- a/R/DefaultClassification.r +++ b/R/DefaultClassification.r @@ -121,7 +121,7 @@ DefaultClassification <- R6::R6Class( DefaultClassificationList[["infraspecificRank"]] <- self[["infraspecificRank"]] } ## omit empty nested lists in returned list - DefaultClassificationList[sapply(DefaultClassificationList, length) > 0] + DefaultClassificationList[vapply(DefaultClassificationList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(DefaultClassificationList, typeMapping = NULL) { diff --git a/R/Expert.r b/R/Expert.r index 43351ed..44028a8 100644 --- a/R/Expert.r +++ b/R/Expert.r @@ -49,7 +49,7 @@ Expert <- R6::R6Class( ExpertList[["organization"]] <- self[["organization"]]$toList() } ## omit empty nested lists in returned list - ExpertList[sapply(ExpertList, length) > 0] + ExpertList[vapply(ExpertList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(ExpertList, typeMapping = NULL) { diff --git a/R/Feature.r b/R/Feature.r index 789254d..d9557e8 100644 --- a/R/Feature.r +++ b/R/Feature.r @@ -66,7 +66,7 @@ Feature <- R6::R6Class( FeatureList[["id"]] <- self[["id"]] } ## omit empty nested lists in returned list - FeatureList[sapply(FeatureList, length) > 0] + FeatureList[vapply(FeatureList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(FeatureList, typeMapping = NULL) { diff --git a/R/FeatureCollection.r b/R/FeatureCollection.r index 9d634b8..989bc0b 100644 --- a/R/FeatureCollection.r +++ b/R/FeatureCollection.r @@ -51,7 +51,7 @@ FeatureCollection <- R6::R6Class( FeatureCollectionList[["features"]] <- lapply(self[["features"]], function(x) x$toList()) } ## omit empty nested lists in returned list - FeatureCollectionList[sapply(FeatureCollectionList, length) > 0] + FeatureCollectionList[vapply(FeatureCollectionList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(FeatureCollectionList, typeMapping = NULL) { diff --git a/R/Filter.r b/R/Filter.r index 29694e5..7829f05 100644 --- a/R/Filter.r +++ b/R/Filter.r @@ -60,7 +60,7 @@ Filter <- R6::R6Class( FilterList[["rejectValues"]] <- self[["rejectValues"]] } ## omit empty nested lists in returned list - FilterList[sapply(FilterList, length) > 0] + FilterList[vapply(FilterList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(FilterList, typeMapping = NULL) { diff --git a/R/GatheringEvent.r b/R/GatheringEvent.r index d635e47..cee63e6 100644 --- a/R/GatheringEvent.r +++ b/R/GatheringEvent.r @@ -273,7 +273,7 @@ GatheringEvent <- R6::R6Class( GatheringEventList[["bioStratigraphic"]] <- lapply(self[["bioStratigraphic"]], function(x) x$toList()) } ## omit empty nested lists in returned list - GatheringEventList[sapply(GatheringEventList, length) > 0] + GatheringEventList[vapply(GatheringEventList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GatheringEventList, typeMapping = NULL) { diff --git a/R/GatheringSiteCoordinates.r b/R/GatheringSiteCoordinates.r index 5551cbe..763b5f5 100644 --- a/R/GatheringSiteCoordinates.r +++ b/R/GatheringSiteCoordinates.r @@ -94,7 +94,7 @@ GatheringSiteCoordinates <- R6::R6Class( GatheringSiteCoordinatesList[["geoShape"]] <- self[["geoShape"]]$toList() } ## omit empty nested lists in returned list - GatheringSiteCoordinatesList[sapply(GatheringSiteCoordinatesList, length) > 0] + GatheringSiteCoordinatesList[vapply(GatheringSiteCoordinatesList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GatheringSiteCoordinatesList, typeMapping = NULL) { diff --git a/R/GeoArea.r b/R/GeoArea.r index 3c0d675..b7affdf 100644 --- a/R/GeoArea.r +++ b/R/GeoArea.r @@ -111,7 +111,7 @@ GeoArea <- R6::R6Class( GeoAreaList[["countryNL"]] <- self[["countryNL"]] } ## omit empty nested lists in returned list - GeoAreaList[sapply(GeoAreaList, length) > 0] + GeoAreaList[vapply(GeoAreaList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GeoAreaList, typeMapping = NULL) { diff --git a/R/GeoClient.r b/R/GeoClient.r index 07038c4..ecb8c05 100644 --- a/R/GeoClient.r +++ b/R/GeoClient.r @@ -134,7 +134,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -168,7 +168,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -262,7 +262,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -322,7 +322,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -434,7 +434,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -468,7 +468,7 @@ GeoClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, diff --git a/R/GeoJsonObject.r b/R/GeoJsonObject.r index 860dedf..ffef9e6 100644 --- a/R/GeoJsonObject.r +++ b/R/GeoJsonObject.r @@ -41,7 +41,7 @@ GeoJsonObject <- R6::R6Class( GeoJsonObjectList[["bbox"]] <- self[["bbox"]] } ## omit empty nested lists in returned list - GeoJsonObjectList[sapply(GeoJsonObjectList, length) > 0] + GeoJsonObjectList[vapply(GeoJsonObjectList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GeoJsonObjectList, typeMapping = NULL) { diff --git a/R/GeometryCollection.r b/R/GeometryCollection.r index 75f1853..139c2b9 100644 --- a/R/GeometryCollection.r +++ b/R/GeometryCollection.r @@ -51,7 +51,7 @@ GeometryCollection <- R6::R6Class( GeometryCollectionList[["geometries"]] <- self[["geometries"]] } ## omit empty nested lists in returned list - GeometryCollectionList[sapply(GeometryCollectionList, length) > 0] + GeometryCollectionList[vapply(GeometryCollectionList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GeometryCollectionList, typeMapping = NULL) { diff --git a/R/GroupByScientificNameQuerySpec.r b/R/GroupByScientificNameQuerySpec.r index 28116c1..60458ac 100644 --- a/R/GroupByScientificNameQuerySpec.r +++ b/R/GroupByScientificNameQuerySpec.r @@ -141,7 +141,7 @@ GroupByScientificNameQuerySpec <- R6::R6Class( GroupByScientificNameQuerySpecList[["noTaxa"]] <- self[["noTaxa"]] } ## omit empty nested lists in returned list - GroupByScientificNameQuerySpecList[sapply(GroupByScientificNameQuerySpecList, length) > 0] + GroupByScientificNameQuerySpecList[vapply(GroupByScientificNameQuerySpecList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(GroupByScientificNameQuerySpecList, typeMapping = NULL) { diff --git a/R/Iptc4xmpExt.r b/R/Iptc4xmpExt.r index cd92493..9b24172 100644 --- a/R/Iptc4xmpExt.r +++ b/R/Iptc4xmpExt.r @@ -85,7 +85,7 @@ Iptc4xmpExt <- R6::R6Class( Iptc4xmpExtList[["sublocation"]] <- self[["sublocation"]] } ## omit empty nested lists in returned list - Iptc4xmpExtList[sapply(Iptc4xmpExtList, length) > 0] + Iptc4xmpExtList[vapply(Iptc4xmpExtList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(Iptc4xmpExtList, typeMapping = NULL) { diff --git a/R/LineString.r b/R/LineString.r index 6d274a8..9032408 100644 --- a/R/LineString.r +++ b/R/LineString.r @@ -51,7 +51,7 @@ LineString <- R6::R6Class( LineStringList[["coordinates"]] <- lapply(self[["coordinates"]], function(x) x$toList()) } ## omit empty nested lists in returned list - LineStringList[sapply(LineStringList, length) > 0] + LineStringList[vapply(LineStringList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(LineStringList, typeMapping = NULL) { diff --git a/R/LithoStratigraphy.r b/R/LithoStratigraphy.r index 6bf2964..723bea9 100644 --- a/R/LithoStratigraphy.r +++ b/R/LithoStratigraphy.r @@ -174,7 +174,7 @@ LithoStratigraphy <- R6::R6Class( LithoStratigraphyList[["bed"]] <- self[["bed"]] } ## omit empty nested lists in returned list - LithoStratigraphyList[sapply(LithoStratigraphyList, length) > 0] + LithoStratigraphyList[vapply(LithoStratigraphyList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(LithoStratigraphyList, typeMapping = NULL) { diff --git a/R/LngLatAlt.r b/R/LngLatAlt.r index 042e9b8..f533ebf 100644 --- a/R/LngLatAlt.r +++ b/R/LngLatAlt.r @@ -59,7 +59,7 @@ LngLatAlt <- R6::R6Class( LngLatAltList[["additionalElements"]] <- self[["additionalElements"]] } ## omit empty nested lists in returned list - LngLatAltList[sapply(LngLatAltList, length) > 0] + LngLatAltList[vapply(LngLatAltList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(LngLatAltList, typeMapping = NULL) { diff --git a/R/MetadataClient.r b/R/MetadataClient.r index 00f7430..08c64f1 100644 --- a/R/MetadataClient.r +++ b/R/MetadataClient.r @@ -294,7 +294,7 @@ MetadataClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, diff --git a/R/Monomial.r b/R/Monomial.r index 6348aad..92b6256 100644 --- a/R/Monomial.r +++ b/R/Monomial.r @@ -40,7 +40,7 @@ Monomial <- R6::R6Class( MonomialList[["name"]] <- self[["name"]] } ## omit empty nested lists in returned list - MonomialList[sapply(MonomialList, length) > 0] + MonomialList[vapply(MonomialList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MonomialList, typeMapping = NULL) { diff --git a/R/MultiLineString.r b/R/MultiLineString.r index 5c873c3..6ee3a73 100644 --- a/R/MultiLineString.r +++ b/R/MultiLineString.r @@ -51,7 +51,7 @@ MultiLineString <- R6::R6Class( MultiLineStringList[["coordinates"]] <- self[["coordinates"]] } ## omit empty nested lists in returned list - MultiLineStringList[sapply(MultiLineStringList, length) > 0] + MultiLineStringList[vapply(MultiLineStringList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiLineStringList, typeMapping = NULL) { diff --git a/R/MultiMediaContentIdentification.r b/R/MultiMediaContentIdentification.r index b51e9c1..2014a77 100644 --- a/R/MultiMediaContentIdentification.r +++ b/R/MultiMediaContentIdentification.r @@ -117,7 +117,7 @@ MultiMediaContentIdentification <- R6::R6Class( MultiMediaContentIdentificationList[["taxonomicEnrichments"]] <- lapply(self[["taxonomicEnrichments"]], function(x) x$toList()) } ## omit empty nested lists in returned list - MultiMediaContentIdentificationList[sapply(MultiMediaContentIdentificationList, length) > 0] + MultiMediaContentIdentificationList[vapply(MultiMediaContentIdentificationList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiMediaContentIdentificationList, typeMapping = NULL) { diff --git a/R/MultiMediaGatheringEvent.r b/R/MultiMediaGatheringEvent.r index 558675f..8f14661 100644 --- a/R/MultiMediaGatheringEvent.r +++ b/R/MultiMediaGatheringEvent.r @@ -282,7 +282,7 @@ MultiMediaGatheringEvent <- R6::R6Class( MultiMediaGatheringEventList[["bioStratigraphic"]] <- lapply(self[["bioStratigraphic"]], function(x) x$toList()) } ## omit empty nested lists in returned list - MultiMediaGatheringEventList[sapply(MultiMediaGatheringEventList, length) > 0] + MultiMediaGatheringEventList[vapply(MultiMediaGatheringEventList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiMediaGatheringEventList, typeMapping = NULL) { diff --git a/R/MultiMediaObject.r b/R/MultiMediaObject.r index 71d5db4..f5ac304 100644 --- a/R/MultiMediaObject.r +++ b/R/MultiMediaObject.r @@ -308,7 +308,7 @@ MultiMediaObject <- R6::R6Class( MultiMediaObjectList[["associatedTaxon"]] <- self[["associatedTaxon"]]$toList() } ## omit empty nested lists in returned list - MultiMediaObjectList[sapply(MultiMediaObjectList, length) > 0] + MultiMediaObjectList[vapply(MultiMediaObjectList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiMediaObjectList, typeMapping = NULL) { diff --git a/R/MultiPoint.r b/R/MultiPoint.r index 6b1e941..784c603 100644 --- a/R/MultiPoint.r +++ b/R/MultiPoint.r @@ -51,7 +51,7 @@ MultiPoint <- R6::R6Class( MultiPointList[["coordinates"]] <- lapply(self[["coordinates"]], function(x) x$toList()) } ## omit empty nested lists in returned list - MultiPointList[sapply(MultiPointList, length) > 0] + MultiPointList[vapply(MultiPointList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiPointList, typeMapping = NULL) { diff --git a/R/MultiPolygon.r b/R/MultiPolygon.r index d10f4e1..8c914d9 100644 --- a/R/MultiPolygon.r +++ b/R/MultiPolygon.r @@ -51,7 +51,7 @@ MultiPolygon <- R6::R6Class( MultiPolygonList[["coordinates"]] <- self[["coordinates"]] } ## omit empty nested lists in returned list - MultiPolygonList[sapply(MultiPolygonList, length) > 0] + MultiPolygonList[vapply(MultiPolygonList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(MultiPolygonList, typeMapping = NULL) { diff --git a/R/MultimediaClient.r b/R/MultimediaClient.r index 87e9192..7cf3115 100644 --- a/R/MultimediaClient.r +++ b/R/MultimediaClient.r @@ -168,7 +168,7 @@ MultimediaClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -300,7 +300,7 @@ MultimediaClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -360,7 +360,7 @@ MultimediaClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -442,7 +442,7 @@ MultimediaClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, diff --git a/R/NamedArea.r b/R/NamedArea.r index fd6896f..ddd6ee1 100644 --- a/R/NamedArea.r +++ b/R/NamedArea.r @@ -40,7 +40,7 @@ NamedArea <- R6::R6Class( NamedAreaList[["areaName"]] <- self[["areaName"]] } ## omit empty nested lists in returned list - NamedAreaList[sapply(NamedAreaList, length) > 0] + NamedAreaList[vapply(NamedAreaList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(NamedAreaList, typeMapping = NULL) { diff --git a/R/Organization.r b/R/Organization.r index 03bac67..048d657 100644 --- a/R/Organization.r +++ b/R/Organization.r @@ -40,7 +40,7 @@ Organization <- R6::R6Class( OrganizationList[["name"]] <- self[["name"]] } ## omit empty nested lists in returned list - OrganizationList[sapply(OrganizationList, length) > 0] + OrganizationList[vapply(OrganizationList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(OrganizationList, typeMapping = NULL) { diff --git a/R/Path.r b/R/Path.r index 7c564c3..71af815 100644 --- a/R/Path.r +++ b/R/Path.r @@ -30,7 +30,7 @@ Path <- R6::R6Class( PathList[["purePath"]] <- self[["purePath"]] } ## omit empty nested lists in returned list - PathList[sapply(PathList, length) > 0] + PathList[vapply(PathList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(PathList, typeMapping = NULL) { diff --git a/R/Person.r b/R/Person.r index 4db6753..56acdf8 100644 --- a/R/Person.r +++ b/R/Person.r @@ -49,7 +49,7 @@ Person <- R6::R6Class( PersonList[["organization"]] <- self[["organization"]]$toList() } ## omit empty nested lists in returned list - PersonList[sapply(PersonList, length) > 0] + PersonList[vapply(PersonList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(PersonList, typeMapping = NULL) { diff --git a/R/Point.r b/R/Point.r index 05d49bb..e0b11c4 100644 --- a/R/Point.r +++ b/R/Point.r @@ -50,7 +50,7 @@ Point <- R6::R6Class( PointList[["coordinates"]] <- self[["coordinates"]]$toList() } ## omit empty nested lists in returned list - PointList[sapply(PointList, length) > 0] + PointList[vapply(PointList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(PointList, typeMapping = NULL) { diff --git a/R/Polygon.r b/R/Polygon.r index a797a6d..8365cd4 100644 --- a/R/Polygon.r +++ b/R/Polygon.r @@ -51,7 +51,7 @@ Polygon <- R6::R6Class( PolygonList[["coordinates"]] <- self[["coordinates"]] } ## omit empty nested lists in returned list - PolygonList[sapply(PolygonList, length) > 0] + PolygonList[vapply(PolygonList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(PolygonList, typeMapping = NULL) { diff --git a/R/QueryCondition.r b/R/QueryCondition.r index 5ca607e..ae21cd5 100644 --- a/R/QueryCondition.r +++ b/R/QueryCondition.r @@ -93,7 +93,7 @@ QueryCondition <- R6::R6Class( QueryConditionList[["boost"]] <- self[["boost"]] } ## omit empty nested lists in returned list - QueryConditionList[sapply(QueryConditionList, length) > 0] + QueryConditionList[vapply(QueryConditionList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(QueryConditionList, typeMapping = NULL) { diff --git a/R/QueryResult.r b/R/QueryResult.r index 14e9ce9..a425234 100644 --- a/R/QueryResult.r +++ b/R/QueryResult.r @@ -41,7 +41,7 @@ QueryResult <- R6::R6Class( QueryResultList[["resultSet"]] <- lapply(self[["resultSet"]], function(x) x$toList()) } ## omit empty nested lists in returned list - QueryResultList[sapply(QueryResultList, length) > 0] + QueryResultList[vapply(QueryResultList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(QueryResultList, typeMapping = NULL) { diff --git a/R/QueryResultItem.r b/R/QueryResultItem.r index 5ce9698..209ada5 100644 --- a/R/QueryResultItem.r +++ b/R/QueryResultItem.r @@ -39,7 +39,7 @@ QueryResultItem <- R6::R6Class( QueryResultItemList[["item"]] <- self[["item"]] } ## omit empty nested lists in returned list - QueryResultItemList[sapply(QueryResultItemList, length) > 0] + QueryResultItemList[vapply(QueryResultItemList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(QueryResultItemList, typeMapping = NULL) { diff --git a/R/QueryResultItemObject.r b/R/QueryResultItemObject.r index 5f0105e..3168376 100644 --- a/R/QueryResultItemObject.r +++ b/R/QueryResultItemObject.r @@ -39,7 +39,7 @@ QueryResultItemObject <- R6::R6Class( QueryResultItemObjectList[["item"]] <- self[["item"]] } ## omit empty nested lists in returned list - QueryResultItemObjectList[sapply(QueryResultItemObjectList, length) > 0] + QueryResultItemObjectList[vapply(QueryResultItemObjectList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(QueryResultItemObjectList, typeMapping = NULL) { diff --git a/R/QuerySpec.r b/R/QuerySpec.r index aa98fe7..472af04 100644 --- a/R/QuerySpec.r +++ b/R/QuerySpec.r @@ -87,7 +87,7 @@ QuerySpec <- R6::R6Class( QuerySpecList[["size"]] <- self[["size"]] } ## omit empty nested lists in returned list - QuerySpecList[sapply(QuerySpecList, length) > 0] + QuerySpecList[vapply(QuerySpecList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(QuerySpecList, typeMapping = NULL) { diff --git a/R/Reference.r b/R/Reference.r index 8680a28..19a28ee 100644 --- a/R/Reference.r +++ b/R/Reference.r @@ -67,7 +67,7 @@ Reference <- R6::R6Class( ReferenceList[["publicationDate"]] <- self[["publicationDate"]] } ## omit empty nested lists in returned list - ReferenceList[sapply(ReferenceList, length) > 0] + ReferenceList[vapply(ReferenceList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(ReferenceList, typeMapping = NULL) { diff --git a/R/RestService.r b/R/RestService.r index 46ec69e..cc8eaf1 100644 --- a/R/RestService.r +++ b/R/RestService.r @@ -67,7 +67,7 @@ RestService <- R6::R6Class( RestServiceList[["url"]] <- self[["url"]] } ## omit empty nested lists in returned list - RestServiceList[sapply(RestServiceList, length) > 0] + RestServiceList[vapply(RestServiceList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(RestServiceList, typeMapping = NULL) { diff --git a/R/ScientificName.r b/R/ScientificName.r index f2c86db..eb26384 100644 --- a/R/ScientificName.r +++ b/R/ScientificName.r @@ -150,7 +150,7 @@ ScientificName <- R6::R6Class( ScientificNameList[["experts"]] <- lapply(self[["experts"]], function(x) x$toList()) } ## omit empty nested lists in returned list - ScientificNameList[sapply(ScientificNameList, length) > 0] + ScientificNameList[vapply(ScientificNameList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(ScientificNameList, typeMapping = NULL) { diff --git a/R/ServiceAccessPoint.r b/R/ServiceAccessPoint.r index a759b28..2100b0a 100644 --- a/R/ServiceAccessPoint.r +++ b/R/ServiceAccessPoint.r @@ -49,7 +49,7 @@ ServiceAccessPoint <- R6::R6Class( ServiceAccessPointList[["variant"]] <- self[["variant"]] } ## omit empty nested lists in returned list - ServiceAccessPointList[sapply(ServiceAccessPointList, length) > 0] + ServiceAccessPointList[vapply(ServiceAccessPointList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(ServiceAccessPointList, typeMapping = NULL) { diff --git a/R/SortField.r b/R/SortField.r index 9e88fdd..96fd414 100644 --- a/R/SortField.r +++ b/R/SortField.r @@ -47,7 +47,7 @@ SortField <- R6::R6Class( SortFieldList[["ascending"]] <- self[["ascending"]] } ## omit empty nested lists in returned list - SortFieldList[sapply(SortFieldList, length) > 0] + SortFieldList[vapply(SortFieldList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SortFieldList, typeMapping = NULL) { diff --git a/R/SourceSystem.r b/R/SourceSystem.r index b1a9b85..26724c8 100644 --- a/R/SourceSystem.r +++ b/R/SourceSystem.r @@ -40,7 +40,7 @@ SourceSystem <- R6::R6Class( SourceSystemList[["name"]] <- self[["name"]] } ## omit empty nested lists in returned list - SourceSystemList[sapply(SourceSystemList, length) > 0] + SourceSystemList[vapply(SourceSystemList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SourceSystemList, typeMapping = NULL) { diff --git a/R/Specimen.r b/R/Specimen.r index 3897f94..77aaa43 100644 --- a/R/Specimen.r +++ b/R/Specimen.r @@ -311,7 +311,7 @@ Specimen <- R6::R6Class( SpecimenList[["theme"]] <- self[["theme"]] } ## omit empty nested lists in returned list - SpecimenList[sapply(SpecimenList, length) > 0] + SpecimenList[vapply(SpecimenList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SpecimenList, typeMapping = NULL) { diff --git a/R/SpecimenClient.r b/R/SpecimenClient.r index ef4f634..820d9a3 100644 --- a/R/SpecimenClient.r +++ b/R/SpecimenClient.r @@ -275,7 +275,7 @@ SpecimenClient <- R6::R6Class( if (httr::status_code(response) < 200 || httr::status_code(response) > 299) { self$handleError(response) } else { - cat("Query result written to ", filename, "\n") + message("Query result written to ", filename) ## empty response, e.g. when file is downloaded result <- NULL Response$new(result, response) @@ -342,7 +342,7 @@ SpecimenClient <- R6::R6Class( if (httr::status_code(response) < 200 || httr::status_code(response) > 299) { self$handleError(response) } else { - cat("Query result written to ", filename, "\n") + message("Query result written to ", filename) ## empty response, e.g. when file is downloaded result <- NULL Response$new(result, response) @@ -512,7 +512,7 @@ SpecimenClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -572,7 +572,7 @@ SpecimenClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -710,7 +710,7 @@ SpecimenClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, diff --git a/R/SpecimenIdentification.r b/R/SpecimenIdentification.r index 5bd4067..762107d 100644 --- a/R/SpecimenIdentification.r +++ b/R/SpecimenIdentification.r @@ -179,7 +179,7 @@ SpecimenIdentification <- R6::R6Class( SpecimenIdentificationList[["remarks"]] <- self[["remarks"]] } ## omit empty nested lists in returned list - SpecimenIdentificationList[sapply(SpecimenIdentificationList, length) > 0] + SpecimenIdentificationList[vapply(SpecimenIdentificationList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SpecimenIdentificationList, typeMapping = NULL) { diff --git a/R/SummaryScientificName.r b/R/SummaryScientificName.r index 97c5709..7bc5cf3 100644 --- a/R/SummaryScientificName.r +++ b/R/SummaryScientificName.r @@ -85,7 +85,7 @@ SummaryScientificName <- R6::R6Class( SummaryScientificNameList[["authorshipVerbatim"]] <- self[["authorshipVerbatim"]] } ## omit empty nested lists in returned list - SummaryScientificNameList[sapply(SummaryScientificNameList, length) > 0] + SummaryScientificNameList[vapply(SummaryScientificNameList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SummaryScientificNameList, typeMapping = NULL) { diff --git a/R/SummarySourceSystem.r b/R/SummarySourceSystem.r index edc496f..b167131 100644 --- a/R/SummarySourceSystem.r +++ b/R/SummarySourceSystem.r @@ -31,7 +31,7 @@ SummarySourceSystem <- R6::R6Class( SummarySourceSystemList[["code"]] <- self[["code"]] } ## omit empty nested lists in returned list - SummarySourceSystemList[sapply(SummarySourceSystemList, length) > 0] + SummarySourceSystemList[vapply(SummarySourceSystemList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SummarySourceSystemList, typeMapping = NULL) { diff --git a/R/SummaryVernacularName.r b/R/SummaryVernacularName.r index 9cbabc7..6af08ec 100644 --- a/R/SummaryVernacularName.r +++ b/R/SummaryVernacularName.r @@ -40,7 +40,7 @@ SummaryVernacularName <- R6::R6Class( SummaryVernacularNameList[["language"]] <- self[["language"]] } ## omit empty nested lists in returned list - SummaryVernacularNameList[sapply(SummaryVernacularNameList, length) > 0] + SummaryVernacularNameList[vapply(SummaryVernacularNameList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(SummaryVernacularNameList, typeMapping = NULL) { diff --git a/R/Taxon.r b/R/Taxon.r index c1c876e..9f24ae3 100644 --- a/R/Taxon.r +++ b/R/Taxon.r @@ -181,7 +181,7 @@ Taxon <- R6::R6Class( TaxonList[["validName"]] <- self[["validName"]]$toList() } ## omit empty nested lists in returned list - TaxonList[sapply(TaxonList, length) > 0] + TaxonList[vapply(TaxonList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(TaxonList, typeMapping = NULL) { diff --git a/R/TaxonClient.r b/R/TaxonClient.r index aa9c90a..d08b4ab 100644 --- a/R/TaxonClient.r +++ b/R/TaxonClient.r @@ -146,7 +146,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -180,7 +180,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -251,7 +251,7 @@ TaxonClient <- R6::R6Class( if (httr::status_code(response) < 200 || httr::status_code(response) > 299) { self$handleError(response) } else { - cat("Query result written to ", filename, "\n") + message("Query result written to ", filename) ## empty response, e.g. when file is downloaded result <- NULL Response$new(result, response) @@ -318,7 +318,7 @@ TaxonClient <- R6::R6Class( if (httr::status_code(response) < 200 || httr::status_code(response) > 299) { self$handleError(response) } else { - cat("Query result written to ", filename, "\n") + message("Query result written to ", filename) ## empty response, e.g. when file is downloaded result <- NULL Response$new(result, response) @@ -414,7 +414,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -474,7 +474,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -556,7 +556,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, @@ -630,7 +630,7 @@ TaxonClient <- R6::R6Class( self$handleError(response) } else { ## API call result is a "map container" and will be parsed to list - result <- httr::content(response, simplifyVector = T) + result <- httr::content(response, simplifyVector = TRUE) Response$new(result, response) } }, diff --git a/R/TaxonDescription.r b/R/TaxonDescription.r index 6c6c121..d0c1923 100644 --- a/R/TaxonDescription.r +++ b/R/TaxonDescription.r @@ -49,7 +49,7 @@ TaxonDescription <- R6::R6Class( TaxonDescriptionList[["language"]] <- self[["language"]] } ## omit empty nested lists in returned list - TaxonDescriptionList[sapply(TaxonDescriptionList, length) > 0] + TaxonDescriptionList[vapply(TaxonDescriptionList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(TaxonDescriptionList, typeMapping = NULL) { diff --git a/R/TaxonomicEnrichment.r b/R/TaxonomicEnrichment.r index fc0e4fe..01b20cf 100644 --- a/R/TaxonomicEnrichment.r +++ b/R/TaxonomicEnrichment.r @@ -60,7 +60,7 @@ TaxonomicEnrichment <- R6::R6Class( TaxonomicEnrichmentList[["taxonId"]] <- self[["taxonId"]] } ## omit empty nested lists in returned list - TaxonomicEnrichmentList[sapply(TaxonomicEnrichmentList, length) > 0] + TaxonomicEnrichmentList[vapply(TaxonomicEnrichmentList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(TaxonomicEnrichmentList, typeMapping = NULL) { diff --git a/R/VernacularName.r b/R/VernacularName.r index 84154bf..821dd07 100644 --- a/R/VernacularName.r +++ b/R/VernacularName.r @@ -68,7 +68,7 @@ VernacularName <- R6::R6Class( VernacularNameList[["experts"]] <- lapply(self[["experts"]], function(x) x$toList()) } ## omit empty nested lists in returned list - VernacularNameList[sapply(VernacularNameList, length) > 0] + VernacularNameList[vapply(VernacularNameList, length, FUN.VALUE = integer(1)) > 0] }, fromList = function(VernacularNameList, typeMapping = NULL) {