3 Data Visualization via ggplot2
We begin the development of your data science toolbox with data visualization. By visualizing our data, we will be able to gain valuable insights from our data that we couldn’t initially see from just looking at the raw data in spreadsheet form. We will use the ggplot2
package as it provides an easy way to customize your plots and is rooted in the data visualization theory known as The Grammar of Graphics (Wilkinson 2005).
At the most basic level, graphics/plots/charts (we use these terms interchangeably in this book) provide a nice way for us to get a sense for how quantitative variables compare in terms of their center (where the values tend to be located) and their spread (how they vary around the center). The most important thing to know about graphics is that they should be created to make it obvious for your audience to understand the findings and insight you want to get across. This does however require a balancing act. On the one hand, you want to highlight as many meaningful relationships and interesting findings as possible, but on the other you don’t want to include so many as to overwhelm your audience.
As we will see, plots/graphics also help us to identify patterns and outliers in our data. We will see that a common extension of these ideas is to compare the distribution of one quantitative variable (i.e., what the spread of a variable looks like or how the variable is distributed in terms of its values) as we go across the levels of a different categorical variable.
Needed packages
Let’s load all the packages needed for this chapter (this assumes you’ve already installed them). Read Section 2.3 for information on how to install and load R packages.
library(nycflights13)
library(ggplot2)
library(dplyr)
library(knitr)
3.1 The Grammar of Graphics
We begin with a discussion of a theoretical framework for data visualization known as the “The Grammar of Graphics,” which serves as the basis for the ggplot2
package. Much like how we construct sentences in any language by using a linguistic grammar (nouns, verbs, subjects, objects, etc.), the theoretical framework given by Leland Wilkinson (Wilkinson 2005) allows us to specify the components of a statistical graphic.
3.1.1 Components of the Grammar
In short, the grammar tells us that:
A statistical graphic is a
mapping
ofdata
variables toaes
thetic attributes ofgeom
etric objects.
Specifically, we can break a graphic into the following three essential components:
data
: the data-set comprised of variables that we map.geom
: the geometric object in question. This refers to our type of objects we can observe in our plot. For example, points, lines, bars, etc.aes
: aesthetic attributes of the geometric object that we can perceive on a graphic. For example, x/y position, color, shape, and size. Each assigned aesthetic attribute can be mapped to a variable in our data-set.
Let’s break down the grammar with an example.
3.1.2 Gapminder
In February 2006, a statistician named Hans Rosling gave a TED talk titled “The best stats you’ve ever seen” where he presented global economic, health, and development data from the website gapminder.org. For example, from the 1704 countries included from 2007, consider only the first 6 countries when listed alphabetically:
| Country | Continent | Life Expectancy | Population | GDP per Capita |
|---|---|---|---|---|
| Afghanistan | Asia | 43.83 | 31889923 | 974.6 |
| Albania | Europe | 76.42 | 3600523 | 5937.0 |
| Algeria | Africa | 72.30 | 33333216 | 6223.4 |
| Angola | Africa | 42.73 | 12420476 | 4797.2 |
| Argentina | Americas | 75.32 | 40301927 | 12779.4 |
| Australia | Oceania | 81.23 | 20434176 | 34435.4 |
Each row in this table corresponds to a country in 2007. For each row, we have 5 columns:
- Country: Name of country.
- Continent: Which of the five continents the country is part of. (Note that
Americas
groups North and South America and that Antarctica is excluded here.) - Life Expectancy: Life expectancy in years.
- Population: Number of people living in the country.
- GDP per Capita: Gross domestic product (in US dollars).
Now consider Figure 3.1, which plots this data for all 142 countries in the data frame. Note that R will deal with large numbers using scientific notation. So in the legend for “Population”, 1.25e+09 = \(1.25 \times 10^{9}\) = 1,250,000,000 = 1.25 billion.
Let’s view this plot through the grammar of graphics:
- The
data
variable GDP per Capita gets mapped to thex
-positionaes
thetic of the points. - The
data
variable Life Expectancy gets mapped to they
-positionaes
thetic of the points. - The
data
variable Population gets mapped to thesize
aes
thetic of the points. - The
data
variable Continent gets mapped to thecolor
aes
thetic of the points.
Recall that data
here corresponds to each of the variables being in the same data
frame and the “data variable” corresponds to a column in a data frame.
While in this example we are considering one type of geom
etric object (of type point
), graphics are not limited to just points. Some plots involve lines while others involve bars. Let’s summarize the three essential components of the grammar in a table:
| data variable | aes | geom |
|---|---|---|
| GDP per Capita | x | point |
| Life Expectancy | y | point |
| Population | size | point |
| Continent | color | point |
3.1.3 Other components of the Grammar
There are other components of the Grammar of Graphics we can control. As you start to delve deeper into the Grammar of Graphics, you’ll start to encounter these topics more and more often. In this book, we’ll only work with the two other components below (The other components are left to a more advanced text such as R for Data Science (Grolemund and Wickham 2016)):
facet
ing breaks up a plot into small multiples corresponding to the levels of another variable (Section 3.6)position
adjustments for barplots (Section 3.8)
In general, the Grammar of Graphics allows for a high degree of customization and also a consistent framework for easy updating/modification of plots.
3.1.4 The ggplot2 package
In this book, we will be using the ggplot2
package for data visualization, which is an implementation of the Grammar of Graphics for R (Wickham, Chang, et al. 2018). You may have noticed that a lot of the previous text in this chapter is written in computer font. This is because the various components of the Grammar of Graphics are specified in the ggplot
function, which expects at a bare minimum as arguments:
- The data frame where the variables exist: the
data
argument - The mapping of the variables to aesthetic attributes: the
mapping
argument, which specifies theaes
thetic attributes involved
After we’ve specified these components, we then add layers to the plot using the +
sign. The most essential layer to add to a plot is the specification of which type of geom
etric object we want the plot to involve; e.g. points, lines, bars. Other layers we can add include the specification of the plot title, axes labels, facets, and visual themes for the plot.
Let’s now put the theory of the Grammar of Graphics into practice.
3.2 Five Named Graphs - The 5NG
For our purposes, we will be limiting consideration to five different types of graphs. We term these five named graphs the 5NG:
- scatterplots
- linegraphs
- boxplots
- histograms
- barplots
We will discuss some variations of these plots, but with this basic repertoire in your toolbox you can visualize a wide array of different data variable types. Note that certain plots are only appropriate for categorical/logical variables and others only for quantitative variables. You’ll want to quiz yourself often as we go along on which plot makes sense a given a particular problem or data-set.
3.3 5NG#1: Scatterplots
The simplest of the 5NG are scatterplots (also called bivariate plots); they allow you to investigate the relationship between two numerical variables. While you may already be familiar with this type of plot, let’s view it through the lens of the Grammar of Graphics. Specifically, we will graphically investigate the relationship between the following two numerical variables in the flights
data frame:
dep_delay
: departure delay on the horizontal “x” axis andarr_delay
: arrival delay on the vertical “y” axis
for Alaska Airlines flights leaving NYC in 2013. This requires paring down the flights
data frame to a smaller data frame all_alaska_flights
consisting of only Alaska Airlines (carrier code “AS”) flights. Don’t worry for now if you don’t fully understand what this code is doing, we’ll explain this in details Chapter 5, just run it all and understand that we are taking all flights and only considering those corresponding to Alaska Airlines.
all_alaska_flights <- flights %>%
filter(carrier == "AS")
This code snippet makes use of functions in the dplyr
package for data wrangling to achieve our goal: it takes the flights
data frame and filter
s it to only return the rows which meet the condition carrier == "AS"
. Recall from Section 2.2 that testing for equality is specified with ==
and not =
. You will see many more examples of ==
and filter()
in Chapter 5.
Learning check
(LC3.1) Take a look at both the flights
and all_alaska_flights
data frames by running View(flights)
and View(all_alaska_flights)
in the console. In what respect do these data frames differ?
3.3.1 Scatterplots via geom_point
We proceed to create the scatterplot using the ggplot()
function:
ggplot(data = all_alaska_flights, mapping = aes(x = dep_delay, y = arr_delay)) +
geom_point()
In Figure 3.2 we see that a positive relationship exists between dep_delay
and arr_delay
: as departure delays increase, arrival delays tend to also increase. We also note that the majority of points fall near the point (0, 0). There is a large mass of points clustered there. Let’s break this down, keeping in mind our discussion in Section 3.1:
- Within the
ggplot()
function call, we specify two of the components of the grammar:- The
data
frame to beall_alaska_flights
by settingdata = all_alaska_flights
- The
aes
theticmapping
by settingaes(x = dep_delay, y = arr_delay)
. Specifically- the variable
dep_delay
maps to thex
position aesthetic - the variable
arr_delay
maps to they
position aesthetic
- the variable
- The
- We add a layer to the
ggplot()
function call using the+
sign. The layer in question specifies the third component of the grammar: thegeom
etric object. In this case the geometric object arepoint
s, set by specifyinggeom_point()
.
Some notes on layers:
- Note that the
+
sign comes at the end of lines, and not at the beginning. You’ll get an error in R if you put it at the beginning. - When adding layers to a plot, you are encouraged to hit Return on your keyboard after entering the
+
so that the code for each layer is on a new line. As we add more and more layers to plots, you’ll see this will greatly improve the legibility of your code. - To stress the importance of adding layers, in particular the layer specifying the
geom
etric object, consider Figure 3.3 where no layers are added. A not very useful plot!
ggplot(data = all_alaska_flights, mapping = aes(x = dep_delay, y = arr_delay))
Learning check
(LC3.2) What are some practical reasons why dep_delay
and arr_delay
have a positive relationship?
(LC3.3) What variables (not necessarily in the flights
data frame) would you expect to have a negative correlation (i.e. a negative relationship) with dep_delay
? Why? Remember that we are focusing on numerical variables here.
(LC3.4) Why do you believe there is a cluster of points near (0, 0)? What does (0, 0) correspond to in terms of the Alaskan flights?
(LC3.5) What are some other features of the plot that stand out to you?
(LC3.6) Create a new scatterplot using different variables in the all_alaska_flights
data frame by modifying the example above.
3.3.2 Over-plotting
The large mass of points near (0, 0) in Figure 3.2 can cause some confusion. This is the result of a phenomenon called overplotting. As one may guess, this corresponds to values being plotted on top of each other over and over again. It is often difficult to know just how many values are plotted in this way when looking at a basic scatterplot as we have here. There are two ways to address this issue:
- By adjusting the transparency of the points via the
alpha
argument - By jittering the points via
geom_jitter()
The first way of relieving overplotting is by changing the alpha
argument in geom_point()
which controls the transparency of the points. By default, this value is set to 1
. We can change this to any value between 0
and 1
where 0
sets the points to be 100% transparent and 1
sets the points to be 100% opaque. Note how the following function call is identical to the one in Section 3.3, but with alpha = 0.2
added to the geom_point()
.
ggplot(data = all_alaska_flights, mapping = aes(x = dep_delay, y = arr_delay)) +
geom_point(alpha = 0.2)
The key feature to note in Figure 3.4 is that the transparency of the points is cumulative: areas with a high-degree of overplotting are darker, whereas areas with a lower degree are less dark.
Note that there is no aes()
surrounding alpha = 0.2
here. Since we are NOT mapping a variable to an aesthetic but instead are just changing a setting, we don’t need to create a mapping with aes()
. In fact, you’ll receive an error if you try to change the second line above to geom_point(aes(alpha = 0.2))
.
The second way of relieving overplotting is to jitter the points a bit. In other words, we are going to add just a bit of random noise to the points to better see them and remove some of the overplotting. You can think of “jittering” as shaking the points around a bit on the plot. Instead of using geom_point
, we use geom_jitter
to perform this shaking. To specify how much jitter to add, we adjust the width
and height
arguments. This corresponds to how hard you’d like to shake the plot in units corresponding to those for both the horizontal and vertical variables (in this case, minutes).
ggplot(data = all_alaska_flights, mapping = aes(x = dep_delay, y = arr_delay)) +
geom_jitter(width = 30, height = 30)
Note how this function call is identical to the one in Subsection 3.3.1, but with geom_point()
replaced with geom_jitter()
. The plot in Figure 3.5 helps us a little bit in getting a sense for the overplotting, but with a relatively large data-set like this one (714 flights), it can be argued that changing the transparency of the points by setting alpha
proved more effective.
We’ll see later on that the two following R commands will yield the exact same plot:
ggplot(data = all_alaska_flights, mapping = aes(x = dep_delay, y = arr_delay)) +
geom_jitter(width = 30, height = 30)
ggplot(all_alaska_flights, aes(x = dep_delay, y = arr_delay)) +
geom_jitter(width = 30, height = 30)
In other words you can drop the data =
and mapping =
if you keep the order of the two arguments the same. Since the ggplot()
function is expecting its first argument data
to be a data frame and its second argument to correspond to mapping =
, you can omit both and you’ll get the same plot. As you get more and more practice, you’ll likely find yourself not including the specification of the argument like this. But for now to keep things straightforward let’s make it a point to include the data =
and mapping =
.
Learning check
(LC3.7) Why is setting the alpha
argument value useful with scatterplots? What further information does it give you that a regular scatterplot cannot?
(LC3.8) After viewing the Figure 3.4 above, give an approximate range of arrival delays and departure delays that occur the most frequently. How has that region changed compared to when you observed the same plot without the alpha = 0.2
set in Figure 3.2?
3.3.3 Summary
Scatterplots display the relationship between two numerical variables. They are among the most commonly used plots because they can provide an immediate way to see the trend in one variable versus another. However, if you try to create a scatterplot where either one of the two variables is not numerical, you will get strange results. Be careful!
With medium to large data-sets, you may need to play with either geom_jitter()
or the alpha
argument in order to get a good feel for relationships in your data. This tweaking is often a fun part of data visualization since you’ll have the chance to see different relationships come about as you make subtle changes to your plots.
3.4 5NG#2: Linegraphs
The next of the 5NG is a linegraph. They are most frequently used when the x-axis represents time and the y-axis represents some other numerical variable; such plots are known as time series. Time represents a variable that is connected together by each day following the previous day. In other words, time has a natural ordering. Linegraphs should be avoided when there is not a clear sequential ordering to the explanatory variable, i.e. the x-variable or the predictor variable.
Our focus now turns to the temp
variable in this weather
data-set. By
- Looking over the
weather
data-set by typingView(weather)
in the console. - Running
?weather
to bring up the help file.
We can see that the temp
variable corresponds to hourly temperature (in Fahrenheit) recordings at weather stations near airports in New York City. Instead of considering all hours in 2013 for all three airports in NYC, let’s focus on the hourly temperature at Newark airport (origin
code “EWR”) for the first 15 days in January 2013. The weather
data frame in the nycflights13
package contains this data, but we first need to filter it to only include those rows that correspond to Newark in the first 15 days of January.
early_january_weather <- weather %>%
filter(origin == "EWR" & month == 1 & day <= 15)
This is similar to the previous use of the filter
command in Section 3.3, however we now use the &
operator. The above selects only those rows in weather
where the originating airport is "EWR"
and we are in the first month and the day is from 1 to 15 inclusive.
Learning check
(LC3.9) Take a look at both the weather
and early_january_weather
data frames by running View(weather)
and View(early_january_weather)
in the console. In what respect do these data frames differ?
(LC3.10) View()
the flights
data frame again. Why does the time_hour
variable uniquely identify the hour of the measurement whereas the hour
variable does not?
3.4.1 Linegraphs via geom_line
We plot a linegraph of hourly temperature using geom_line()
:
ggplot(data = early_january_weather, mapping = aes(x = time_hour, y = temp)) +
geom_line()
Much as with the ggplot()
call in Chapter 3.3.1, we describe the components of the Grammar of Graphics:
- Within the
ggplot()
function call, we specify two of the components of the grammar:- The
data
frame to beearly_january_weather
by settingdata = early_january_weather
- The
aes
thetic mapping by settingaes(x = time_hour, y = temp)
. Specificallytime_hour
(i.e. the time variable) maps to thex
positiontemp
maps to they
position
- The
- We add a layer to the
ggplot()
function call using the+
sign - The layer in question specifies the third component of the grammar: the
geom
etric object in question. In this case the geometric object is aline
, set by specifyinggeom_line()
.
Learning check
(LC3.11) Why should linegraphs be avoided when there is not a clear ordering of the horizontal axis?
(LC3.12) Why are linegraphs frequently used when time is the explanatory variable?
(LC3.13) Plot a time series of a variable other than temp
for Newark Airport in the first 15 days of January 2013.
3.4.2 Summary
Linegraphs, just like scatterplots, display the relationship between two numerical variables. However, the variable on the x-axis (i.e. the explanatory variable) should have a natural ordering, like some notion of time. We can mislead our audience if that isn’t the case.
3.5 5NG#3: Histograms
Let’s consider the temp
variable in the weather
data frame once again, but now unlike with the linegraphs in Chapter 3.4, let’s say we don’t care about the relationship of temperature to time, but rather we care about the (statistical) distribution of temperatures. We could just produce points where each of the different values appear on something similar to a number line:
This gives us a general idea of how the values of temp
differ. We see that temperatures vary from around 11 up to 100 degrees Fahrenheit. The area between 40 and 60 degrees appears to have more points plotted than outside that range.
3.5.1 Histograms via geom_histogram
What is commonly produced instead of the above plot is a plot known as a histogram. The histogram shows how many elements of a single numerical variable fall in specified bins. In this case, these bins may correspond to between 0-10°F, 10-20°F, etc. We produce a histogram of the hour temperatures at all three NYC airports in 2013:
ggplot(data = weather, mapping = aes(x = temp)) +
geom_histogram()
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Warning: Removed 1 rows containing non-finite values (stat_bin).
Note here:
- There is only one variable being mapped in
aes()
: the single numerical variabletemp
. You don’t need to compute the y-aesthetic: it gets computed automatically. - We set the
geom
etric object to begeom_histogram()
- We got a warning message of
1 rows containing non-finite values
being removed. This is due to one of the values of temperature being missing. R is alerting us that this happened.
- Another warning corresponds to an urge to specify the number of bins you’d like to create.
3.5.2 Adjusting the bins
We can adjust characteristics of the bins in one of two ways:
- By adjusting the number of bins via the
bins
argument - By adjusting the width of the bins via the
binwidth
argument
First, we have the power to specify how many bins we would like to put the data into as an argument in the geom_histogram()
function. By default, this is chosen to be 30 somewhat arbitrarily; we have received a warning above our plot that this was done.
ggplot(data = weather, mapping = aes(x = temp)) +
geom_histogram(bins = 60, color = "white")
Note the addition of the color
argument. If you’d like to be able to more easily differentiate each of the bins, you can specify the color of the outline as done above. You can also adjust the color of the bars by setting the fill
argument. Type colors()
in your console to see all 657 available colors.
ggplot(data = weather, mapping = aes(x = temp)) +
geom_histogram(bins = 60, color = "white", fill = "steelblue")
Second, instead of specifying the number of bins, we can also specify the width of the bins by using the binwidth
argument in the geom_histogram
function.
ggplot(data = weather, mapping = aes(x = temp)) +
geom_histogram(binwidth = 10, color = "white")
Learning check
(LC3.14) What does changing the number of bins from 30 to 60 tell us about the distribution of temperatures?
(LC3.15) Would you classify the distribution of temperatures as symmetric or skewed?
(LC3.16) What would you guess is the “center” value in this distribution? Why did you make that choice?
(LC3.17) Is this data spread out greatly from the center or is it close? Why?
3.5.3 Summary
Histograms, unlike scatterplots and linegraphs, present information on only a single numerical variable. In particular they are visualizations of the (statistical) distribution of values.
3.6 Facets
Before continuing the 5NG, we briefly introduce a new concept called faceting. Faceting is used when we’d like to create small multiples of the same plot over a different categorical variable. By default, all of the small multiples will have the same vertical axis.
For example, suppose we were interested in looking at how the temperature histograms we saw in Chapter 3.5 varied by month. This is what is meant by “the distribution of a variable over another variable”: temp
is one variable and month
is the other variable. In order to look at histograms of temp
for each month, we add a layer facet_wrap(~ month)
. You can also specify how many rows you’d like the small multiple plots to be in using nrow
or how many columns using ncol
inside of facet_wrap
.
ggplot(data = weather, mapping = aes(x = temp)) +
geom_histogram(binwidth = 5, color = "white") +
facet_wrap(~ month, nrow = 4)
Note the use of the ~
before month
in facet_wrap
. The tilde (~
) is required and you’ll receive the error Error in as.quoted(facets) : object 'month' not found
if you don’t include it before month
here.
As we might expect, the temperature tends to increase as summer approaches and then decrease as winter approaches.
Learning check
(LC3.18) What other things do you notice about the faceted plot above? How does a faceted plot help us see relationships between two variables?
(LC3.19) What do the numbers 1-12 correspond to in the plot above? What about 25, 50, 75, 100?
(LC3.20) For which types of data-sets would these types of faceted plots not work well in comparing relationships between variables? Give an example describing the nature of these variables and other important characteristics.
(LC3.21) Does the temp
variable in the weather
data-set have a lot of variability? Why do you say that?
3.7 5NG#4: Boxplots
While using faceted histograms can provide a way to compare distributions of a numerical variable split by groups of a categorical variable as in Section 3.6, an alternative plot called a boxplot (also called a side-by-side boxplot) achieves the same task and is frequently preferred. The boxplot uses the information provided in the five-number summary referred to in Appendix A. It gives a way to compare this summary information across the different levels of a categorical variable.
3.7.1 Boxplots via geom_boxplot
Let’s create a boxplot to compare the monthly temperatures as we did above with the faceted histograms.
ggplot(data = weather, mapping = aes(x = month, y = temp)) +
geom_boxplot()
Warning messages:
1: Continuous x aesthetic -- did you forget aes(group=...)?
2: Removed 1 rows containing non-finite values (stat_boxplot).
Note the set of warnings that is given here. The second warning corresponds to missing values in the data frame and it is turned off on subsequent plots. Let’s focus on the first warning.
Observe that this plot does not look like what we were expecting. We were expecting to see the distribution of temperatures for each month (so 12 different boxplots). The first warning is letting us know that we are plotting a numerical, and not categorical variable, on the x-axis. This gives us the overall boxplot without any other groupings. We can get around this by introducing a new function for our x
variable:
ggplot(data = weather, mapping = aes(x = factor(month), y = temp)) +
geom_boxplot()
We have introduced a new function called factor()
here. One of the things this function does is to convert a discrete value like month
(1, 2, …, 12) into a categorical variable. The “box” part of this plot represents the 25th percentile, the median (50th percentile), and the 75th percentile. The dots correspond to outliers. (The specific formulation for these outliers is discussed in Appendix A.) The lines show how the data varies that is not in the center 50% defined by the first and third quantiles. Longer lines correspond to more variability and shorter lines correspond to less variability.
Looking at this plot we can see, as expected, that summer months (6 through 8) have higher median temperatures. We can easily compare temperatures across months by drawing imaginary horizontal lines across the plot. Furthermore, the height of the 12 boxes are informative too; they tell us about variability, or spread, of temperatures recorded in a given month.
But to really bring home what boxplots show, let’s focus only on the month of November’s 2141 temperature recordings.
Now let’s plot all 2141 temperature recordings for November on top of the boxplot in Figure 3.16.
What the boxplot does is summarize the 2141 points for you, in particular:
- 25% of points (about 534 observations) fall below the bottom edge of the box which is the first quartile of 35.96 degrees Farenheit (2.2 degrees Celsius). In other words 25% of observations were colder than 35.96 degrees Farenheit.
- 25% of points fall between the bottom edge of the box and the solid middle line which is the median of 44.96 degrees Farenheit (7.8 degrees Celsius). In other words 25% of observations were between 35.96 and 44.96 degrees Farenheit.
- 25% of points fall between the solid middle line and the top edge of the box which is the third quartile of 51.98 degrees Farenheit (11.1 degrees Celsius). In other words 25% of observations were between 44.96 and 51.98 degrees Farenheit.
- 25% of points fall over the top edge of the box. In other words 25% of observations were warmer than 51.98 degrees Farenheit.
Learning check
(LC3.22) What does the dot at the bottom of the plot for May correspond to? Explain what might have occurred in May to produce this point.
(LC3.23) Which months have the highest variability in temperature? What reasons do you think this is?
(LC3.24) We looked at the distribution of a numerical variable over a categorical variable here with this boxplot. Why can’t we look at the distribution of one numerical variable over the distribution of another numerical variable? Say, temperature across pressure, for example?
(LC3.25) Boxplots provide a simple way to identify outliers. Why may outliers be easier to identify when looking at a boxplot instead of a faceted histogram?
3.7.2 Summary
Boxplots provide a way to compare and contrast the distribution of one quantitative variable across multiple levels of one categorical variable. One can see where the median falls across the different groups by looking at the center line in the box. To see how spread out the variable is across the different groups, look at both the width of the box and also how far the lines stretch vertically from the box. (If the lines stretch far from the box but the box has a small width, the variability of the values closer to the center is much smaller than the variability of the outer ends of the variable.) Outliers are even more easily identified when looking at a boxplot than when looking at a histogram.
3.8 5NG#5: Barplots
Both histograms and boxplots represent ways to visualize the variability of numerical variables. Another common task is to present the distribution of a categorical variable. This is a simpler task, focused on how many elements from the data fall into different categories of the categorical variable. Often the best way to visualize these different counts (also known as frequencies) is via a barplot, also known as a barchart.
One complication, however, is how your counts are represented in your data. For example, run the following code in your Console. This code manually creates two data frames representing counts of fruit.
fruits <- data_frame(
fruit = c("apple", "apple", "apple", "orange", "orange")
)
fruits_counted <- data_frame(
fruit = c("apple", "orange"),
number = c(3, 2)
)
We see both the fruits
and fruits_counted
data frames represent the same collection of fruit: three apples and two oranges. However, whereas fruits
just lists the fruit:
| fruit |
|---|
| apple |
| apple |
| apple |
| orange |
| orange |
fruits_counted
has a variable count
, where the counts are pre-tabulated.
| fruit | number |
|---|---|
| apple | 3 |
| orange | 2 |
Compare the barcharts in Figures 3.17 and 3.18, which are identical, but are based on two different data frames:
ggplot(data = fruits, mapping = aes(x = fruit)) +
geom_bar()
ggplot(data = fruits_counted, mapping = aes(x = fruit, y = number)) +
geom_col()
Observe that:
- The code that generates Figure 3.17 based on
fruits
does not have an explicity
aes
thetic and usesgeom_bar()
- The code that generates Figure 3.18 based on
fruits_counted
has an explicity
aes
thetic (to the variablenumber
) and usesgeom_col()
(Please note that this one of ggplot2
’s trickier aspects that causes the most confusion, and fortunately this is as complicated as our use of ggplot2
is going to get.) Stating the above differently:
- When the categorical variable you want to plot is not pre-tabulated in your data frame you need to use
geom_bar()
. - When the categorical variable is pre-tabulated (in the above
fruits_counted
example in the variablenumber
), you need to usegeom_col()
with they
aesthetic explicitly mapped.
3.8.1 Barplots via geom_bar/geom_col
Consider the distribution of airlines that flew out of New York City in 2013. Here we explore the number of flights from each airline/carrier
. This can be plotted by invoking the geom_bar
function in ggplot2
:
ggplot(data = flights, mapping = aes(x = carrier)) +
geom_bar()
To get an understanding of what the names of these airlines are corresponding to these carrier
codes, we can look at the airlines
data frame in the nycflights13
package.
airlines
| carrier | name |
|---|---|
| 9E | Endeavor Air Inc. |
| AA | American Airlines Inc. |
| AS | Alaska Airlines Inc. |
| B6 | JetBlue Airways |
| DL | Delta Air Lines Inc. |
| EV | ExpressJet Airlines Inc. |
| F9 | Frontier Airlines Inc. |
| FL | AirTran Airways Corporation |
| HA | Hawaiian Airlines Inc. |
| MQ | Envoy Air |
| OO | SkyWest Airlines Inc. |
| UA | United Air Lines Inc. |
| US | US Airways Inc. |
| VX | Virgin America |
| WN | Southwest Airlines Co. |
| YV | Mesa Airlines Inc. |
| Going back | to our barplot, we see that United Air Lines, JetBlue Airways, and ExpressJet Airlines had the most flights depart New York City in 2013. To get the actual number of flights by each airline we can use the group_by() , summarize() , and n() functions in the dplyr package on the carrier variable in flights , which we will introduce formally in Chapter 5. |
flights_table <- flights %>%
group_by(carrier) %>%
summarize(number = n())
flights_table
| carrier | number |
|---|---|
| 9E | 18460 |
| AA | 32729 |
| AS | 714 |
| B6 | 54635 |
| DL | 48110 |
| EV | 54173 |
| F9 | 685 |
| FL | 3260 |
| HA | 342 |
| MQ | 26397 |
| OO | 32 |
| UA | 58665 |
| US | 20536 |
| VX | 5162 |
| WN | 12275 |
| YV | 601 |
In this table, the counts of the carriers are pre-tabulated. To create a barchart using the data frame flights_table
, we use geom_col
and map the y
aesthetic to the variable number
. Compare this barplot using geom_col
in Figure 3.20 with the earlier barplot using geom_bar
in Figure 3.19. They are identical.
ggplot(data = flights_table, mapping = aes(x = carrier, y = number)) +
geom_col()
Learning check
(LC3.26) Why are histograms inappropriate for visualizing categorical variables?
(LC3.27) What is the difference between histograms and barplots?
(LC3.28) How many Envoy Air flights departed NYC in 2013?
(LC3.29) What was the seventh highest airline in terms of departed flights from NYC in 2013? How could we better present the table to get this answer quickly.
3.8.2 Must avoid pie charts!
Unfortunately, one of the most common plots seen today for categorical data is the pie chart. While they may see harmless enough, they actually present a problem in that humans are unable to judge angles well. As Naomi Robbins describes in her book “Creating More Effective Graphs” (Robbins 2013), we overestimate angles greater than 90 degrees and we underestimate angles less than 90 degrees. In other words, it is difficult for us to determine relative size of one piece of the pie compared to another.
Let’s examine our previous barplot example on the number of flights departing NYC by airline. This time we will use a pie chart. As you review this chart, try to identify
- how much larger the portion of the pie is for ExpressJet Airlines (
EV
) compared to US Airways (US
), - what the third largest carrier is in terms of departing flights, and
- how many carriers have fewer flights than United Airlines (
UA
)?
While it is quite easy to look back at the barplot to get the answer to these questions, it’s quite difficult to get the answers correct when looking at the pie graph. Barplots can always present the information in a way that is easier for the eye to determine relative position. There may be one exception from Nathan Yau at FlowingData.com but we will leave this for the reader to decide:
Learning check
(LC3.30) Why should pie charts be avoided and replaced by barplots?
(LC3.31) What is your opinion as to why pie charts continue to be used?
3.8.3 Using barplots to compare two categorical variables
Barplots are the go-to way to visualize the frequency of different categories of a categorical variable. They make it easy to order the counts and to compare the frequencies of one group to another. Another use of barplots (unfortunately, sometimes inappropriately and confusingly) is to compare two categorical variables together. Let’s examine the distribution of outgoing flights from NYC by carrier
and airport
.
We begin by getting the names of the airports in NYC that were included in the flights
data-set. Here, we preview the inner_join()
function from Chapter 5. This function will join the data frame flights
with the data frame airports
by matching rows that have the same airport code. However, in flights
the airport code is included in the origin
variable whereas in airports
the airport code is included in the faa
variable. We will revisit such examples in Section 5.8 on joining data-sets.
flights_namedports <- flights %>%
inner_join(airports, by = c("origin" = "faa"))
After running View(flights_namedports)
, we see that name
now corresponds to the name of the airport as referenced by the origin
variable. We will now plot carrier
as the horizontal variable. When we specify geom_bar
, it will specify count
as being the vertical variable. A new addition here is fill = name
. Look over what was produced from the plot to get an idea of what this argument gives.
ggplot(data = flights_namedports, mapping = aes(x = carrier, fill = name)) +
geom_bar()
This plot is what is known as a stacked barplot. While simple to make, it often leads to many problems. For example in this plot, it is difficult to compare the heights of the different colors (corresponding to the number of flights from each airport) between the bars (corresponding to the different carriers).
Note that fill
is an aes
thetic just like x
is an aes
thetic, and thus must be included within the parentheses of the aes()
mapping. The following code, where the fill
aes
thetic is specified on the outside will yield an error. This is a fairly common error that new ggplot
users make:
ggplot(data = flights_namedports, mapping = aes(x = carrier), fill = name) +
geom_bar()
Learning check
(LC3.32) What kinds of questions are not easily answered by looking at the above figure?
(LC3.33) What can you say, if anything, about the relationship between airline and airport in NYC in 2013 in regards to the number of departing flights?
Another variation on the stacked barplot is the side-by-side barplot.
ggplot(data = flights_namedports, mapping = aes(x = carrier, fill = name)) +
geom_bar(position = "dodge")
Learning check
(LC3.34) Why might the side-by-side barplot be preferable to a stacked barplot in this case?
(LC3.35) What are the disadvantages of using a side-by-side barplot, in general?
Lastly, an often preferred type of barplot is the faceted barplot. We already saw this concept of faceting and small multiples in Section 3.6. This gives us a nicer way to compare the distributions across both carrier
and airport/name
.
ggplot(data = flights_namedports, mapping = aes(x = carrier, fill = name)) +
geom_bar() +
facet_grid(name ~ .)
Note how the facet_grid
function arguments are written here. We are wanting the names of the airports vertically and the carrier
listed horizontally. As you may have guessed, this argument and other formulas of this sort in R are in y ~ x
order. We will see more examples of this in Chapter 6.
If you’d like to create small multiples in a vertical direction, you’ll want to use facet_grid()
with the name of the variable before the ~
as we did in Figure 3.25. This corresponds to vertical going with y
in the formula. If instead you’d like the small multiples to be in the horizontal direction, you’d use facet_grid()
with the name of the variable after the ~
, corresponding to the x
position in the formula. Further, you can use facet_wrap()
if you would like the small multiples to wrap into multiple rows as we saw earlier in the faceted histogram example in Figure 3.12. Additionally, you could use facet_grid()
with one variable in the y
position and another variable in the x
position creating a grid of all possible combinations of the two variables.
Learning check
(LC3.36) Why is the faceted barplot preferred to the side-by-side and stacked barplots in this case?
(LC3.37) What information about the different carriers at different airports is more easily seen in the faceted barplot?
3.8.4 Summary
Barplots are the preferred way of displaying categorical variables. They are easy-to-understand and make it easy to compare across groups of a categorical variable. When dealing with more than one categorical variable, faceted barplots are frequently preferred over side-by-side or stacked barplots. Stacked barplots are sometimes nice to look at, but it is quite difficult to compare across the levels since the sizes of the bars are all of different sizes. Side-by-side barplots can provide an improvement on this, but the issue about comparing across groups still must be dealt with.
3.9 Conclusion
3.9.1 Review questions
Review questions have been designed using the fivethirtyeight
R package (Kim, Ismay, and Chunn 2018) with links to the corresponding FiveThirtyEight.com articles in our free DataCamp course Effective Data Storytelling using the tidyverse
. The material in this chapter is covered in the chapters of the DataCamp course available below:
3.9.2 What’s to come?
In Chapter 4, we’ll introduce the concept of “tidy data” and how it is used as a key data format for all the packages we use in this textbook. You’ll see that the concept appears to be simple, but actually can be a little challenging to decipher without careful practice. We’ll also investigate how to import CSV (comma-separated value) files into R using the readr
package.
3.9.3 Resources
An excellent resource as you begin to create plots using the ggplot2
package is a cheatsheet that RStudio has put together entitled “Data Visualization with ggplot2” available
- by clicking here or
- by clicking the RStudio Menu Bar -> Help -> Cheatsheets -> “Data Visualization with
ggplot2
”
This cheatsheet covers more than what we’ve discussed in this chapter but provides nice visual descriptions of what each function produces.
In addition, we’ve created a mind map to help you remember which types of plots are most appropriate in a given situation by identifying the types of variables involved in the problem.
3.9.4 Script of R code
An R script file of all R code used in this chapter is available here.


|
masscalculator-core
|
Class Titanium, that holds all the nessesary information for Titanium and it's types therefore we can use in the interface. More...
#include <titanium.h>
Classes | |
| struct | Properties |
| Struct with material specific properties. More... | |
Public Types | |
| enum class | Type : uint8_t { BEGIN = 0 , T_6Al4V = BEGIN , T_Grade2 , T_Grade4 , T_Grade5 , UNSPECIFIED , END } |
| Enum that holds the Titanium types. More... | |
| typedef enum Type uint8_t struct MassCalculator::Materials::Titanium::Properties | Properties_t |
| Struct with material specific properties. | |
Public Member Functions | |
| Titanium (void) | |
| Construct a new Titanium object. | |
| Titanium (const Type &type) | |
| Construct a new Titanium object and specify the type. | |
| bool | initLuaScript (void) |
| Function to initialize the Lua object. | |
| bool | setType (const Type &type) |
| Set the Type object. More... | |
| std::pair< std::string, Type > | getType (void) const |
| Get the Type object. More... | |
| std::string | getSpecificColor (void) const |
| Get the Specific Color object. More... | |
| kilograms_per_cubic_meter_t | getSpecificDensity (void) const |
| Get the Specific Density object. More... | |
| meters_per_second_squared_t | getSpecificGravity (void) const |
| Get the Specific Gravity object. More... | |
| kelvin_t | getSpecificMeltingPoint (void) const |
| Get the Specific Melting Point object. More... | |
| double | getSpecificPoissonsRatio (void) const |
| Get the Specific PoissonsRatio object. More... | |
| watt_t | getSpecificThermalConductivity (void) const |
| Get the Specific Thermal Conductivity object. More... | |
| pascal_t | getSpecificModOfElasticityTension (void) const |
| Get the Specific Modulus of Elasticity Tension object. More... | |
| pascal_t | getSpecificModOfElasticityTorsion (void) const |
| Get the Specific Modulus of Elasticity Torsion object. More... | |
| ~Titanium (void)=default | |
| Destroy the Titanium object. | |
| Titanium (const Titanium &)=delete | |
| Delete copy constructor. | |
| Titanium (Titanium &&)=default | |
| Set move constructor to default. | |
| Titanium & | operator= (const Titanium &)=delete |
| Delete assignment operator. | |
| Titanium & | operator= (Titanium &&)=default |
| Allow move assignment operator. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Titanium &obj) |
| Shift operator overload for class Titanium, this will print all the nessesery informations. | |
| std::ostream & | operator<< (std::ostream &os, const Titanium::Type &type) |
| Shift operator overload for Types of Titanium, this will print the name in string. | |
Class Titanium, that holds all the nessesary information for Titanium and it's types therefore we can use in the interface.
|
strong |
Enum that holds the Titanium types.
| Enumerator | |
|---|---|
| T_6Al4V |
|
| T_Grade2 |
|
| T_Grade4 |
|
| T_Grade5 |
|
| UNSPECIFIED | Unspecified metal alloy. |
| std::string MassCalculator::Materials::Titanium::getSpecificColor | ( | void | ) | const |
Get the Specific Color object.
| kilograms_per_cubic_meter_t MassCalculator::Materials::Titanium::getSpecificDensity | ( | void | ) | const |
Get the Specific Density object.
| meters_per_second_squared_t MassCalculator::Materials::Titanium::getSpecificGravity | ( | void | ) | const |
Get the Specific Gravity object.
| kelvin_t MassCalculator::Materials::Titanium::getSpecificMeltingPoint | ( | void | ) | const |
Get the Specific Melting Point object.
| pascal_t MassCalculator::Materials::Titanium::getSpecificModOfElasticityTension | ( | void | ) | const |
Get the Specific Modulus of Elasticity Tension object.
| pascal_t MassCalculator::Materials::Titanium::getSpecificModOfElasticityTorsion | ( | void | ) | const |
Get the Specific Modulus of Elasticity Torsion object.
| double MassCalculator::Materials::Titanium::getSpecificPoissonsRatio | ( | void | ) | const |
Get the Specific PoissonsRatio object.
| watt_t MassCalculator::Materials::Titanium::getSpecificThermalConductivity | ( | void | ) | const |
Get the Specific Thermal Conductivity object.
| std::pair< std::string, Titanium::Type > MassCalculator::Materials::Titanium::getType | ( | void | ) | const |
Get the Type object.
| bool MassCalculator::Materials::Titanium::setType | ( | const Type & | type | ) |
Set the Type object.
| type | Type of the Titanium |


