Last active
January 3, 2016 06:19
-
-
Save qoelet/8421892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load up libraries | |
library(ggplot2) | |
library(plyr) | |
library(XLConnect) | |
# try and read worksheet directly | |
original_data <- XLConnect::readWorksheet(loadWorkbook("/home/path/to/given_data.xlsx"), sheet=1) | |
" | |
Error: OutOfMemoryError (Java): GC overhead limit exceeded | |
" | |
# doesn't work, open in spreadsheet program and export to csv | |
original_data <- read.csv("/home/path/to/given_data.csv") | |
# Run View(original_data) in RStudio, all looks on | |
# Filter out only the columns that I want to look at - inspect via names(original_data) | |
my_data <- original_data[, c("Date","Channel","Costs", "Orders_XYZ", "User-Type")] | |
# Rename some of the columns (prefixing library name to show you where they come from) | |
my_data <- plyr::rename(my_data, c("Orders_XYZ"="Orders", "User-Type"="Grouping")) | |
# Create vector of filters | |
my_channel_filter <- c("A", "C", "X") | |
my_data <- subset(my_data, Channel==my_channel_filter) | |
# Plot and get a feel of the data | |
p <- ggplot(my_data, aes(Costs, Channel)) | |
p + geom_dotplot() | |
# Now I can start working on that data! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment