3.1. Datos precargados

Para acceder a los datos precargados se utiliza la función data()

#data()
datos1=AirPassengers
plot(datos1)

Interpretar: Se tiene tendencia y factor estacionario y multiplicativo

datos2=co2
plot(datos2)

Interpretar: Se tiene tendencia y factor estacionario

3.2. Importar y exportar datos de otras fuentes

Para exportar datos en .csv

datos3=iris
write.csv(datos3,"datos iris.csv")
#getwd()

Para leer un archivo excel previamente se deve instalar la libreria readxl

#install.packages("readxl")
#install.packages("writexl")
library(readxl)
## Warning: package 'readxl' was built under R version 4.5.1
library(writexl)
## Warning: package 'writexl' was built under R version 4.5.1
datos4=read_excel("Regresion Lineal Simple.xlsx", sheet = 2)
datos4
## # A tibble: 5 × 2
##   `Consumo del bien A` `Consumo del bien B`
##                  <dbl>                <dbl>
## 1                    1                  4  
## 2                    2                  3.5
## 3                    3                  2.8
## 4                    4                  1.9
## 5                    5                  0.8
datos5=read_excel("Variable ficticia - copia.xlsx", sheet = 1)
## New names:
## • `` -> `...4`
datos5
## # A tibble: 7 × 5
##   ingreso sexo   educacion  ...4  `series hombre=sexo="Hombre"`               
##     <dbl> <chr>  <chr>      <lgl> <chr>                                       
## 1     800 Hombre Secundaria NA    "series mujer=sexo=\"Mujer\""               
## 2     500 Mujer  Primaria   NA    "series primaria=educacion=\"Primaria\""    
## 3     200 Mujer  Primaria   NA    "series secundaria=educacion=\"secundaria\""
## 4    4500 Mujer  Superior   NA    "series suyperior=educacion=\"superior\""   
## 5    5000 Hombre Superior   NA    "ls ingreso c mujer"                        
## 6    1250 Mujer  Secundaria NA    "series mujer=sexo=\"Mujer\""               
## 7    1500 Hombre Superior   NA    "ls ingreso c mujer"
head(datos5)
## # A tibble: 6 × 5
##   ingreso sexo   educacion  ...4  `series hombre=sexo="Hombre"`               
##     <dbl> <chr>  <chr>      <lgl> <chr>                                       
## 1     800 Hombre Secundaria NA    "series mujer=sexo=\"Mujer\""               
## 2     500 Mujer  Primaria   NA    "series primaria=educacion=\"Primaria\""    
## 3     200 Mujer  Primaria   NA    "series secundaria=educacion=\"secundaria\""
## 4    4500 Mujer  Superior   NA    "series suyperior=educacion=\"superior\""   
## 5    5000 Hombre Superior   NA    "ls ingreso c mujer"                        
## 6    1250 Mujer  Secundaria NA    "series mujer=sexo=\"Mujer\""