<jupyter_start><jupyter_text>Observations :- * rpois generates random deviates and is one of the several functions provided by R based on Poisson Distribution.* Based on the images below we can see that figures of sales2 keep changing.![problem%201%20-%20Iter%203.png](attachment:problem%201%20-%20Iter%203.png)![problem%201%20-%20Iter2.png](attachment:problem%201%20-%20Iter2.png)![Problem%201-Iter1.png](attachment:Problem%201-Iter1.png)<jupyter_code># Problem 2

sales<-read.table(file.choose(), header=T)
sales  # to verify that data has been read
barplot(as.matrix(sales), main="Sales Data", ylab= "Total",beside=T, col=rainbow(5))<jupyter_output><empty_output><jupyter_text>Observations:-1] Lowest sale value seems to exist in sales 1 figures whereas the highest appears in sales 2 Figures. 2] Most of the times the sales 2 Figures are higher than the sales 1 figures.  Inference:-1] A quick look at the graph reveals that sales 2 figures are better than Sales 1 figures.2] Hence it can be said that sales 2 figures represent a better sale condition than sale 1 figures.<jupyter_code># Problem 3

fn<-boxplot(sales,col=c("orange","green"))$stats
text(1.45, fn[3,2], paste("Median =", fn[3,2]), adj=0, cex=.7)
text(0.45, fn[3,1],paste("Median =", fn[3,1]), adj=0, cex=.7)
grid(nx=NA, ny=NULL)
# Problem 4

fb1<-read.csv(file.choose())
aapl1<-read.csv(file.choose())
par(bg="cornsilk")
plot(aapl1$Adj.Close, col="blue", type="o", ylim=c(160,200), xlab="Days", ylab="Price" )
lines(fb1$Adj.Close, type="o", pch=22, lty=2, col="red")
legend("topright", inset=.05, c("Apple","Facebook"), fill=c("blue","red"), horiz=TRUE)
hist(aapl1$Adj.Close, col=rainbow(8))
# Problem 5

data()
library(ggplot2)
# Problem 5 - continued
attach(mpg)
# attach allows us to refer directly to the names of the columns present in the dataset instead of specifying the 
#datasetname followed by a $ sign followed by name of column
# Problem 5 - continued
head(mpg)
summary(mpg)
# Problem 5 - continued
detach(mpg)

# Problem 5 - continued
library(datasets)
head(uspop)
# Problem 5 - continued
plot(uspop)
# Problem 6

library("ggmap")
library("ggplot2")
library("maptools")
library("maps")
apiKey <- Sys.getenv("API_KEY")
# getwd()
# Problem 6 Part 1

register_google(key = "XXXX")
visited <- c("SFO", "Chennai", "London", "Melbourne", "Lima", "Peru", "Johannesbury", "SA")
ll.visited <- geocode(visited)
visit.x <- ll.visited$lon
visit.y <- ll.visited$lat
map("world", fill=TRUE, col="white", bg="lightblue", ylim=c(-60, 90), mar=c(0,0,0,0))
points(visit.x,visit.y, col="red", pch=36)
# Problem 6 Part 2

library("ggmap")
library("maptools")
library("maps")
visited <- c("SFO", "New York", "Buffalo", "Dallas", "TX")
ll.visited <- geocode(visited)
visit.x <- ll.visited$lon
visit.y <- ll.visited$lat
map("state", fill=TRUE, col=rainbow(50), bg="lightblue", mar=c(0,0,0,0))
points(visit.x,visit.y, col="yellow", pch=36)

# Problem 7 :- with mtcars data

attach(mtcars)
head(mtcars)
plot(mtcars[c(1,3,4,5,6)], main="MTCARS Data")
plot(mtcars[c(1,3,4,6)], main="MTCARS Data")
plot(mtcars[c(1,3,4,6)], col=rainbow(5),main="MTCARS Data")
# Problem 7 :- with airquality  data

detach(mtcars)

data(airquality)
attach(airquality)
head(airquality)
plot(airquality[c(1,2,3,4,5)],main="airquality")
plot(airquality[c(4,5)],main="Month and Temp relationship")
plot(airquality[c(1,4)],main="Ozone and Temp relationship")
plot(airquality[c(2,1)],main="Solar radiation and Ozone relationship")

# Problem 8

library(ggplot2)
     ggplot(mtcars, aes(x=mpg, y=disp)) + geom_point()<jupyter_output><empty_output><jupyter_text>Using Other vignettes* browseVignettes() allows us to see which all Vignettes are installed<jupyter_code># Using colorspace vignettes

# Using colorspace vignettes with ggplot
library(colorspace)
ggplot(iris, aes(x = Sepal.Length, fill = Species)) + geom_density(alpha = 0.6) +
  scale_fill_discrete_qualitative(palette = "Dark 3")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16582278481012658, 'fraction_numerical': 0.040253164556962026, 'mean_word_length': 6.77755905511811, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '527177', 'license': 'MIT', 'n_tokens_mistral': 1581, 'n_tokens_neox': 1434, 'n_words': 361, 'path': 'Project 1  EDA/Part 1/Lab1EDA-Part1.ipynb', 'repo_name': 'chinmaySwami/Data-Intensive-Computing', 'size': '3950'}