| DOSE: |
1 hit |
smoked |
5-MeO-DMT |
(powder / crystals) |
First time user with lots of other previous exploration. It's like the line from the Matrix where Neo is asked if he wants to take the red pill or the green pill. If I had been not prepared to have the illusion of the world crumble and the veil pulled aside, I would have left it for now until I felt called to do it.
Sunday morning 11am. No food since previous evening. One very experienced person was with me and I was laying back on the couch with soft music playing. I prepared myself mentally to totally surrender into the experience by doing some Yogic breathing and holding (bandas) and breath holds. I'm not sure about the dose but it was one hit of white crystal/powder held as long as possible (approx. 40 sec.).
I had worked with DMT several times in the past and was prepared for a similar shock. I've have numerous experiences with high dose mushroom journeys, large dose LSD 'psychotherapy' sessions, traditional Ayahuasca sessions, and DMT. In addition, I've practiced Hatha Yoga for over 5 years and have worked with altered states in holotropic breathing sessions, rebirthing, Tantric Yoga, and Gestalt Practice. All of these experiences have been approached with an intention for transformation that filters into everyday awareness.
What I got after about 30 seconds of one hit was an immediate complete dissolution of any identity and a merging into the Oneness, timeless, pure awareness and light energy of the Universe (which we are - as above, so below, the macrocosm within the microcosm ). An enlightenment experience. Complete clarity. Similar in some ways with a previous Samadhi meditation experience. I also had the experience of energetically dumping Everything that I had been holding onto from the past up to that point in my life. There was a knowingness that all of my previous 'suffering' was designed perfectly and got me to this point in time where I could have such a direct experience of my (our) true nature.
The experience lasted about 10 minutes. As I started to come down I noticed the strong expectation that this would have an immediate effect on my experience of the material world. After about 30 minutes that was not the case. Everything was back to normal. I began to have a hard time remembering certain realizations of the experience that had previously been so obvious and seemed like I would remember. I know that in the past insights from these types of high impact experiences start to filter wisdom into normal awareness.
This was very different than my three DMT experiences where I seemed to be in other dimensions that clearly had entities present with vibrant visuals. I also did not experience the initial terror of the DMT experience. With 5MEO I seemed to go beyond everything - to nothing (No-Thing). It was a much smoother and gentler experience - more loving.
What did all this mean? I'm not sure. Still integrating the experience. I continue to be deluded by the illusions of the world and my mind(thoughts), and really truly believe, in my normal awareness, that I am a person limited by my false identity and Thoughts about myself and the world.
It certainly showed me a state of perception that I can have again. In meditation, I now have a better idea of what letting go is and how to do it, of what being present is. Now, I see that the calling for me is to learn to move through the different stages of awareness without being assisted by substances, although they continue to be teaching tools. The work is to continue to distinguish between self and Self, and to integrate as I go through my day-to-day life. The importance of having a practice to integrate the different states of awareness on a regular basis is more obvious and therefore strengthens my commitment. In my case it's Yoga.
I would definitely do it again with no problem but would caution others to only do it if it calls to you and to prepare for the intensity and totality of it the best you can. Intention is key. Surrender is the answer.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


