Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
barajap1 authored Nov 10, 2020
1 parent 57dba6e commit e138c98
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions 2020-11-09-PortfolioWebsite/Example.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "Iris example"
author: "Pablo"
date: "11/9/2020"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Install/Load packages packages
```{r, warning=FALSE, message=FALSE}
if (!require("pacman")) install.packages("pacman")
pacman::p_load(Formula, partykit, party, rpart, rpartplot)
```
Load data
```{r}
data(iris)
```

Examine Data
```{r}
dim(iris)
```
```{r}
names(iris)
```
```{r}
str(iris)
```
```{r}
head(iris)
```
```{r}
summary(iris)
```
Plot Data
```{r}
pie(table(iris$Species))
```
```{r}
var(iris$Sepal.Length)
```
```{r}
cov(iris$Sepal.Length, iris$Petal.Length)
```
```{r}
cor(iris$Sepal.Length, iris$Petal.Length)
```
```{r}
hist(iris$Sepal.Length)
```
```{r}
plot(density(iris$Sepal.Length))
```
```{r}
plot(iris)
```
```{r}
iris_ctree <- rpart(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data=iris)
print(iris_ctree)
```
```{r}
rpart.plot::rpart.plot(iris_ctree)
```


```
Binary file not shown.

0 comments on commit e138c98

Please sign in to comment.