Learn R Programming

FAOSTAT (version 2.4.0)

translateUnit: Function to translate multipliers

Description

This function translates number to character name or vice versa

Usage

translateUnit(vec)

Arguments

vec

The vector containing name or number to be translated

Examples

Run this code
## Create numeric vector
myUnit = c(1000, 1e6, 1000, 1e9, 1e9, 1e12)

## Translate numeric to character
myUnit2 = translateUnit(myUnit)
myUnit2

## Now translate back
translateUnit(myUnit2)

Run the code above in your browser using DataLab