This web app is designed to help you wake up with the sounds you like.
They may be songs, mixes, playlists, recorded radio shows or live web radio stations!
Setting an alarm is as easy as choosing the time and pasting the link of a website.
You can manage a list of alarms which will still be there when you come back another time.
This app can be used on a computer with speakers or a mobile; you only need to keep the browser opened.
All links are allowed!
You can copy and paste links from Youtube, TuneIn,
SoundCloud, DI.fm and many more!
You can use links to local files too.
Just make sure that a sound is played directly when the window is opened.
Please allow pop-ups in order to open the links when time has come.
Nowadays, browsers block pop-ups by default to prevent from SPAMs, undesired commercial content...
You can test the permissions of your browser by setting an alarm in one minute.
If there is an alert, please choose to "Allow pop-ups on this site".
Pop-up ads will never come.
This web app has been built in JavaScript using Angular.js,
and based on ngBoilerplate.
For now, it only runs client-side.
This app is open-source and the code is available on GitHub.
You can participate by forking the projet, finding bugs or asking for new features.


palindromeemordnilap
Enter text to evaluate as a palindrome:
Evaluate!
Your text is a palindrome!
Your text is not a palindrome!


Your message is important to us, and we'll get back to you in tops 48 hours
Browse by Category See All
Recommendations for You See All
Best Sellers See All


