Let geom_sf() remove rows when shape, size or colour is NA #3491
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3483
Currently,
GeomSf
doesn't havenon_missing_aes
, but it should be set to avoid errors reported on #3483. I choseshape
,size
andcolour
here becauseGeomSf
is a mix of points, lines, and polygons, it should use the combination ofnon_missing_aes
ofGeomPoint
,GeomLine
andGeomPolygon
.GeomPoint
usesshape
,size
andcolour
GeomLine
andGeomPolygon
don't have theirnon_missing_aes
.GeomSf
removes rows (e.g. the size isNA
) thatGeomLine
andGeomPolygon
won't. But, the result is the same; lines and polygons whose sizes are allNA
won't be drawn. So, I think it's no problem to remove the whole rows.Created on 2019-08-18 by the reprex package (v0.3.0)