R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

## Warning: Removed 17 rows containing missing values (geom_point).

# Next, modify the figure to display only the data from the retina physicians and add a regression line.
rop %>%
  subset(type == "ret") -> rop2
#view(rop2)

myplot2 <- ggplot(rop2, aes(x = x, y = y))

myplot2 +
geom_point(aes(color = type)) +
stat_smooth(method = "lm", data = rop2, se = FALSE) +
facet_wrap(~ picture,  nrow = 5) +
scale_color_discrete(labels = c("Macula Position")) +
guides(color = guide_legend(aes(title = "Location of Macula Position Among Retina Specialists"))) +
theme_bw()
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_point).

# Did not like the look of the graphs with the title, so removed it

myplot2 +
geom_point(aes(color = type)) +
stat_smooth(method = "lm", data = rop2, se = FALSE) +
facet_wrap(~ picture,  nrow = 5) +
scale_color_discrete(labels = c("Position")) +
guides(color = "none") +
theme_bw()
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).