interactive and 3 d scatterplot

Post on 09-Jan-2017

55 Views

Category:

Data & Analytics

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive and 3D Scatterplot in R

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots

# Create some linked plots library(iplots)attach(iris) ihist(Sepal.Length) # histogram ibar(Species) # barchartiplot(Sepal.Length, Sepal.Width) # scatter plotibox(iris[,1:4]) # boxplots

Note: Click on any graph and see how they are related to each other.

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots...

Mr. S. B. Adnaik (Ph.D., Statistics)

Interactive plots...

# Interacting with a scatterplot attach(iris)plot(Sepal.Length, Sepal.Width) # scatterplotidentify(Sepal.Length, Sepal.Width, labels=row.names(iris)) # identify points

Note: Click on points toGet its location (row no.)Click ‘stop’ to exit.

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D

# 3D Scatterplotlibrary(scatterplot3d)attach(iris)scatterplot3d(iris[,1:3], main="3D Scatterplot")

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D...

# 3D Scatterplot with Coloring and Vertical Drop Lineslibrary(scatterplot3d) attach(iris) scatterplot3d(iris[,1:3], pch=16, highlight.3d=TRUE, type="h", main="3D Scatterplot")

Mr. S. B. Adnaik (Ph.D., Statistics)

Scatterplot 3D...

# 3D Scatterplot with Coloring and Vertical Lines and Regression Plane library(scatterplot3d) attach(iris) s3d <-scatterplot3d(iris[,1:3], pch=16, highlight.3d=TRUE, type="h", main="3D Scatterplot")fit <- lm(Sepal.Width~Petal.Length+Petal.Width) s3d$plane3d(fit)

Mr. S. B. Adnaik (Ph.D., Statistics)

Thanks

top related