Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bquast committed Oct 30, 2015
1 parent 0f52109 commit e5172bb
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
23 changes: 23 additions & 0 deletions R/nrca.R
Expand Up @@ -3,6 +3,29 @@
#' @name nrca
#' @param x A decomposed Inter-Country Input Output table as created by decompr
#' @export
#' @examples
#' # load the decompr package
#' library(decompr)
#'
#' # load the example data set
#' data(leather)
#'
#' # perform Leontief decomposition
#' l <- decomp(inter,
#' final,
#' countries,
#' industries,
#' out,
#' method = "leontief",
#' post = "exports" )
#'
#' # load gvc package
#' library(gvc)
#'
#' # perform New Revealed Comparative Advantage
#' nrca(l)
#'


nrca <- function ( x ) {

Expand Down
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -11,6 +11,11 @@ Several tools for Global Value Chain ('GVC') analysis are implemented
- 'Importing to Export' (`i2e()`)
- 'Exporting to Re-export' (`e2r()`)
- 'New Revealed Comparative Advantage' (`nrca()`)
- 'Upsteamness' (`upstream()`)
- 'Downstreamness' (`downstream()`)
- 'Domestic Final Demand Foreign Value Added' (`dfdfva()`)
- 'Foreign Final Demand Domestic Value Added' (`ffddva()`)
- 'Domestic Final Demand Domestic Value Added' (`dfddva()`)


Installation
Expand Down
23 changes: 23 additions & 0 deletions man/nrca.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions vignettes/gvc.Rmd
Expand Up @@ -12,13 +12,14 @@ vignette: >
A typical workflow begins with using the Leontief decomposition in the `decompr` package.

```{r}
# load the package
# load the decompr package
library(decompr)
```

We will use the example data set.

```{r}
# load the example data set
data(leather)
```

Expand All @@ -31,7 +32,7 @@ l <- decomp(inter,
industries,
out,
method = "leontief",
post = "exports")
post = "exports" )
```

We can now analyse the `l` object with the **gvc** package.
Expand All @@ -40,13 +41,13 @@ We can now analyse the `l` object with the **gvc** package.
library(gvc)
```

For instance, using the **new revealed comparative advantage** (`nrca()`),
For instance, using the **New Revealed Comparative Advantage** (`nrca()`),

```{r}
nrca(l)
```

or using **importing to export** (`i2e()`),
or using **Importing to Export** (`i2e()`),

```{r}
i2e(l)
Expand Down

0 comments on commit e5172bb

Please sign in to comment.