Skip to content

Commit 994cfec

Browse files
committed
Scripts del Tema 1
1 parent c79b547 commit 994cfec

6 files changed

Lines changed: 249 additions & 0 deletions

File tree

CursoIntroR.RData

2.53 KB
Binary file not shown.

scripts/tema1/01-test.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#Esta línea no funciona, por ahora...
2+
#lm(y~x)
3+
4+
5+
require(graphics)
6+
7+
## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
8+
## Page 9: Plant Weight Data.
9+
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
10+
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
11+
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
12+
weight <- c(ctl, trt)
13+
lm.D9 <- lm(weight ~ group)
14+
lm.D90 <- lm(weight ~ group - 1) # omitting intercept
15+
16+
anova(lm.D9)
17+
summary(lm.D90)
18+
19+
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
20+
plot(lm.D9, las = 1) # Residuals, Fitted, ...
21+
par(opar)
22+
23+
### less simple examples in "See Also" above

scripts/tema1/02-primer-rmd.Rmd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "Mi primer Markdown"
3+
author: "Curso de Álgebra Lineal"
4+
date: "11/12/2018"
5+
output:
6+
html_document:
7+
df_print: paged
8+
---
9+
10+
```{r setup, include=FALSE}
11+
knitr::opts_chunk$set(echo = TRUE)
12+
```
13+
14+
## R Markdown
15+
16+
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>.
17+
18+
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:
19+
20+
```{r cars}
21+
summary(cars)
22+
```
23+
24+
## Including Plots
25+
26+
You can also embed plots, for example:
27+
28+
```{r pressure, echo=FALSE}
29+
plot(pressure)
30+
```
31+
32+
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

scripts/tema1/02-primer-rmd.html

Lines changed: 183 additions & 0 deletions
Large diffs are not rendered by default.

scripts/tema1/02-primer-rmd.pdf

164 KB
Binary file not shown.

scripts/tema1/03-install.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
install.packages("tidyverse", dep = TRUE)
2+
3+
library(tidyverse)
4+
5+
install.packages("magic", dep = TRUE)
6+
7+
library(magic)
8+
9+
magic(6)
10+
11+
installed.packages()

0 commit comments

Comments
 (0)