BASE DE DATOS
data("PlantGrowth")
?PlantGrowth
## starting httpd help server ... done
head(x = PlantGrowth)
## weight group
## 1 4.17 ctrl
## 2 5.58 ctrl
## 3 5.18 ctrl
## 4 6.11 ctrl
## 5 4.50 ctrl
## 6 4.61 ctrl
tail(x = PlantGrowth)
## weight group
## 25 5.37 trt2
## 26 5.29 trt2
## 27 4.92 trt2
## 28 6.15 trt2
## 29 5.80 trt2
## 30 5.26 trt2
head(PlantGrowth, n = 1)
## weight group
## 1 4.17 ctrl
tail(PlantGrowth, n = 7)
## weight group
## 24 5.50 trt2
## 25 5.37 trt2
## 26 5.29 trt2
## 27 4.92 trt2
## 28 6.15 trt2
## 29 5.80 trt2
## 30 5.26 trt2
str(PlantGrowth)
## 'data.frame': 30 obs. of 2 variables:
## $ weight: num 4.17 5.58 5.18 6.11 4.5 4.61 5.17 4.53 5.33 5.14 ...
## $ group : Factor w/ 3 levels "ctrl","trt1",..: 1 1 1 1 1 1 1 1 1 1 ...
nrow(PlantGrowth)
## [1] 30
ncol(PlantGrowth)
## [1] 2
dim(PlantGrowth)
## [1] 30 2
names(PlantGrowth)
## [1] "weight" "group"
rm(PlantGrowth)
El comando head sirve para buscar los primeros datos de
nuestra base.
El comando tail sirve para buscar los ultimos datos de
nuestra base
El comando str nos ayuda a determinar el tipo de
variable
El comando nrow nos indica el numero de filas
El comando ncol nos indica el numero de columnas que tiene
nuestra base de datos
El comando dim nos indica la dimension de la base de
datos
El comando names nos indica el nombre asignado a cada
columna en la base de datos elegida