Skip to content

Commit

Permalink
updaet readme and vigngetes
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jul 21, 2017
1 parent 3eb9610 commit 0a4eec6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 38 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ geojson_json(c(32.45, -99.74))
geojson_list(c(32.45, -99.74))
#> $type
#> [1] "FeatureCollection"
#>
#>
#> $features
#> $features[[1]]
#> $features[[1]]$type
#> [1] "Feature"
#>
#>
#> $features[[1]]$geometry
#> $features[[1]]$geometry$type
...
Expand All @@ -135,12 +135,12 @@ geojson_json(us.cities[1:2, ], lat = 'lat', lon = 'long')
geojson_list(us.cities[1:2, ], lat = 'lat', lon = 'long')
#> $type
#> [1] "FeatureCollection"
#>
#>
#> $features
#> $features[[1]]
#> $features[[1]]$type
#> [1] "Feature"
#>
#>
#> $features[[1]]$geometry
#> $features[[1]]$geometry$type
...
Expand All @@ -165,13 +165,12 @@ to json
geojson_json(sp_poly)
#> {
#> "type": "FeatureCollection",
#>
#> "features": [
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> ]
#> }
#>
#>
```

to list
Expand All @@ -181,14 +180,14 @@ to list
geojson_list(sp_poly)$features[[1]]
#> $type
#> [1] "Feature"
#>
#>
#> $id
#> [1] 1
#>
#>
#> $properties
#> $properties$dummy
#> [1] 0
#>
#>
...
```

Expand All @@ -207,12 +206,12 @@ b <- geojson_list(vecs, geometry = "polygon")
a + b
#> $type
#> [1] "FeatureCollection"
#>
#>
#> $features
#> $features[[1]]
#> $features[[1]]$type
#> [1] "Feature"
#>
#>
#> $features[[1]]$geometry
#> $features[[1]]$geometry$type
...
Expand Down
Binary file modified inst/img/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 10 additions & 12 deletions inst/vign/geojsonio_vignette.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ to __json__
geojson_json(sp_poly)
#> {
#> "type": "FeatureCollection",
#>
#> "features": [
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> ]
#> }
#>
Expand Down Expand Up @@ -178,7 +177,6 @@ to __json__
geojson_json(s)
#> {
#> "type": "FeatureCollection",
#>
#> "features": [
#> { "type": "Feature", "id": 1, "properties": { "dat": 1 }, "geometry": { "type": "Point", "coordinates": [ 1.0, 3.0 ] } },
#> { "type": "Feature", "id": 2, "properties": { "dat": 2 }, "geometry": { "type": "Point", "coordinates": [ 2.0, 2.0 ] } },
Expand Down Expand Up @@ -251,13 +249,13 @@ summary(out)
#> Is projected: NA
#> proj4string : [NA]
#> Data attributes:
#> id name
#> Alabama : 1 NA's:51
#> Alaska : 1
#> Arizona : 1
#> Arkansas : 1
#> California: 1
#> Colorado : 1
#> id
#> Alabama : 1
#> Alaska : 1
#> Arizona : 1
#> Arkansas : 1
#> California: 1
#> Colorado : 1
#> (Other) :45
```

Expand All @@ -276,6 +274,6 @@ Or use `as.location()` first
(loc <- as.location(file))
#> <location>
#> Type: file
#> Location: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/geojsonio/examples/us_states.topojson
#> Location: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/geojsonio/examples/us_states.topojson
out <- topojson_read(loc, verbose = FALSE)
```
2 changes: 1 addition & 1 deletion revdep/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ library("devtools")
res <- revdep_check()
revdep_check_save_summary()
revdep_check_print_problems()
#revdep_email(date = "Jan 26", only_problems = FALSE, draft = TRUE)
revdep_email(date = "Jul 24", version = "v0.3.8", only_problems = FALSE, draft = TRUE)
22 changes: 10 additions & 12 deletions vignettes/geojsonio_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ to __json__
geojson_json(sp_poly)
#> {
#> "type": "FeatureCollection",
#>
#> "features": [
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.000000 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> { "type": "Feature", "id": 1, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.0, 40.0 ], [ -90.0, 50.0 ], [ -85.0, 45.0 ], [ -100.0, 40.0 ] ] ] } },
#> { "type": "Feature", "id": 2, "properties": { "dummy": 0.0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -90.0, 30.0 ], [ -80.0, 40.0 ], [ -75.0, 35.0 ], [ -90.0, 30.0 ] ] ] } }
#> ]
#> }
#>
Expand Down Expand Up @@ -178,7 +177,6 @@ to __json__
geojson_json(s)
#> {
#> "type": "FeatureCollection",
#>
#> "features": [
#> { "type": "Feature", "id": 1, "properties": { "dat": 1 }, "geometry": { "type": "Point", "coordinates": [ 1.0, 3.0 ] } },
#> { "type": "Feature", "id": 2, "properties": { "dat": 2 }, "geometry": { "type": "Point", "coordinates": [ 2.0, 2.0 ] } },
Expand Down Expand Up @@ -251,13 +249,13 @@ summary(out)
#> Is projected: NA
#> proj4string : [NA]
#> Data attributes:
#> id name
#> Alabama : 1 NA's:51
#> Alaska : 1
#> Arizona : 1
#> Arkansas : 1
#> California: 1
#> Colorado : 1
#> id
#> Alabama : 1
#> Alaska : 1
#> Arizona : 1
#> Arkansas : 1
#> California: 1
#> Colorado : 1
#> (Other) :45
```

Expand All @@ -276,6 +274,6 @@ Or use `as.location()` first
(loc <- as.location(file))
#> <location>
#> Type: file
#> Location: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/geojsonio/examples/us_states.topojson
#> Location: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/geojsonio/examples/us_states.topojson
out <- topojson_read(loc, verbose = FALSE)
```

0 comments on commit 0a4eec6

Please sign in to comment.