##Se pone el texto bla bla bla… ##
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.
##con el texto adentro se pone en negritas
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:
##puedo poner el nombre que yo quiera al chunk siguiente, sin usar espacios##
# Load the dataset to session with read.table command:
irisdata <- read.table("iris/iris.data", sep = ",")
str(irisdata)
## 'data.frame': 150 obs. of 5 variables:
## $ V1: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
## $ V2: num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
## $ V3: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
## $ V4: num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
## $ V5: chr "Iris-setosa" "Iris-setosa" "Iris-setosa" "Iris-setosa" ...
head(irisdata)
## V1 V2 V3 V4 V5
## 1 5.1 3.5 1.4 0.2 Iris-setosa
## 2 4.9 3.0 1.4 0.2 Iris-setosa
## 3 4.7 3.2 1.3 0.2 Iris-setosa
## 4 4.6 3.1 1.5 0.2 Iris-setosa
## 5 5.0 3.6 1.4 0.2 Iris-setosa
## 6 5.4 3.9 1.7 0.4 Iris-setosa
tail(irisdata)
## V1 V2 V3 V4 V5
## 145 6.7 3.3 5.7 2.5 Iris-virginica
## 146 6.7 3.0 5.2 2.3 Iris-virginica
## 147 6.3 2.5 5.0 1.9 Iris-virginica
## 148 6.5 3.0 5.2 2.0 Iris-virginica
## 149 6.2 3.4 5.4 2.3 Iris-virginica
## 150 5.9 3.0 5.1 1.8 Iris-virginica
class(irisdata)
## [1] "data.frame"
dim(irisdata)
## [1] 150 5
ncol(irisdata)
## [1] 5
nrow(irisdata)
## [1] 150
names(irisdata) <- c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species")
library(ggplot2)
ggplot(data = irisdata, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point(size = 3)
##ejemplo
{r cars, echo=FALSE,warning=FALSE,message=FALSE} summary(cars)despúés
de cars, lo siguiente es ejemplo##
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
##se pueden incrustar códigos para graficar##
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.