Skip to content

Commit

Permalink
Change code
Browse files Browse the repository at this point in the history
improved histogram.
  • Loading branch information
ymoon06 committed Sep 16, 2020
1 parent 70e44b3 commit 9cea417
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
29 changes: 27 additions & 2 deletions EXERCISE 1/exercise1-b.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,30 @@ print(x)

## Create a histogram of the distribution and the distribution on the log scale
```{r histX}
hist(x, main= paste("Histogram of samples from log normal distribution"))
hist(log(x),main=paste("Histogram of samples from log normal distribution on log scale"))
#hist(x, main= paste("Histogram of samples from log normal distribution"))
#hist(log(x),main=paste("Histogram of samples from log normal distribution on log scale"))
library(ggplot2)
qplot(x, geom="histogram",
binwidth=0.04,
log="",
main="Histogram of samples from log normal distribution",
xlab="sample",
ylab="frequency",
fill=I("blue"),
col=I("red"))
qplot(x,
geom="histogram",
binwidth=0.04,
log="x",
main="Histogram of samples from log normal distribution on log scale",
xlab="sample on logscale",
ylab="frequency",
fill=I("green"),
col=I("yellow"))
```


Expand All @@ -47,3 +69,6 @@ and variance of samples is `r variance.samples`






Loading

0 comments on commit 9cea417

Please sign in to comment.