R Fieldwork #10 Database Management and Modeling General exercises Create a text

R Fieldwork #10

Database Management and Modeling

General exercises

Create a text vector called Months with names of the 12 months of the year.

Create a numeric vector Summer, with Calendar month index positions for the summer months (inclusive, with 4 elements in all).

Print out the positions to show which months they refer to.

E-commerce Data for Exercises

The data set comprises responses to intercept surveys asked when users visited the site, along with data about each user’s site activity such as number of pages visited and whether a sale was completed. Identifying details for the site and customers have been removed but the observations otherwise are actual data.

We will load the data set first, and then explain a few of its observations. To load the data from CSV format, use the following command (or load ecommerce-data.csv from a local location if you have downloaded it, as noted in Section 1.6.3).

ecomm.df <- read.csv("https://goo.gl/hzRyFd")

summary(ecomm.df)

How many observations and variables are in the e-commerce data set?

Compute a frequency table for the country of origin for site visits. After the United States, which country had the most visitors?

Compute a two-way frequency table for the intent to purchase (intentWasPlanningToBuy), broken out by user profile.

What are the proportions of parents who intended to purchase? the proportions of teachers who did? For each one, omit observations for whom the intent is unknown (blank).

Among US states (recorded in the variable region), which state had the most visitors and how many?

Draw a histogram for the number of visits to the site (behavNumVisits).

Draw a horizontal boxplot for the number of site visits. Interpret results.