Skip to content

Commit

Permalink
Small update in vignette and ordering of apis
Browse files Browse the repository at this point in the history
  • Loading branch information
MansMeg committed Nov 29, 2014
1 parent e4f91d4 commit d8e90ea
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 56 deletions.
4 changes: 3 additions & 1 deletion inst/doc/pxweb.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ Some examples on using the R tools to fetch px-web API data.

### Listing available pxweb apis

To list the available apis in the package, use `api_catalogue()`.

```{r apiparameters, message=FALSE, eval=TRUE}
library(pxweb)
print(api_catalogue()[1:2])
api_catalogue()[1:2]
```

### Fetching data from PX-WEB API:
Expand Down
29 changes: 15 additions & 14 deletions inst/doc/pxweb.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,28 @@ <h2><a name="examples"></a>Examples</h2>
<p>Some examples on using the R tools to fetch px-web API data.</p>
<div id="listing-available-pxweb-apis" class="section level3">
<h3>Listing available pxweb apis</h3>
<p>To list the available apis in the package, use <code>api_catalogue()</code>.</p>
<pre class="r"><code>library(pxweb)
print(api_catalogue()[1:2])</code></pre>
api_catalogue()[1:2]</code></pre>
<pre><code>## [[1]]
## Api: statistik.sjv.se
## The Swedish agricultural authority
## Api: api.scb.se ('scb')
## Statistics Sweden
## Version(s) : v1
## Language(s) : sv
## Limit(s) : 10 calls per 10 sec.
## 1000 values per call.
## Language(s) : en, sv
## Limit(s) : 30 calls per 10 sec.
## 1e+05 values per call.
## Url template :
## http://statistik.sjv.se/PXWeb/api/[version]/[lang]
## http://api.scb.se/OV0104/[version]/doris/[lang]
##
## [[2]]
## Api: pxweb.orebro.se
## Open data from the municipality Orebro in Sweden.
## Api: pxnet2.stat.fi ('statfi')
## Statistics Finland
## Version(s) : v1
## Language(s) : sv
## Limit(s) : 10 calls per 10 sec.
## 1000 values per call.
## Language(s) : fi
## Limit(s) : 30 calls per 10 sec.
## 1e+05 values per call.
## Url template :
## http://pxweb.orebro.se/api/[version]/[lang]</code></pre>
## http://pxnet2.stat.fi/PXWeb/api/[version]/[lang]</code></pre>
</div>
<div id="fetching-data-from-px-web-api" class="section level3">
<h3>Fetching data from PX-WEB API:</h3>
Expand Down Expand Up @@ -188,7 +189,7 @@ <h2>Session info</h2>
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] pxweb_0.5.0
## [1] pxweb_0.5.3
##
## loaded via a namespace (and not attached):
## [1] data.table_1.9.2 digest_0.6.4 evaluate_0.5.5 formatR_0.10
Expand Down
30 changes: 16 additions & 14 deletions inst/doc/pxweb.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,34 @@ Some examples on using the R tools to fetch px-web API data.

### Listing available pxweb apis

To list the available apis in the package, use `api_catalogue()`.


```r
library(pxweb)
print(api_catalogue()[1:2])
api_catalogue()[1:2]
```

```
## [[1]]
## Api: statistik.sjv.se
## The Swedish agricultural authority
## Api: api.scb.se ('scb')
## Statistics Sweden
## Version(s) : v1
## Language(s) : sv
## Limit(s) : 10 calls per 10 sec.
## 1000 values per call.
## Language(s) : en, sv
## Limit(s) : 30 calls per 10 sec.
## 1e+05 values per call.
## Url template :
## http://statistik.sjv.se/PXWeb/api/[version]/[lang]
## http://api.scb.se/OV0104/[version]/doris/[lang]
##
## [[2]]
## Api: pxweb.orebro.se
## Open data from the municipality Orebro in Sweden.
## Api: pxnet2.stat.fi ('statfi')
## Statistics Finland
## Version(s) : v1
## Language(s) : sv
## Limit(s) : 10 calls per 10 sec.
## 1000 values per call.
## Language(s) : fi
## Limit(s) : 30 calls per 10 sec.
## 1e+05 values per call.
## Url template :
## http://pxweb.orebro.se/api/[version]/[lang]
## http://pxnet2.stat.fi/PXWeb/api/[version]/[lang]
```

### Fetching data from PX-WEB API:
Expand Down Expand Up @@ -198,7 +200,7 @@ sessionInfo()
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] pxweb_0.5.0
## [1] pxweb_0.5.3
##
## loaded via a namespace (and not attached):
## [1] data.table_1.9.2 digest_0.6.4 evaluate_0.5.5 formatR_0.10
Expand Down
52 changes: 26 additions & 26 deletions inst/extdata/api.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
{
"apis": {
"statistik.sjv.se": {
"alias" : ["jordbruksverket"],
"description" : "The Swedish agricultural authority",
"url" : "http://statistik.sjv.se/PXWeb/api/[version]/[lang]",
"version": ["v1"],
"lang": ["sv"],
"calls_per_period": 10,
"period_in_seconds": 10,
"max_values_to_download" : 1000
},

"pxweb.orebro.se": {
"description" : "Open data from the municipality Orebro in Sweden.",
"url" : "http://pxweb.orebro.se/api/[version]/[lang]",
"api.scb.se": {
"alias" : ["scb"],
"description" : "Statistics Sweden",
"url" : "http://api.scb.se/OV0104/[version]/doris/[lang]",
"version": ["v1"],
"lang": ["sv"],
"calls_per_period": 10,
"lang": ["en", "sv"],
"calls_per_period": 30,
"period_in_seconds": 10,
"max_values_to_download" : 1000
},
"max_values_to_download" : 100000
},

"pxnet2.stat.fi": {
"alias" : ["statfi"],
Expand All @@ -42,16 +32,26 @@
"max_values_to_download" : 100000
},

"api.scb.se": {
"alias" : ["scb"],
"description" : "Statistics Sweden",
"url" : "http://api.scb.se/OV0104/[version]/doris/[lang]",
"statistik.sjv.se": {
"alias" : ["jordbruksverket"],
"description" : "The Swedish agricultural authority",
"url" : "http://statistik.sjv.se/PXWeb/api/[version]/[lang]",
"version": ["v1"],
"lang": ["en", "sv"],
"calls_per_period": 30,
"lang": ["sv"],
"calls_per_period": 10,
"period_in_seconds": 10,
"max_values_to_download" : 100000
}
"max_values_to_download" : 1000
},

"pxweb.orebro.se": {
"description" : "Open data from the municipality Orebro in Sweden.",
"url" : "http://pxweb.orebro.se/api/[version]/[lang]",
"version": ["v1"],
"lang": ["sv"],
"calls_per_period": 10,
"period_in_seconds": 10,
"max_values_to_download" : 1000
}
},

"local_apis": {}
Expand Down
2 changes: 1 addition & 1 deletion vignettes/pxweb.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Some examples on using the R tools to fetch px-web API data.

```{r apiparameters, message=FALSE, eval=TRUE}
library(pxweb)
print(api_catalogue()[1:2])
api_catalogue()
```

### Fetching data from PX-WEB API:
Expand Down

0 comments on commit d8e90ea

Please sign in to comment.