Skip to content

Commit

Permalink
update vignttes in vignettes/ dir, woopsy
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Dec 3, 2018
1 parent b232017 commit cf71a25
Show file tree
Hide file tree
Showing 17 changed files with 287 additions and 307 deletions.
66 changes: 33 additions & 33 deletions vignettes/buoy_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ head(res)
#> 4 41006
#> 5 41008
#> 6 41009
#> url
#> 1 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41001/catalog.html
#> 2 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41002/catalog.html
#> 3 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41004/catalog.html
#> 4 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41006/catalog.html
#> 5 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41008/catalog.html
#> 6 http://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41009/catalog.html
#> url
#> 1 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41001/catalog.html
#> 2 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41002/catalog.html
#> 3 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41004/catalog.html
#> 4 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41006/catalog.html
#> 5 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41008/catalog.html
#> 6 https://dods.ndbc.noaa.gov/thredds/catalog/data/cwind/41009/catalog.html
```

Or browse them on the web
Expand Down Expand Up @@ -116,48 +116,48 @@ Including year and datatype


```r
buoy(dataset = 'cwind', buoyid = 41001, year = 2008, datatype = "cc")
buoy(dataset = 'cwind', buoyid = 45005, year = 2008, datatype = "c")
```

```
#> Dimensions (rows/cols): [1585 X 5]
#> Dimensions (rows/cols): [29688 X 5]
#> 2 variables: [wind_dir, wind_spd]
#>
#> time lat lon wind_dir wind_spd
#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6
#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7
#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5
#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8
#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5
#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9
#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2
#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2
#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3
#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8
#> 1 2008-04-29T09:00:00Z 41.677 -82.398 10 9.0
#> 2 2008-04-29T09:10:00Z 41.677 -82.398 8 9.0
#> 3 2008-04-29T09:20:00Z 41.677 -82.398 5 9.3
#> 4 2008-04-29T09:30:00Z 41.677 -82.398 13 9.5
#> 5 2008-04-29T09:40:00Z 41.677 -82.398 14 9.4
#> 6 2008-04-29T09:50:00Z 41.677 -82.398 12 9.4
#> 7 2008-04-29T14:00:00Z 41.677 -82.398 341 6.5
#> 8 2008-04-29T14:10:00Z 41.677 -82.398 332 6.8
#> 9 2008-04-29T14:20:00Z 41.677 -82.398 335 6.4
#> 10 2008-04-29T14:30:00Z 41.677 -82.398 332 6.5
#> .. ... ... ... ... ...
```

Including just datatype


```r
buoy(dataset = 'cwind', buoyid = 41001, datatype = "cc")
buoy(dataset = 'cwind', buoyid = 45005, datatype = "c")
```

```
#> Dimensions (rows/cols): [1585 X 5]
#> Dimensions (rows/cols): [26784 X 5]
#> 2 variables: [wind_dir, wind_spd]
#>
#> time lat lon wind_dir wind_spd
#> 1 2008-05-28T16:00:00Z 34.704 -72.734 230 8.6
#> 2 2008-05-28T16:10:00Z 34.704 -72.734 230 8.7
#> 3 2008-05-28T16:20:00Z 34.704 -72.734 229 8.5
#> 4 2008-05-28T16:30:00Z 34.704 -72.734 231 8.8
#> 5 2008-05-28T16:40:00Z 34.704 -72.734 236 8.5
#> 6 2008-05-28T16:50:00Z 34.704 -72.734 235 8.9
#> 7 2008-05-28T17:00:00Z 34.704 -72.734 233 8.2
#> 8 2008-05-28T17:10:00Z 34.704 -72.734 233 8.2
#> 9 2008-05-28T17:20:00Z 34.704 -72.734 231 8.3
#> 10 2008-05-28T17:30:00Z 34.704 -72.734 232 7.8
#> .. ... ... ... ... ...
#> time lat lon wind_dir wind_spd
#> 1 1996-05-15T23:00:00Z 41.68 -82.4 337 2.2
#> 2 1996-05-15T23:10:00Z 41.68 -82.4 282 1.0
#> 3 1996-05-15T23:20:00Z 41.68 -82.4 282 2.2
#> 4 1996-05-15T23:30:00Z 41.68 -82.4 258 2.6
#> 5 1996-05-15T23:40:00Z 41.68 -82.4 254 3.0
#> 6 1996-05-15T23:50:00Z 41.68 -82.4 252 2.7
#> 7 1996-05-16T00:00:00Z 41.68 -82.4 240 2.1
#> 8 1996-05-16T00:10:00Z 41.68 -82.4 246 2.4
#> 9 1996-05-16T00:20:00Z 41.68 -82.4 251 2.7
#> 10 1996-05-16T00:30:00Z 41.68 -82.4 253 2.9
#> .. ... ... ... ... ...
```
Binary file modified vignettes/figure/seaice1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/seaice2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/six-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified vignettes/figure/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 44 additions & 39 deletions vignettes/homr_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,24 @@ names(res)
```

```
#> [1] "10001871" "10100161" "10100162" "10100164" "10100166" "20004155"
#> [7] "20004158" "20004160" "20004162" "20004163" "20004167" "20004168"
#> [13] "20004171" "20004176" "20004178" "20004179" "20004180" "20004182"
#> [19] "20004184" "20004185" "30001464" "30001561" "30001831" "30017384"
#> [25] "30020917" "30021161" "30021998" "30022674" "30026770" "30027455"
#> [31] "30032423" "30032685" "30034222" "30039554" "30043742" "30046662"
#> [37] "30046814" "30051475" "30057217" "30063570" "30064900" "30065901"
#> [43] "30067636" "30069663" "30075067" "30077378" "30077857" "30077923"
#> [49] "30077988" "30079088" "30079240" "30082430" "30084216" "30084262"
#> [55] "30084537" "30084796" "30094582" "30094639" "30094664" "30094670"
#> [61] "30094683" "30094730" "30094806" "30094830" "30094917" "30094931"
#> [67] "30094936" "30101120" "30101186" "30101294" "30101341" "30101363"
#> [73] "30101370" "30102005"
#> [1] "10001871" "10100161" "10100162" "10100164" "10100166" "20004155"
#> [7] "20004158" "20004160" "20004162" "20004163" "20004167" "20004168"
#> [13] "20004171" "20004176" "20004178" "20004179" "20004180" "20004182"
#> [19] "20004184" "20004185" "30001464" "30001561" "30001831" "30017384"
#> [25] "30020917" "30021161" "30021998" "30022674" "30026770" "30027455"
#> [31] "30032423" "30032685" "30034222" "30039554" "30043742" "30046662"
#> [37] "30046814" "30051475" "30057217" "30063570" "30064900" "30065901"
#> [43] "30067636" "30069663" "30075067" "30077378" "30077857" "30077923"
#> [49] "30077988" "30079088" "30079240" "30082430" "30084216" "30084262"
#> [55] "30084537" "30084796" "30094582" "30094639" "30094664" "30094670"
#> [61] "30094683" "30094730" "30094806" "30094830" "30094917" "30094931"
#> [67] "30094936" "30101120" "30101186" "30101294" "30101341" "30101363"
#> [73] "30101370" "30102005" "30106954" "30107175" "30107251" "30107345"
#> [79] "30107377" "30107384" "30107435" "30107641" "30107692" "30107701"
#> [85] "30107718" "30107886" "30107891" "30107899" "30107936" "30108008"
#> [91] "30108119" "30108282" "30108333" "30108338" "30108394" "30108839"
#> [97] "30108887" "30108929" "30108935" "30108946" "30109183" "30110071"
#> [103] "30111663" "30111793" "30112317" "30112507" "30112571" "30113052"
```

By country
Expand Down Expand Up @@ -297,20 +302,20 @@ head( ldply(res, "[[", "head") )
```

```
#> .id preferredName latitude_dec longitude_dec
#> 1 30077883 WEAVERVILLE 4.2 N, NC 35.7579 -82.5618
#> 2 30029796 FAIRVIEW 1.2 S, NC 35.5058 -82.4051
#> 3 30083542 BLACK MOUNTAIN 0.8 N, NC 35.6263 -82.3297
#> 4 20013839 LEICESTER, NC 35.65 -82.7
#> 5 20013817 SWANNANOA 2 E, NC 35.6 -82.36667
#> 6 20014046 SWANNANOA 2 SSE, NC 35.57333 -82.385
#> .id preferredName latitude_dec longitude_dec
#> 1 30063513 ASHEVILLE 5.6 NNW, NC 35.6534 -82.5709
#> 2 30014782 WEAVERVILLE 5E, NC 35.71028 -82.50389
#> 3 20013851 WEAVERVILLE, NC 35.7 -82.56667
#> 4 20013789 GARREN CREEK, NC 35.51667 -82.33333
#> 5 20013801 BILTMORE 2 SE, NC 35.56833 -82.545
#> 6 30031683 ASHEVILLE 4.0 NNE, NC 35.6224 -82.5096
#> por.beginDate por.endDate precision
#> 1 Unknown Present <NA>
#> 2 Unknown Present <NA>
#> 3 Unknown Present <NA>
#> 4 1934-11-05T00:00:00.000 1962-03-31T00:00:00.000 DDMM
#> 5 1931-03-01T00:00:00.000 1987-08-26T00:00:00.000 DDMM
#> 6 1984-01-01T00:00:00.000 2008-03-31T00:00:00.000 DDMMSS
#> 2 1965-12-01T00:00:00.000 1976-01-31T00:00:00.000 DDMMSS
#> 3 1946-03-30T00:00:00.000 1992-10-01T00:00:00.000 DDMM
#> 4 1936-09-25T00:00:00.000 1962-03-31T00:00:00.000 DDMM
#> 5 1963-10-01T00:00:00.000 2007-11-14T00:00:00.000 DDMMSS
#> 6 Unknown Present <NA>
```

## Get header information only
Expand All @@ -322,20 +327,20 @@ head( ldply(res, "[[", "head") )
```

