Skip to content

Commit

Permalink
Merge pull request #4 from globeandmail/1.1
Browse files Browse the repository at this point in the history
1.1
  • Loading branch information
tomcardoso authored Feb 17, 2021
2 parents fff446f + 6a4732e commit ba91f5c
Show file tree
Hide file tree
Showing 11 changed files with 245 additions and 448 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Package: startR
Type: Package
Title: A Template For Data Journalism Projects In R
Version: 1.0.1
Version: 1.1.0
Author: Michael Pereira <mpereira@globeandmail.com> and Tom Cardoso <tcardoso@globeandmail.com>
Maintainer: Michael Pereira <mpereira@globeandmail.com> and Tom Cardoso <tcardoso@globeandmail.com>
Description: This project structures the data analysis process around an expected set of files and steps.
This lowers the upfront effort of starting and maintaining a project and supports easier verification by providing reviewers with an expected and logically organized project.
Think of it like Ruby on Rails or React, but for R analysis.
This lowers the upfront effort of starting and maintaining a project and supports easier verification by providing reviewers with an expected and logically organized project. Think of it like Ruby on Rails or React, but for R analysis.
License: MIT
Encoding: UTF-8
LazyData: true
13 changes: 5 additions & 8 deletions R/analyze.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
############################################################
# This file handles the primary analysis using the tidied
# data as input. Should never read from `dir_data_raw`,
# only `dir_data_processed`.
#
#
############################################################
# =======================================================================
# This file handles the primary analysis using the tidied data as input.
# Should never read from `dir_data_raw()`, only `dir_data_processed()`.
# =======================================================================

# sample <- read_feather(here::here(dir_data_processed, 'sample.feather')) %>%
# sample <- read_feather(dir_data_processed('sample.feather')) %>%
# group_by(cma) %>%
# arrange(desc(date)) %>%
# mutate(sale_avg_3mo = rollmean(sale_avg, k = 3, fill = NA)) %>%
Expand Down
6 changes: 2 additions & 4 deletions R/functions.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
############################################################
# =======================================================================
# Project-specific functions.
#
#
############################################################
# =======================================================================
22 changes: 8 additions & 14 deletions R/process.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
############################################################
# This file is used to read in raw data, tidy, clean it,
# and save a file to src *before* proceeding to analysis.
# If you're using `mutate()` for any actual analysis you're
# doing it wrong.
#
# Specify column types as required.
#
############################################################

# begin_processing()
# =======================================================================
# Read raw data, clean it and save it out to `dir_data_processed()` here
# before moving to analysis. If run from `run.R`, all variables generated
# in this file will be wiped after completion to keep the environment
# clean. If your process step is complex, you can break it into several
# files like so: `source(dir_src('process_files', 'process_step_1.R'))`
# =======================================================================

# sample.raw <- read_csv(sample.raw.file) %>%
# rename(
Expand All @@ -23,6 +19,4 @@
# ) %>%
# arrange(cma, desc(date))
#
# write_feather(sample.raw, here::here(dir_data_processed, 'sample.feather'))
#
# end_processing()
# write_feather(sample.raw, dir_data_processed('sample.feather'))
208 changes: 0 additions & 208 deletions R/utils.R

This file was deleted.

20 changes: 8 additions & 12 deletions R/visualize.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
############################################################
# Charts, maps, etc. from your data
#
# Use the `write_plot` function to write the plot directly
# to the `plots/` folder, using the variable name as
# the filename.
#
############################################################
# =======================================================================
# Graphics. Use the `write_plot` function to write the plot directly
# to the `plots/` folder, using the variable name as the filename.
# =======================================================================

# plot_house_price_change <- ggplot(sample %>%
# filter(cma != 'C11'),
# aes(x = reorder(cma, yoy), y = yoy)) +
# plot_house_price_change <- sample %>%
# filter(cma != 'C11') %>%
# ggplot(aes(x = reorder(cma, yoy), y = yoy)) +
# geom_bar(colour = 'white', stat = 'identity') +
# scale_y_continuous(expand = c(0, 0), limits = c(0, 25)) +
# coord_flip() +
Expand All @@ -21,6 +17,6 @@
# ) +
# theme_classic()
#
# plot(plot_house_price_change)
# plot_house_price_change
#
# write_plot(plot_house_price_change)
Loading

0 comments on commit ba91f5c

Please sign in to comment.