the and with for that â€". SARS-CoV- protein SARS-CoV ACE coronavirus entry viral from value al. respiratory fusion are human virus was infection syndrome spike against can could M.; acute domain L.; inhibit The J.; host into peptide severe {background A.; activity cell inhibitors RBD also antiviral cathepsin cells identified respectively. MERS-CoV showed inhibitor its membrane novel treatment Î¼M inhibition margin Î¼M, Î¼M. H.; Table values {border-style (Figure S.; binding small this antibodies potent px;} research van #ffffff;} E.; block have targeting were C.; R.; Res., University assay cleavage drug peptides protease SARS both development has not other receptor studies target This Virol., W.; cells. high highly such via G.; Inhibitors demonstrated derived entry. enzyme new protein. ACE. COVID- East SARS-CoV-. Shandong Y.; cellular found his mAb monoclonal most two (), Antiviral Figure Middle Recently, around been blocked complex endosomal inhibiting interaction molecules potential site used using which ./JVI.-. ./s---. D.; F.; angiotensin-converting currently discovery infections influenza inhibitory mechanism neutralizing promising received replication reported revealed structural structure three ./j.antiviral.... However, Sci. TMPRSS antibody compared compounds crucial effective furin important more potentially region similar specific therapeutic > ./pnas.. A., Acad. B.; DOI: His K.; Natl. Proc. Professor REGN SARS-CoV. Small T.; Targeting Therefore, Vero ZhangL.; active assay, between data degree entry, first glycoprotein including intervention molecule mouse patients proteases proteolytic px; role screen sequence suggested their vaccine {font-family ACE, Cell Chem., Coronavirus E-HRP Ebola Further Health P.; Ph.D. RBD-ACE RNA SARS-CoV, These angiotensin basis chloroquine conserved der design essential font-size fusion. infection, infection. library prevent residues screening serine than within (S) (cluster ./.... Although Among Azad Biol. BoschB. HCoV-E Liu Mol. Molecules Moreover, PLoS Science, University, Using XiaS.; activation activity. addition, analysis attractive available bind blocking blocks caused clinical confirmed coronaviruses current cytotoxicity described developed did directly diverse double; drugs during efficacy further genome highlight however, inhibited inhibitor. inhibitors, interests loop lung mice nM, obtained pathway process products pseudovirus recent receptor, receptor-binding shedding small-molecule some strategies surface therapy these transgenic very viruses vitro while (in ./. Antimicrob. C-terminal China, DimitrovD. Dis., DuL.; For FriemanM. HIV- HRP Infect. Interestingly, JiangS.; LiW.; LiY.; N-terminal PDB SARS-COV- Spike Tyr, WangQ.; World ZhangH.; ZhuY.; acid action additional affinity amino antibodies, any applications associated blood border-color border-width but catalytic coronaviruses. critical cycle cysteine disease displayed domains due effect expressing global heptad immunized include inhibitor, interact late low mice. molecular neutralization peptide, peptides, potently processing prophylactic protected protein, protein-mediated provide pseudotyped recognition recombinant reduced regions responsible same several significant solid; specifically step strategy study targets them, they through transmembrane upon virus, {font-style {font-weight â€¯ (accessed -HB -nCoV ./j.virol.... ./jbc.M. Agents Chemother., Clin. Drexel FarzanM.; HCoV-NL HR- Host Int. LiuJ.; LiuX.; LuL.; MERS-CoV, Molecular Peptide Pharmaceutical Pharmacol., RBD, Recent SARS-CoV-, SP- School Structural Two V.; Virology, WangC.; XiaoX.; XuW.; YamamotoN.; YangX.; YuenK. ZhangJ.; ZhangZ.; after al., all available. based bold bound broad-spectrum cells, chimeric clathrin-mediated combat combination concentrations control convalescent courier; design, develop different diseases. domain, early east effects efforts em; emerged escape exhibited expression fatality functional future group had helix hepatitis hydroxychloroquine identification identity index information inhibitors. intranasal investigation joined judged kinase life light may membranes middle model need possible proteins providing pt;} recently replication. required screened selectivity shown structures subsequent synthesized teicoplanin tested toxicity use vaccines, well working Î¼g âˆ¼ â€"


Connect any source of data. Or just put your Project ID from our partner sites like Fairfleet.
 Sit back and relax, AIAP will do the rest.
Our Dashboard provides you with consolidated information and actionable Insights. Now you are geared up to tackle the challenges.
Humblebrag :)
Data Churned
Happy Users
Challenges
Places
Whatever suits your needs
Students
Hobby Data Scientists
Alpha and Beta Testers
Take us for a spin
Professionals
Consultants
Freelancers
Let us be partners in success
Startups
OEMs
Governments
Let us move mountains
Vexillologist pitchfork
Tumeric plaid portland
Hexagon neutra unicorn
Vexillologist pitchfork
Mixtape chillwave tumeric
Literally you probably haven't heard of them jean shorts.
Edison bulb retro cloud bread echo park, helvetica stumptown taiyaki taxidermy 90's cronut +1 kinfolk.
Senior Product Designer
Edison bulb retro cloud bread echo park, helvetica stumptown taiyaki taxidermy 90's cronut +1 kinfolk.
UI Develeoper
Edison bulb retro cloud bread echo park, helvetica stumptown taiyaki taxidermy 90's cronut +1 kinfolk.
CTO


