Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ttnsy/currencyconv

Use `currencyConv()` to convert values in data.frame from one currency to another currency in R.
https://github.com/ttnsy/currencyconv

Last synced: 30 days ago
JSON representation

Use `currencyConv()` to convert values in data.frame from one currency to another currency in R.

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# currencyConv

Use `currencyConv()` to convert values in data.frame from one currency to another currency.

## Installation

``` r
# install.packages("devtools")
devtools::install_github("ttnsy/currencyConv")
```

## Example

```{r example}
library(currencyConv)
## basic example code

x <- data.frame(
var1 = c(100,200,300),
var2 = c(200, 99, 350),
source = c("USD","DKK","USD"),
target = c("GBP","GBP","GBP")
)

currencyConv(x, "var1") # When source target is not define, it will by default current the sources to GBP
currencyConv(x, "var1", "source")
currencyConv(x, "var1",target_currency = "GBP")

```