```
#> .id preferredName latitude_dec longitude_dec precision
#> 1 20004159 GEORGETOWN 5 SW, DE 38.63333 -75.45 DDMM
#> 2 30067636 LEWES 0.8 SE, DE 38.7731 -75.1385 <NA>
#> 3 30027455 DELMAR 2.8 NE, DE 38.4863 -75.5332 <NA>
#> 4 30075067 PRIME HOOK DELAWARE, DE 38.8333 -75.3333 <NA>
#> 5 20004158 REHOBOTH BEACH LBS, DE 38.61667 -75.06667 DDMM
#> 6 30039554 GREENWOOD 2.9 SE, DE 38.7731 -75.5616 <NA>
#> por.beginDate por.endDate
#> 1 1946-09-14T00:00:00.000 1997-06-01T00:00:00.000
#> 2 Unknown Present
#> 3 Unknown Present
#> 4 Unknown Present
#> 5 Unknown Present
#> 6 Unknown Present
#> .id preferredName latitude_dec longitude_dec
#> 1 30094670 HARRINGTON 3.3 SSW, DE 38.8821 -75.6052
#> 2 10100166 WILMINGTON PORTER RES, DE 39.7739 -75.5414
#> 3 30001464 BEAR 2 SW, DE 39.5917 -75.7325
#> 4 30101363 LEWES 1.5 SSW, DE 38.7588 -75.1579
#> 5 20004172 ADAMSVILLE, DE 38.81667 -75.7
#> 6 20004165 BRIDGEVILLE STATE POLICE, DE 38.77444 -75.6075
#> por.beginDate por.endDate precision
#> 1 Unknown Present <NA>
#> 2 1912-07-12T00:00:00.000 Present DDddddd
#> 3 2003-02-01T00:00:00.000 2013-04-02T00:00:00.000 DDMMSS
#> 4 Unknown Present <NA>
#> 5 1967-09-01T00:00:00.000 1969-12-31T00:00:00.000 DDMM
#> 6 1975-08-01T00:00:00.000 2003-09-01T00:00:00.000 DDMMSS
```