Instructor: John P. Dickerson
Data science encapsulates the interdisciplinary activities required to create data-centric products and applications that address specific scientific, socio-political or business questions. It has drawn tremendous attention from both academia and industry and is making deep inroads in industry, government, health and journalism—just ask Nate Silver!
This course focuses on (i) data management systems, (i) exploratory and statistical data analysis, (ii) data and information visualization, and (iv) the presentation and communication of analysis results. It will be centered around case studies drawing extensively from applications, and will yield a publicly-available final project that will strengthen course participants' data science portfolios.
This course will consist primarily of sets of self-contained lectures and assignments that leverage real-world data science platforms when needed; as such, there is no assigned textbook. Each lecture will come with links to required reading, which should be done before that lecture, and (when appropriate) a list of links to other resources on the web.
Students enrolled in the course should be comfortable with programming (for those at UMD, having passed CMSC216 will be good enough!) and be reasonably mathematically mature. The course itself will make heavy use of the Python scripting language by way of Jupyter Notebooks, leaning on the Anaconda package manager; we'll give some Python-for-data-science primer lectures early on, so don't worry if you haven't used Python before. Later lectures will delve into statistics and machine learning and may make use of basic calculus and basic linear algebra; light mathematical maturity is preferred at roughly the level of a junior CS student.
There will be one written, take-home (obviously, given COVID-19 and all) midterm examination. There will not be a final examination; rather, in the interest of building students' public portfolios, and in the spirit of "learning by doing", students will create a self-contained online tutorial to be posted publicly. This tutorial can be created individually or in a small group. As described here (subject to change!), the tutorial will be a publicly-accessible website that provides an end-to-end walkthrough of identifying and scraping a specific data source, performing some exploratory analysis, and providing some sort of managerial or operational insight from that data.
Final grades will be calculated as:
This course is aimed at junior- and senior-level Computer Science majors, but should be accessible to any student of life with some degree of mathematical and statistical maturity, reasonable experience with programming, and an interest in the topic area. If in doubt, e-mail me<EMAIL_ADDRESS>For course-related questions, please use Piazza to communicate with your fellow students, the TAs, and the course instructors. For private correspondance or special situations (e.g., excused absences, DDS accomodations, etc), please email John with [CMSC320]
in the email subject line.
| Human | Time | Location |
|---|---|---|
| Sweta Agrawal | 10AM-11AM Tuesday; Piazza on Wednesday | Check ELMS/Piazza |
| Nitin Balachandran | 3PM-5PM Monday; Piazza on Monday | Check ELMS/Piazza |
| Tracy Chen | 2PM-4PM Thursday; Piazza on Thursday | Check ELMS/Piazza |
| John Dickerson | By appointment; please email John with [CMSC320] in the email subject line. |
Zoom |
| Aviva Prina | 12PM-2PM Tuesday; Piazza on Tuesday | Check ELMS/Piazza |
| Noor Singh | 4:00-6:00PM on Wednesday; Piazza on Friday | Check ELMS/Piazza |
| Qingyang Tan | 2PM-3PM on Friday; Piazza on Tuesday | Check ELMS/Piazza |
Policies relevant to Undergraduate Courses are found here: http://ugst.umd.edu/courserelatedpolicies.html. Topics that are addressed in these various policies include academic integrity, student and instructor conduct, accessibility and accommodations, attendance and excused absences, grades and appeals, copyright and intellectual property.
Course evaluations are important and the department and faculty take student feedback seriously. Near the end of the semester, students can go to http://www.courseevalum.umd.edu to complete their evaluations.
| # | Date | Topic | Reading | Slides | Lecturer | Notes |
|---|---|---|---|---|---|---|
| 1 | 9/1 | Introduction | What the Fox Knows. | pdf, pptx | Dickerson | Sign up on Piazza! |
| 2 | 9/3 | What is Data & Lightning Python Overview | Anaconda's Test Drive. | pdf, pptx | Dickerson | |
| 3 | 9/8 | Scraping Data (with Python) I | "What happens when you type google.com into your browser's address bar?" | pdf, pptx | Dickerson | PDF download script from class: link; Extra reading/quick tutorial on using BeautifulSoup: link |
| 4 | 9/10 | Scraping Data (with Python) II | pdf, pptx | Dickerson | Regex helper sites: regexr.com, pythex.org, regex101.com, rubular.com (thanks to J Helperin, J Martinez, M Mohades, & R Amor) | |
| 5 | 9/15 | NumPy & SciPy, & Best Practices | Introduction to pandas. | pdf, pptx | Dickerson | Pandas tutorials: link |
| 6 | 9/17 | Data Wrangling I: Pandas & Tidy Data | Hadley Wickham. "Tidy Data." | pdf, pptx | Dickerson | Hould's Tidy Data for Python |
| 7 | 9/22 | Data Wrangling II: Tidy data & SQL | Derman & Wilmott's "Financial Modelers' Manifesto." | pdf, pptx | Dickerson | SQLite: link; pandasql library: link |
| 8 | 9/24 | Version Control & Git | pdf, pptx | Dickerson | ||
| 9 | 9/29 | Version Conrol Wrap-up, & Graphs | Introduction to GraphQL: link | pdf, pptx | Dickerson | NetworkX: link |
| 10 | 10/1 | Graphs, & Summary Statistics and Transformations | Backstrom & Kleinberg. "Romantic Partnerships and the Dispersion of Social Ties: A Network Analysis of Relationship Status on Facebook," CSCW-14. arXiv link. | pdf, pptx | Dickerson | |
| 11 | 10/6 | Summary Statistics and Transformations, & Missing Data I | pdf, pptx | Dickerson | ||
| 12 | 10/8 | Missing Data II | Pandas tutorial on working with missing data. | pdf, pptx | Dickerson | Scikit-learn's imputation functionality: link |
| 13 | 10/13 | Missing Data III, & Data Wrangling Wrap-Up: Data Integration, Data Warehousing, Entity Resolution | Data Cleaning: Problems and Current Approaches (Note: this is a reference piece; please don't read the whole thing!) | pdf, pptx | Dickerson | Wikipdia article on outliers |
| 14 | 10/15 | Natural Language I: Syntax & Semantics | NLTK Book. | pdf, pptx | Dickerson | Python Natural Language Toolkit (NLTK): link; Criticisms of the Turing Test: link |
| 15 | 10/20 | Natural Language II: Representation | Continued from last class ... | pdf, pptx | Dickerson | Continued from last class ... |
| 16 | 10/22 | Natural Language III: Embeddings & Similarity | Continued from last class ... | pdf, pptx | Dickerson | Pre-recorded class; John will not be available during the live lecture period for this class. |
| 17 | 10/27 | Midterm Review & TBD | — | Midterm review: pdf, pptx; Lecture slides: pdf, pptx | Dickerson | New material from this lecture will not be included on the midterm. |
| 18 | 10/29 | Midterm | — | — | Dickerson | |
| 19 | 11/3 | Vote! | — | — | Dickerson | Election day! |
| 20 | 11/5 | Introduction to Machine Learning | Hal Daumé III. A Course in Machine Learning. | pdf, pptx | Dickerson | |
| 21 | 11/10 | Decision Trees and Random Forests | Russell & Norvig's Chapter 18 lecture slides: | pdf, pptx | Dickerson | Scikit-learn's basic decision tree functionality: link; Bart Selman's CS4700: link |
| 22 | 11/12 | Random Forests, K-NN | — | pdf, pptx | Dickerson | |
| 23 | 11/17 | Practical Issues I: Overfitting, Cross-validation, Regularization | pdf, pptx | Dickerson | xkcd on overfitting: link; Polynomial features/Interaction terms in Scikit: link | |
| 24 | 11/19 | Practical Issues II: Feature Engineering, PCA, Clustering, Association Rules | Nguyen & Holmes. "Ten quick tips for effective dimensionality reduction," PLoS Computational Biology. | pdf, pptx | Dickerson | Wikipedia article on the confusion matrix: link |
| 25 | 11/24 | Practical Issues III: Recommender Systems and Association Rules | Best Practices for Recommender Systems (from Microsoft). | pdf, pptx | Dickerson | |
| — | 11/26 | Thanksgiving Break | — | — | — | — |
| 26 | 12/1 | Scaling It Up | Dean & Ghemawat. "MapReduce: Simplified Data Processing on Large Clusters," CACM. | pdf, pptx | Dickerson | Wikipedia on SGD: link |
| 27 | 12/3 | Data Science Ethics & Best Practices I | The Atlantic. "Everything We Know About Facebook's Secret Mood Manipulation Experiment" | pdf, pptx | Dickerson | What is GDPR? (link) |
| 28 | 12/8 | Data Science Ethics & Best Practices II | Apple's brief overview of differential privacy: ; Barocas, Hardt, & Narayanan. Fairness in Machine Learning. | pdf, pptx | Dickerson | SIGCOMM paper that passed IRB review but is widely seen as unethical: link |
| 29 | 12/10 | Debugging Data Science, & Data Science in Industry | pdf, pptx | Dickerson | Additional discussion of debugging models (from Cornell): link | |
| Final | 12/21 | Final Exam Date | Final versions of tutorials must be posted by 4:00PM, the exam time. | Instructions & rubric: link |
In addition to the tutorial to be posted publicly at the end of the semester, there will be four "mini-projects" assigned over the course of the semester (plus one simple setup assignment that will walk you through using git, Docker, and Jupyter). The best way to learn is by doing, so these will largely be applied assignments that provide hands-on experience with the basic skills a data scientist needs in industry.
Posting solutions publicly online without the staff's express consent is a direct violation of our academic integrity policy. Late assignments will not be accepted.
| # | Description | Date Released | Date Due | Project Link |
|---|---|---|---|---|
| 0 | Setting Things Up | September 1 | September 8 | link |
| 1 | Fly Me To The Moon | September 15 | September 29 | link |
| 2 | Moneyball | October 2 | link | |
| 3 | Fact Tank | November 6 | link | |
| 4 | Baltimore Crime | December 3 | December 10 | link |
In the spirit of "learning by doing," students created a self-contained online tutorial to be posted publicly. Tutorials could be created individually or in a small group. The intention was to create a publicly-accessible website that provides an end-to-end walkthrough of identifying and scraping a specific data source, performing some exploratory analysis, and providing some sort of managerial or operational insight from that data. Below is a list of (most of) the tutorials created in the Fall 2020 version of CMSC320.
| Project Title | URL |
|---|---|
| 2020 Presidential Election: From a Data Science Perspective | link |
| A Closer look at the NFL Draft | link |
| A Data Science Walkthrough Using Global Happiness Data | link |
| A Data Scientist's Guide to the S&P 500 | link |
| A March Madness Analysis | link |
| A Pandemic: An Analysis of COVID-19 | link |
| American Music Awards Tweets | link |
| An Analysis of Amazon's Top 50 Bestselling Books | link |
| An Analysis of Heart Diseases and Attributes Leading to Heart Disease | link |
| An Analysis of Metrics in Predicting Economic Performance based on the Modern Portfolio Theory | link |
| An Analysis of Salaries and Cost of Living in Different US Cities | — |
| An Analysis of the Impact of COVID-19 on Crime in College Park, MD | link |
| An Analysis of the Prevalence of US Events on Reddit | link |
| An Introduction to Genome Analysis in Python (Data Science Tutorial) | link |
| Analysis of Amazon's Top 50 Bestselling Books | link |
| Analysis of Book Data from Amazon | link |
| Analysis of COVID Data and Politicial Outcomes for the United States | link |
| Analysis of COVID-19 data in United States | link |
| Analysis of Crime in Maryland | link |
| Analysis of Homelessness in Maryland | link |
| Analysis of NFL Games | link |
| Analysis of the Coronavirus by Coninent | link |
| Analysis of the Covid-19 Pandemic | link |
| Analysis of the Google Play Store | link |
| Analysis of Tournament Matches in Super Smash Bros. Melee | link |
| Analysis of Traffic Violations in Montgomery County Maryland | link |
| Analysis on the Potential of Life on Exoplanets | link |
| Analysis on Voter Turnout Data from 2020 General Election | link |
| Analysis San Francisco Criminal Records (CMSC320 Final Project) | link |
| Analyze 2020 Election Data | link |
| Analyzing Avocado Prices and Consumption in the U.S. | link |
| Analyzing Football Clubs in the U.K. | link |
| Analyzing Global Suicide Rate from 1985 to 2016 | link |
| Analyzing Retail Investors with Robinhood Data | link |
| Analyzing the Prices of Boston Airbnb Rentals: What Affects Prices and Have Prices Changed Since the Pandemic? | link |
| Analyzing the relationship between home matches and match wins in the English Premier League (Soccer) | link |
| Analyzing the Top Spotify Songs of the 2010s | link |
| Aspects of Trending Videos on YouTube | link |
| Attempting to predict the outcome of a hit baseball | link |
| Black Lives Matter movement | link |
| Breaking down the Grammy Award for Record of the Year - An Analysis | link |
| BREAKING DOWN THE TOP TRENDING YOUTUBE VIDEOS (U.S. & CA) | link |
| Chicago Burglaries | link |
| Citi Bike Ridership & Public Safety During COVID-19 | link |
| Classifying Pokemon Competitively | link |
| CMSC320 Final Project - Spotify Data Analysis | link |
| CMSC320 Final Project: Steven Struglia, Michael Strobel, HtetMyat Aung (Stock Market) | link |
| CMSC320 Final Tutorial | link |
| Cooking Recipes: An analysis of Ratings, Nutrition, and Tags | link |
| Coronavirus Exploratory Data Analysis | — |
| Countering a Dangerous Problem | link |
| COVID-19, An Analysis | link |
| COVID-19: Modeling The Relative Impact on US States | link |
| COVID-19's effect on Twitch & which games are the best to stream | link |
| COVID's Effect on Music Trends | link |
| COVID19 and state demographics: Finding which factors might affect COVID19 rates | link |
| Critical and Commercial Success in Music of the 2010 Decade | link |
| Data Analysis on FAANG Stocks from 2013 to 2020 | link |
| Data Visualization and Analysis of COVID-19 | link |
| Determining Buzz Words on Reddit | link |
| Do Masks Help in the Prevention of Covid-19? | link |
| Do Professional Wine Reviewers Know What They're Doing? | link |
| Drink To Forget: An Analysis of Drinking Habits During the COVID-19 Pandemic | link |
| Evaluating Chess Positions | link |
| Expected Value, Win Probability, and why "Common Knowledge" Hurts Sports Teams | link |
| Film Genre and Popularity Trends | link |
| Final Tutorial | link |
| Final Tutorial | link |
| Finding Your Ideal Wine | link |
| Formula 1: A brief look through history | link |
| Formula One Racing | link |
| From 2016 to 2020, How Politics Have Changed In America | link |
| Get a formula to predict the sale price of houses in Ames, Iowa | link |
| Global Food Waste Analysis | link |
| Gold Prices: Driven by Inflation, Volatility, or Treasury Yields? | link |
| Happiness in the World | link |
| Happiness Within Countries | link |
| Hospital Wait Times in The U.S. | link |
| How Corona Started | link |
| How Happy is Our World? | link |
| How has Music Changed over Time - A Spotify Data Analysis | link |
| How Height has effected Win % in 1980 and 2020 | link |
| How much better can the 2019 NBA Draft class get? | link |
| How to Beat Better Rated Chess Players | link |
| How to Make a Successful Game on Steam? | link |
| How well do our police departments represent the populations they serve? | link |
| Individual and Comparative Analysis of Pop, Hip Hop, and Rock Song Structures | link |
| Is College Tuition Infected? Diagnosing Baumol's Cost Disease | link |
| Is Joe Flacco an Elite Quarterback? | link |
| Is The Electoral College Misleading? | — |
| Leicester's Unprecedented Title Win | link |
| Mental Health in the Tech Industry | link |
| Missing Migrants - An Analysis on the Risk of Seeking Asylum | link |
| Movie Genre Popularity and Economic Activity | link |
| Music attributes and its effect on popularity | link |
| Music Over the Decades | link |
| Music Throughout the Decades: An Analysis | link |
| My Brother, My Brother and Me and the McElroy Brand | link |
| NBA 2020 Season Statistics Analysis | — |
| NBA Project | link |
| Netflix Movie/Tv Show Trends | link |
| NTSB Investigations of Aircraft Incursions in the USA | link |
| Pokemon Type Analysis | link |
| Predicting 2020-2021 English Premier League Table Results Using Machine Learning | link |
| Predicting an MLB Player's Performance In Fantasy Baseball | link |
| Predicting Average Salaries for all Proffessor Ranks | link |
| Predicting Car Prices | link |
| Predicting Chess Wins based off Openings | link |
| Predicting Current Quarterback Win Rates | link |
| Predicting Dementia and Alzheimer's | link |
| Predicting Gaon Digital Streams through Spotify Audio Features | link |
| Predicting Gross Domestic Investment in the United States | link |
| Predicting House Prices in King County, Washington | link |
| Predicting NBA Players' Salaries | link |
| Predicting Student Performance In High School | link |
| Predicting the Chance of Winning in League of Legends (Given the First 10 Minutes of Data) | link |
| Predicting the Popularity of a Book on Project Gutenberg | link |
| Predicting Winning Play Styles in Texas Hold'em | link |
| Predicting Wins at the Highest Level in the NBA | link |
| Prediction of Diabetes Melitus from Patients Medical Records | link |
| Predictive Power of 3-Pointer for Team Win% in 21st Century NBA | link |
| Presidential Election 2020 Voter Turnout Analysis | link |
| Relationships Among Crime Rate, Gini Coefficient, and Median Income in US | link |
| Reverse Line Movement | link |
| Small Ball | link |
| Smart, not fair: An analysis of CS:GO metagame tactics | link |
| Testing a stock buying strategy versus buying and holding a stock | link |
| The Best Times Of The Year To Puchase Tech Stocks | link |
| The Evolution of the 3 point shot | link |
| The Future of Console Gaming in a PC World | link |
| The NBA Draft | link |
| The Probabilities and Financial Impact of Gacha Games | link |
| The Trends of Happiness | link |
| Trends in Seattle Crimes | link |
| Twitter's Climate Tide: An Analysis of Tweets About Climate Change | link |
| Ultimate Fighter Championship Data Analysis | link |
| Using Data Analysis & Visualization to Understand the Performance of NCAA Division 1 College Basketball Teams in March Madness | link |
| Venmo Transactions Analysis | link |
| Video Game Sales | link |
| Visualization and Analysis of Liquor Sales in Iowa | link |
| Visualizing Ocean Data on Reconstructed pH and Coral Bleaching Reports | link |
| Wall Street Bets Sentiment Analysis | link |
| What Determines A Soccer Player's Salary? | link |
| What Factors Help Predict the Outcome of the 2020 Election? | link |
| What Make You Happy? | link |
| What makes an ArchiveOfOurOwn story successful? | link |
| What Review Scores Mean for Games | link |
| What's the movie score | link |
| Will You Accept This Analysis? | link |
| Winter is Coming: An Analysis of Sunshine vs Depression | link |
| World Happiness | link |
Missing an exam for reasons such as illness, religious observance, participation in required university activities, or family or personal emergency (such as a serious automobile accident or close relative’s funeral) will be excused so long as the absence is requested in writing at least 2 days in advance and the student includes documentation that shows the absence qualifies as excused; a self-signed note is not sufficient as exams are Major Scheduled Grading Events. For this class, such events are the final project assessment and midterms, which will be due on the dates listed in the schedule above. The final exam is scheduled according to the University Registrar.
For medical absences, you must furnish documentation from the health care professional who treated you. This documentation must verify dates of treatment and indicate the timeframe that the student was unable to meet academic responsibilities. In addition, it must contain the name and phone number of the medical service provider to be used if verification is needed. No diagnostic information will ever be requested. Note that simply being seen by a health care professional does not constitute an excused absence; it must be clear that you were unable to perform your academic duties.
It is the University’s policy to provide accommodations for students with religious observances conflicting with exams, but it is the your responsibility to inform the instructor in advance of intended religious observances. If you have a conflict with a planned exam, you must inform the instructor prior to the end of the first two weeks of the class.
The policies for excused absences do not apply to project assignments. Projects will be assigned with sufficient time to be completed by students who have a reasonable understanding of the necessary material and begin promptly. In cases of extremely serious documented illness of lengthy duration or other protracted, severe emergency situations, the instructor may consider extensions on project assignments, depending upon the specific circumstances.
Besides the policies in this syllabus, the University’s policies apply during the semester. Various policies that may be relevant appear in the Undergraduate Catalog.
If you experience difficulty during the semester keeping up with the academic demands of your courses, you may consider contacting the Learning Assistance Service in 2201 Shoemaker Building at<PHONE_NUMBER>. Their educational counselors can help with time management issues, reading, note-taking, and exam preparation skills.
Although every effort has been made to be complete and accurate, unforeseen circumstances arising during the semester could require the adjustment of any material given here. Consequently, given due notice to students, the instructors reserve the right to change any information on this syllabus or in other course materials. Such changes will be announced and prominently displayed at the top of the syllabus.
Please read the university’s guide on Course Related Policies, which provides you with resources and information relevant to your participation in a UMD course.


|
|
static Gson | getGsonObject () |
| |
| static String | readLocalData (Context ctx, String fileName) |
| |
| static void | writeLocalData (Context ctx, String fileName, String data) |
| |
| com.ualberta.team17.datamanager.DataManager.DataManager |
( |
Context |
ctx | ) |
|
Construct a new DataManager, using a given android Context to communicate
- Parameters
-
| com.ualberta.team17.datamanager.DataManager.DataManager |
( |
Context |
ctx, |
|
|
LocalDataManager |
local, |
|
|
NetworkDataManager |
net |
|
) |
| |
Construct a new DataManager, using a given Network and Local data manager
- Parameters
-
| ctx | The context to use |
| local | The local data manager to use |
| net | The network data manager to use |
Query the DataManager for items, using a given filter and sort.
- Parameters
-
| filter | A filter, specifying which items to get |
| sortComparator | A sort, specifying how to order the items in the IncrementalResult |
- Returns
- An IncrementalResult to which the items will be added as they arrive
Query the DataManager for items, using a given filter and previous Incremental Result.
Note that the IItemComparator that the IncrementalResult was defined with will be used to query the data source.
- Parameters
-
- Returns
- The incremental result that was passed in.
Query the DataManager for items with the given ids, returning them in the order defined by the given sort.
- Parameters
-
| idList | The list of ids to query for |
| sortComparator | A sort, specifying how to order the items in the IncrementalResult |
- Returns
- An IncrementalResult to which the items will be added as they arrive
| void com.ualberta.team17.datamanager.DataManager.favoriteItem |
( |
QAModel |
item | ) |
|
Favorite an item
- Parameters
-
| void com.ualberta.team17.datamanager.DataManager.markRecentlyViewed |
( |
QAModel |
item | ) |
|
Mark an item as recently viewed at this time
- Parameters
-
| item | The uniqueId of the item to mark as recently viewed |
| void com.ualberta.team17.datamanager.DataManager.markViewLater |
( |
QAModel |
item | ) |
|
Mark an item as to be viewed later.
- Parameters
-
| item | The uniqueId of the item to mark as view later |
| static String com.ualberta.team17.datamanager.DataManager.readLocalData |
( |
Context |
ctx, |
|
|
String |
fileName |
|
) |
| |
|
static |
Get the file a handle to the source of settings data
- Parameters
-
| ctx | The context to get the source from |
| fileName | The name of the data file to read |
- Returns
- A String, that is the contents of the file, or null, if there was no data to read, or the read failed.
| void com.ualberta.team17.datamanager.DataManager.resetUserContextData |
( |
| ) |
|
| void com.ualberta.team17.datamanager.DataManager.saveItem |
( |
final QAModel |
item | ) |
|
Save an item to one or more destinations. Rules for storing items: 1) For now, just save all items to the network and local
- Parameters
-
| void com.ualberta.team17.datamanager.DataManager.setUserContext |
( |
UserContext |
userContext | ) |
|
Set the user context to a given context
- Parameters
-
| static void com.ualberta.team17.datamanager.DataManager.writeLocalData |
( |
Context |
ctx, |
|
|
String |
fileName, |
|
|
String |
data |
|
) |
| |
|
static |
Save changes to a given data file, given a context
- Parameters
-
| ctx | The context to write under |
| fileName | The name of the data file to write to |
| data | |
The documentation for this class was generated from the following file:
- C:/Users/Corey/git/Team17Project/moqa/src/com/ualberta/team17/datamanager/DataManager.java


