Primero la Sección de Librerías de Funciones
#rownames(installed.packages())
wants <- c(
"magrittr",
"tidyverse",
"DescTools",
"MVN",
"mvtnorm",
"ggformula",
"ez",
"lsr",
"FinCal"
)
has <- wants %in% rownames(installed.packages())
if(any(!has)) install.packages(wants[!has])
library(dplyr)
A partir de aquí la Sección de Importación de Datasets.
getwd() #get to show me the current Working Directory
[1] "I:/001.7 CURSO-02 Lenguaje R Semillero/21.09.24.A Proyecto_01"
# code to download the dataset
download.file("https://ibm.box.com/shared/static/n5ay5qadfe7e1nnsv5s01oe1x62mq51j.csv", destfile="movies-db.csv")
trying URL 'https://ibm.box.com/shared/static/n5ay5qadfe7e1nnsv5s01oe1x62mq51j.csv'
Content type 'text/csv' length 1424 bytes
downloaded 1424 bytes
movies_data <- read.csv("movies-db.csv", header=TRUE, sep=",")
movies_data
summary(movies_data) # Summary Estadístico.
name year length_min
Length:30 Min. :1936 Min. : 81.00
Class :character 1st Qu.:1988 1st Qu.: 99.25
Mode :character Median :1998 Median :110.50
Mean :1996 Mean :116.80
3rd Qu.:2008 3rd Qu.:124.25
Max. :2015 Max. :179.00
genre average_rating cost_millions
Length:30 Min. :5.200 Min. : 0.400
Class :character 1st Qu.:7.925 1st Qu.: 3.525
Mode :character Median :8.300 Median : 13.000
Mean :8.103 Mean : 22.300
3rd Qu.:8.500 3rd Qu.: 25.000
Max. :9.300 Max. :165.000
foreign age_restriction
Min. :0.0 Min. : 0.00
1st Qu.:0.0 1st Qu.:12.00
Median :0.0 Median :14.00
Mean :0.4 Mean :12.93
3rd Qu.:1.0 3rd Qu.:16.00
Max. :1.0 Max. :18.00
head(movies_data) # Primeros 6.
names(movies_data) # Names de columnas.
[1] "name" "year" "length_min"
[4] "genre" "average_rating" "cost_millions"
[7] "foreign" "age_restriction"
print(is.data.frame(movies_data))
[1] TRUE