View source: R/format_generic.R
format_generic | R Documentation |
Format a generic .csv transaction history file. This function requires one transaction per row, so will not work with trades of two coins reported on the same row. For this you will have to split the trade on two rows and have a single currency column per row.
format_generic( data, date = "date", currency = "currency", quantity = "quantity", total.price = "total.price", spot.rate = "spot.rate", transaction = "transaction", fees = "fees", description = "description", comment = "comment", revenue.type = "revenue.type", exchange = "exchange", timezone = "UTC", force = FALSE, list.prices = NULL )
data |
The dataframe |
date |
The date column |
currency |
The currency column |
quantity |
The quantity column |
total.price |
The total.price column, if available |
spot.rate |
The spot.rate column, if available |
transaction |
The transaction column |
fees |
The fees column, if available |
description |
The description column, if available |
comment |
The comment column, if available |
revenue.type |
The revenue.type column, if available (content can
be one of |
exchange |
The exchange column |
timezone |
The time zone of the transactions |
force |
Whether to force recreating |
list.prices |
A |
A data frame of exchange transactions, formatted for further processing.
# Detects correct names even with capitals format_generic(data_generic1) # In other cases, names can be specified explicitly: format_generic( data_generic2, date = "Date.Transaction", currency = "Coin", quantity = "Amount", total.price = "Price", transaction = "Type", fees = "Fee", exchange = "Platform" ) # If total.price is missing, it will calculate it based # on the spot.rate, if available format_generic(data_generic3) # If both total.price and spot.rate are missing, it will # scrap the spot.rate from coinmarketcap based on the coin: format_generic(data_generic4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.