Installing and Updating Android SDK
Overview
This guide describes where to obtain and how to install the Google Android SDK and associated packages.
Table of Contents
Compatibility and Download
Titanium requires the Android SDK to be installed in order to allow you to develop Android applications. Unless you intend to write applications exclusively for Apple products, you should install this component.
Remember that Oracle JDK is a prerequisite for Android development, and so should be installed first. See Installing Oracle JDK for instructions.
The Android SDK Manager installer may be obtained from the Official Website
Installation
OSX
Windows Software Locations
Installing Android SDK Manager
-
after download, extract the Android SDK Tools zip archive and drag & drop the android-sdk-maxosx folder into the your system's Applications folder (just use the Applications icon in the Dock)
Windows
Windows Software Locations
Installing Android SDK Manager
Once you have downloaded the Android SDK Manager Installer, double-click to run it.
-
proceed to the Java SE Development Kit stage and verify that Java SE Development Kit (JDK) version 1.6 has been found
-
at the Choose Install Location step, verify that the Destination Folder is the same as your Android SDK HOME folder, and correct if not. This path will be required when configuring Titanium Studio
-
ensure that there is sufficient space for the installation
-
complete the installation
Refer to the Windows Software Locations section, and add the path of the Android SDK Tools directory to your system's PATH.
Installing Android Packages with Android SDK Manager
When the Android SDK Tools software has been installed, you can install the platform SDK packages using its Android SDK Manager.
-
log in under your usual user account, right-click the SDK Manager from the Windows Start Menu and select Run as administrator. Enter the Administrator password, if you are prompted for it
-
in the Android SDK Manager, you will see different versions of the following items listed:
-
Android SDK Tools (mandatory) - includes the Android SDK Manager and Android Virtual Device Manager (android executable)
-
Android SDK Platform Tools (mandatory) - includes Android Debug Bridge, (adb executable)
-
SDK Platform - provides the virtual device running a specific version of Android that uses the standard Google APIs
-
Google APIs by Google Inc - provides the virtual device running a specific version of Android that uses the enhanced Google APIs (includes maps support). Most developers use this rather than the standard SDKs.
-
-
set the filter options at the bottom and select the packages shown in the screenshot for installation. These packages represent the minimum necessary in order to use Titanium
-
click the Install x packages button
-
select Accept All and proceed
-
click Yes to restart adb and complete the installation
The screenshot below shows the packages that Titanium supports at the time of writing (Oct 2011), but refer to the Titanium Compatibility Matrix for more up-to-date and accurate information
It's easy to neglect to install the third-party APIs and tools, such as Google's enhanced APIs that provide support for maps. To resolve this:
Updating Android Packages
Important to note!
Every time you update your Android packages, you will need to delete any AVDs that have been replaced by new revisions, otherwise they won't be used. To do this, use the Android SDK Manager Tools > Manage AVDs menu item to launch the Android Virtual Device Manager.
Unless you have modified any AVD's hardware configuration, it's easier to simply clear all existing AVDs altogether. Thus, select each one in turn and click the delete button to do this.
Summary of Installed Android Packages
The following shows the minimum Android packages required by Titanium at the time of writing (Oct 2011). To compare yours, use the same filter options at the bottom.
Refer to Titanium Compatibility Matrix for the most up-to-date information about the software we currently support.


