Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
using vapply instead of apply
Browse files Browse the repository at this point in the history
  • Loading branch information
hettling committed Aug 2, 2018
1 parent 85c5c05 commit 153a807
Show file tree
Hide file tree
Showing 58 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion R/Agent.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/AssociatedTaxon.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/BioStratigraphy.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/ChronoStratigraphy.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Crs.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/DefaultClassification.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Expert.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Feature.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/FeatureCollection.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Filter.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/GatheringEvent.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/GatheringSiteCoordinates.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/GeoArea.r
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions R/GeoClient.r
Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down
2 changes: 1 addition & 1 deletion R/GeoJsonObject.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/GeometryCollection.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/GroupByScientificNameQuerySpec.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Iptc4xmpExt.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/LineString.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/LithoStratigraphy.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/LngLatAlt.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MetadataClient.r
Expand Up @@ -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)
}
},
Expand Down
2 changes: 1 addition & 1 deletion R/Monomial.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiLineString.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiMediaContentIdentification.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiMediaGatheringEvent.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiMediaObject.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiPoint.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/MultiPolygon.r
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions R/MultimediaClient.r
Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
},
Expand Down
2 changes: 1 addition & 1 deletion R/NamedArea.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Organization.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Path.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Person.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Point.r
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion R/Polygon.r
Expand Up @@ -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) {
Expand Down

0 comments on commit 153a807

Please sign in to comment.