README.md

RTableau

A quick and easy way to convert an R data.frame to a Tableau .tde or .hyper Extract.

Getting Started

Prerequisites

Installing

Once installing prerequisites is done, install the package from this repository:

install.packages("devtools")
devtools::install_github("zhiruiwang/RTableau")

Example

The most simple example is output iris dataset into .tde or .hyper format:

library(RTableau)
write_tableau(iris,"iris.tde")

Another example that involves setting spatial column and add index: I grabbed the following Brazil flights data off of kaggle for this example: https://www.kaggle.com/microtang/exploring-brazil-flights-data/data.

library(tidyverse)
library(RTableau)
# Read in the data and select first 1000 rows
example_df <- read_csv("BrFlights2.csv")
example_df <- slice(example_df,1:1000)

# Set up a spatial column as `POINT (Lon Lat)` format
example_df <- example_df %>% 
  mutate(SpatialDest = paste0("POINT (",round(LongDest,6)," ",round(LatDest,6),")"))

# Write .tde or .hyper Extract!
write_tableau(example_df,"BrFlights.tde","SpatialDest",add_index = T)

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details



zhiruiwang/RTableau documentation built on May 7, 2019, 11:11 a.m.