sidebyside: Sidebyside

Description Usage Arguments Value Examples

View source: R/sidebyside.R

Description

Plots two of the years side by side to better compare the diversity of Williams College's geographical distribution of students. There is an international options, and a statemap option.

Usage

1
2
sidebyside(year1, year2, title1 = "", title2 = "", savename = "plot",
  US = TRUE, save = FALSE, interactive = FALSE, change = FALSE)

Arguments

year1

The vector for a year of data. It is important to note that you can also plot sidebyside data of differences

year2

The vector for a year of data

title1

The title of the plot and the name which it will be saved to

title2

The title of the second plot

savename

The name the plot is saved to

US

choice of mapping US territories or mapping international countries

save

TRUE to save, FALSE to not

interactive

TRUE to choose the interactive mode in viewer, FALSE to view in just the default plot

change

Selects whether the year vectors given are differences between years, or just comparing dirrect yearly geographical distributions

Value

sidebyside S4 object that has the different year datasets mapped to it

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
##Creating a state map of the data with data from 2001
usmap2001 <- sidebyside(yearsdata$X2001, yearsdata$X2002, title1 = "2001", title2 = "2002")

##Creating an international map with interactive view
worldmap <- sidebyside(yearsdata$X2001, yearsdata$X2002, title1 = "2001", title2 = "2002", US = FALSE)

##Creating a sidebyside map with change
usmapofdifferences <- sidebyside(yearsdata$X2001-yearsdata$X2000, yearsdata$X2015-yearsdata$X2014,
                                                                 title1 = "Change from 2000-2001",
                                                                 title2 = "Change from 2014-2015",
                                                                                   change = TRUE)

jian13579/mapstu documentation built on May 19, 2019, 9:28 a.m.