Newbie Guide:
You are not eligible to use the warehouse. You must complete your first class change! (Only
beginners who have completed the first class change
may use the warehouse.)


Gecode::Int::Bool::BoolTernary< BVA, BVB, BVC > Class Template Reference
#include <bool.hh>
Inherits Gecode::Propagator.
Inherited by Gecode::Int::Bool::Eqv< BVA, BVB, BVC >, and Gecode::Int::Bool::Or< BVA, BVB, BVC >.
Detailed Description
template<class BVA, class BVB, class BVC>
class Gecode::Int::Bool::BoolTernary< BVA, BVB, BVC >
Base-class for ternary Boolean propagators.
Definition at line 63 of file bool.hh.
Public Member Functions | |
| BoolTernary (Space *home, bool share, Propagator &p, BVA b0, BVB b1, BVC b2) | |
| Constructor for rewriting p during cloning. | |
| virtual PropCost | cost (void) const |
| Cost function (defined as PC_BINARY_LO). | |
| virtual size_t | dispose (Space *home) |
| Delete propagator and return its size. | |
Protected Member Functions | |
| BoolTernary (Space *home, BVA b0, BVB b1, BVC b2) | |
| Constructor for posting. | |
| BoolTernary (Space *home, bool share, BoolTernary &p) | |
| Constructor for cloning. | |
Protected Attributes | |
| BVA | x0 |
| Boolean view. | |
| BVB | x1 |
| Boolean view. | |
| BVC | x2 |
| Boolean view. |
Constructor & Destructor Documentation
|
|
Constructor for posting.
|
|
|
Constructor for cloning.
|
|
|
Constructor for rewriting p during cloning.
|
Member Function Documentation
|
|
Cost function (defined as PC_BINARY_LO).
Implements Gecode::Propagator. |
|
|
Delete propagator and return its size.
Reimplemented from Gecode::Actor. |
Member Data Documentation
|
|
Boolean view.
|
|
|
Boolean view.
|
|
|
Boolean view.
|
The documentation for this class was generated from the following files:
- gecode/int/bool.hh (Revision: 3600)
- gecode/int/bool/base.icc (Revision: 3566)


[gecode-users] Reporting memory usage
Filip Konvička
filip.konvicka at logis.cz
Thu Oct 30 16:01:13 CET 2008
Sure, no problem - there's no point doing this for 2.2 anyway, is there? :-)
Cheers,
Filip
> Filip, can you then also take into account my last messgae?
>
> Cheers
> Christian
>
> --
> Christian Schulte, www.ict.kth.se/~cschulte/
>
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf Of Filip Konvicka
> Sent: Thursday, October 30, 2008 3:56 PM
> To: users at gecode.org
> Subject: Re: [gecode-users] Reporting memory usage
>
>
>> I agree, it would be nice to have such thing in gecode. I have been
>> using an implementation of such allocator (attached to this mail). It
>> would be nice if we can discuss and improve it. I got this
>> implementation from Stéphane Zampelli.
>>
>
> Thanks! That seems like something I had in mind. I'll try it out, maybe
> fix a couple of things (I'll try to walk through the C++ standard
> regarding allocators), move out of the ::std namespace (why is it
> there?) and re-post back here for more discussions.
>
> Cheers,
> Filip
>
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
--
Filip Konvička
LOGIS, s.r.o.
tel. +420 556 841 100
mob. +420 736 758 714
More information about the gecode-users
mailing list


Susan Granger's review of "GLITTER" (20th Century-Fox)
There's less here than meets the eye. Or, put it this way, if you thought Madonna was awful in "Shanghai Surprise," Mariah Carey's worse in this reworking of "A Star is Born." She plays Billie Frank who, despite being abandoned by her singer/alcoholic mother (Valerie Pettiford), believes she's destined for greatness because everyone tells her she is. "You've got this amazing gift, and you gotta use it," her roommate says. "Your voice - it's incredible," says another singer.  Problem is: her signature song, "I Didn't Mean to Turn You On" is wretched. And when she fumes out of filming her first music video because the director wants to "exploit" her by having her wear a bikini, the audience bursts into laughter. Exploit Mariah Carey, who chooses to wear as little as the law will allow? Come on! Writer Kate Lanier's script is fatuous and director Vondie Curtis-Hall doesn't have a clue how to handle the glitzy pop diva and, as a result of their incompetence, whispery-voice'd Ms. Carey seems to be embarrassed on-screen. She almost cringes when the camera comes in for a close-up, pursing her lips and averting her glassy eyes. Talented British musician Max Beesley appears equally inept, and as cinematographer Geoffrey Simpson pans around the Manhattan skyline, there's an audible audience groan when the Twin Towers of the World Trade Center come into view. Perhaps one of the reasons Ms. Carey suffered her highly-publicized nervous breakdown this summer is because she saw a preview of this clunker.  Right now, it's tops on my list of the Worst of 2001.
========== X-RAMR-ID: 29549 X-Language: en X-RT-ReviewID: 251127 X-RT-TitleID: 1108787 X-RT-SourceID: 742 X-RT-AuthorID: 1274 X-RT-RatingText: 1/10
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


{% include 'head.html' %}
Your health care worker uses your child's measurements such as height/length, weight and head circumference(under 2) to ensure that he/she is growing in an appropriate manner. It is one of the signs of good general health and is used as a health screening tool.
You can also use these growth measurements, regardless of where it is obtained, to keep track of their numbers and even obtain their percentiles at different points over time.
The information can be used for your own personal information and/or to share with your health care team.
This program uses the data from the World Health Organization Growth standards and references and plots it on the set 2 WHO growth curves. For more information on growth curves and measurements see whogrowthcharts.ca
Brought to you by Vishal Avinashi, App4Kids Hackathon & the GrowthPlot Team
Copyright GrowthPlot 2015


|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| DLLManager | The NativeManager interface is used to manage
the Dynamic Link Libraries loaded by the framework. |
| DynamicLibrary | The DynamicLibrary interface represents
a loaded Dynamic Link Library (DLL) by the framework. |
| Fetch | The Fetch interface defines the constants used
to define what parts of the native memory layout of a native object
tree must be read. |
| JNIEasyLibrary | The JNIEasyLibrary interface represents
the framework's Dynamic Link Library (JNIEasy.dll). |
| LockedRegistry | LockedRegistry is a simple wrapper of a synchronized java.util.HashSet
collection; it is included as a utility and can be easily replaced with your own. |
| NativeAddress | The interface NativeAddress is implemented by the framework
to encapsulate a native address. |
| NativeBuffer | The interface NativeBuffer is implemented by the framework
to encapsulate a native memory block. |
| NativeBufferIterator | The interface NativeBufferIterator is implemented by the framework
to provide a native buffer iterator. |
| NativeManager | The NativeManager interface is used to manage
the native lifecycle of native capable objects and some
native memory tasks. |
| NativeStateManager | Every native object instance has an internal object implementing
NativeStateManager interface. |
| UnFetch | The UnFetch interface defines the constants used
to define what parts of the native memory layout of a native object
tree must be modified. |
Provides utility classes and interfaces to manage the life cycle of native instances, native memory attachment, read and write, and Dynamic Link Library managers.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


{{quote.name}} submitted on: {{quote.completeDate|date|uppercase}}
0">
{{quote.author}}
5'>This is the End of Quotes
This App helps people to write his or her quotes where others can be able
to like and dislike his or her quotes delete them and they can be able
to know Author and time when it was written
0">
{{quote.author}}
5'>This is the End of Quotes


|
Bosch XDK110 Solace MQTT App
2.0.1
MQTT Reference Application for the Bosch XDK110
|
#include "AppRuntimeConfig.h"
Go to the source code of this file.
Functions | |
| Retcode_T | AppTelemetrySampling_Init (const char *deviceId, uint32_t samplingTaskPriority, uint32_t samplingTaskStackSize, const CmdProcessor_T *sensorProcessorHandle) |
| Initialize the sampling module. Call in AppController_Init(). More... | |
| Retcode_T | AppTelemetrySampling_Setup (const AppRuntimeConfig_T *configPtr) |
| Setup of the sampling module. Call in AppController_Setup(). More... | |
| Retcode_T | AppTelemetrySampling_Enable (void) |
| Enable the module. Call in AppController_Enable(). More... | |
| Retcode_T | AppTelemetrySampling_ApplyNewRuntimeConfig (AppRuntimeConfig_ConfigElement_T configElement, const void *newConfigPtr) |
| Apply a new configuration. Call only when the sampling task is not running. More... | |
| Retcode_T | AppTelemetrySampling_CreateSamplingTask (void) |
| Create the sampling task. Call only if it isn't running. More... | |
| Retcode_T | AppTelemetrySampling_DeleteSamplingTask (void) |
| Delete sampling task. Does nothing if it doesn't exist. More... | |
| bool | AppTelemetrySampling_isTaskRunning (void) |
| Check if sampling task is running. More... | |


HOME
OUR PRODUCT
TEAM
INVEST
LOG IN
Sign Up
Log In
Sign Up for the Investor Portal
First Name
*
Last Name
*
Email Address
*
Set A Password
*
Password must contain the following:
A
lowercase
letter
A
capital (uppercase)
letter
A
number
Minimum
8 characters
Sign Up
Welcome Back!
Email Address
*
Password
*
Forgot Password?
Log In
qq