## Data definitions
Expand Down
90 changes: 34 additions & 56 deletions vignettes/ncdc_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ncdc_stations(datasetid='GHCND', locationid='FIPS:12017', stationid='GHCND:USC00
#>
#> $data
#> elevation mindate maxdate latitude name
#> 1 12.2 1899-02-01 2015-06-16 28.8029 INVERNESS 3 SE, FL US
#> 1 12.2 1899-02-01 2018-11-25 28.8029 INVERNESS 3 SE, FL US
#> datacoverage id elevationUnit longitude
#> 1 1 GHCND:USC00084289 METERS -82.3126
#>
Expand All @@ -45,32 +45,20 @@ ncdc_stations(datasetid='GHCND', locationid='FIPS:12017', stationid='GHCND:USC00
```r
out <- ncdc(datasetid='NORMAL_DLY', datatypeid='dly-tmax-normal', startdate = '2010-05-01', enddate = '2010-05-10')
out$data
#> date datatype station value fl_c
#> 1 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:AQW00061705 869 C
#> 2 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CAW00064757 607 Q
#> 3 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CQC00914080 840 R
#> 4 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CQC00914801 858 R
#> 5 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914395 876 P
#> 6 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914419 885 P
#> 7 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914446 885 P
#> 8 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914482 868 R
#> 9 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914720 899 R
#> 10 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914761 897 P
#> 11 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914831 870 P
#> 12 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914892 883 P
#> 13 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914898 875 P
#> 14 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914911 885 P
#> 15 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMW00040308 888 S
#> 16 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMW00040504 879 C
#> 17 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMW00040505 867 S
#> 18 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:GQC00914025 852 P
#> 19 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:GQW00041415 877 C
#> 20 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:JQW00021603 852 P
#> 21 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:PSC00914519 883 P
#> 22 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:PSC00914712 840 P
#> 23 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:PSW00040309 879 S
#> 24 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:RMW00040604 867 S
#> 25 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:RMW00040710 863 C
#> # A tibble: 25 x 5
#> date datatype station value fl_c
#> <chr> <chr> <chr> <int> <chr>
#> 1 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:AQW00061705 869 C
#> 2 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CAW00064757 607 Q
#> 3 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CQC00914080 840 R
#> 4 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:CQC00914801 858 R
#> 5 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914395 876 P
#> 6 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914419 885 P
#> 7 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914446 885 P
#> 8 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914482 868 R
#> 9 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914720 899 R
#> 10 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:FMC00914761 897 P
#> # … with 15 more rows
```

## Plot data, super simple, but it's a start
Expand All @@ -81,7 +69,7 @@ out <- ncdc(datasetid='NORMAL_DLY', stationid='GHCND:USW00014895', datatypeid='d
ncdc_plot(out)
```

![plot of chunk six](figure/six-1.png)
![plot of chunk six](figure/six-1.png)

## More on plotting

Expand Down Expand Up @@ -157,34 +145,24 @@ Then combine with a call to `ncdc_combine`
```r
df <- ncdc_combine(out1, out2)
head(df[[1]]); tail(df[[1]])
#> date datatype station value fl_m fl_q fl_so
#> 1 2010-03-01T00:00:00 PRCP GHCND:USW00014895 0 T 0
#> 2 2010-03-02T00:00:00 PRCP GHCND:USW00014895 0 T 0
#> 3 2010-03-03T00:00:00 PRCP GHCND:USW00014895 0 T 0
#> 4 2010-03-04T00:00:00 PRCP GHCND:USW00014895 0 0
#> 5 2010-03-05T00:00:00 PRCP GHCND:USW00014895 0 0
#> 6 2010-03-06T00:00:00 PRCP GHCND:USW00014895 0 0
#> fl_t
#> 1 2400
#> 2 2400
#> 3 2400
#> 4 2400
#> 5 2400
#> 6 2400
#> date datatype station value fl_m fl_q fl_so
#> 148 2010-10-26T00:00:00 PRCP GHCND:USW00014895 221 0
#> 149 2010-10-27T00:00:00 PRCP GHCND:USW00014895 0 0
#> 150 2010-10-28T00:00:00 PRCP GHCND:USW00014895 0 T 0
#> 151 2010-10-29T00:00:00 PRCP GHCND:USW00014895 0 T 0
#> 152 2010-10-30T00:00:00 PRCP GHCND:USW00014895 0 0
#> 153 2010-10-31T00:00:00 PRCP GHCND:USW00014895 0 0
#> fl_t
#> 148 2400
#> 149 2400
#> 150 2400
#> 151 2400
#> 152 2400
#> 153 2400
#> # A tibble: 6 x 8
#> date datatype station value fl_m fl_q fl_so fl_t
#> <chr> <chr> <chr> <int> <chr> <chr> <chr> <chr>
#> 1 2010-03-01T00:00:… PRCP GHCND:USW00014… 0 T "" 0 2400
#> 2 2010-03-02T00:00:… PRCP GHCND:USW00014… 0 T "" 0 2400
#> 3 2010-03-03T00:00:… PRCP GHCND:USW00014… 0 T "" 0 2400
#> 4 2010-03-04T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
#> 5 2010-03-05T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
#> 6 2010-03-06T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
#> # A tibble: 6 x 8
#> date datatype station value fl_m fl_q fl_so fl_t
#> <chr> <chr> <chr> <int> <chr> <chr> <chr> <chr>
#> 1 2010-10-26T00:00:… PRCP GHCND:USW00014… 221 "" "" 0 2400
#> 2 2010-10-27T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
#> 3 2010-10-28T00:00:… PRCP GHCND:USW00014… 0 T "" 0 2400
#> 4 2010-10-29T00:00:… PRCP GHCND:USW00014… 0 T "" 0 2400
#> 5 2010-10-30T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
#> 6 2010-10-31T00:00:… PRCP GHCND:USW00014… 0 "" "" 0 2400
```

Then plot - the default passing in the combined plot plots the data together. In this case it looks kind of weird since a straight line combines two distant dates.
Expand Down
Loading

0 comments on commit cf71a25

Please sign in to comment.