Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The next exercise is designed for using an interactive visualization tool. The file LaptopSales.csv is an a comma-separated file with nearly 300,000 rows. It has

The next exercise is designed for using an interactive visualization tool. The file LaptopSales.csv is an a comma-separated file with nearly 300,000 rows. It has been provided by ENBIS (the European Network for Business and Industrial Statistics) as part of a contest organized in the fall of 2009.

With this dataset and the use of R, your job is to:

Use an interactive visualization tool and answer the following questions.

At what price are the laptops actually selling?

Does price change with time?

(Hint: Make sure that the date column is recognized as such. The software should then enable different temporal aggregation choices, e.g., plotting the data by weekly or monthly aggregates, or even by day of week.)

Are prices consistent across retail outlets?

How does price change with configuration?

dataset- https://docs.google.com/spreadsheets/d/1md4AZTDaId9WEGvl3Z9YwfXIgae-C6QnnH4f7do4-MU/edit?usp=sharing

Here what I have so far. I am trying to print out the monthly graph, and nothing

library(ggplot2)

library(scales)

read.csv(file.choose())

LaptopSales

sales.df<-data.frame(LaptopSales)

summary(sales$Retail.Price)

# Min. 1st Qu.MedianMean 3rd Qu.Max.NA's

# 168.0440.0500.0508.1575.0890.013443

boxplot(sales.df$Retail.Price,main="The actual laptop prices",ylab="Retail Price",

xlab="Laptops", col="bisque",medcol="red",boxlty=0,border="black",

whisklty=1,staplelwd=4,outpch=13,outcex=1,outcol="dark blue")

# (1) At what price are the laptops actually selling? It appears around 500.

# (2) Does the price change in time?

mp <-data.frame(sales.df$Date, sales.df$Retail.Price)

names(mp) <- c("Month", "MeanRetailPrice")

mp$Month <- as.Date(mp$Month,

"%Y-%m-%d")

mp$Month <- as.Date(cut(mp$Month,

breaks = "month",

start.on.monday = FALSE))

m2 <- ggplot(data = mp,

aes(Month, MeanRetailPrice)) +

stat_summary(fun = mean,

geom = "line")

i <-scale_x_date(

labels = date_format("%Y-%m"),

breaks = "1 month")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Calculus Early Transcendentals

Authors: Michael Sullivan, Kathleen Miranda

7th Edition

ISBN: 1464144397, 9781464144394

More Books

Students also viewed these Mathematics questions

Question

What is intrinsic motivation? (p. 257)

Answered: 1 week ago

Question

=+4. What key skills are necessary to work in social media?

Answered: 1 week ago