loading
library(readr)
sa1 <- read_csv("/Users/votrungdinh/Library/CloudStorage/OneDrive-Personal/Trung Dinh/Thesis/Rstudio/Osteo data.csv", show_col_types = FALSE)
this is hte file of demo R markdown
library(ggplot2)
ggplot(data=sa1, aes(x=weight, y=pcfat, col=osteo)) + geom_point()

ggplot(data=sa1, aes(x=weight, y=pcfat, col=osteo)) + geom_point() + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation:
## colour.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?

ggplot(data=sa1, aes(x=weight, y=pcfat, col=osteo)) + geom_point() + geom_smooth() + theme(legend.position="none")
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation:
## colour.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?

ggplot(data=sa1, aes(x=weight, y=pcfat, col=osteo)) + geom_point() + geom_smooth() + theme(legend.position="top")
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: The following aesthetics were dropped during statistical transformation:
## colour.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?
