Sie sind auf Seite 1von 7

Datos Externos en R

Presentado por: Jorge Mario Calvo L


Datos Externos en R

R permite leer y cargar datos en variables


desde archivos externos como:
Archivos de texto: separados por comas (csv) o por espacios
en blanco
Excell
SAS, SPSS
Etc
R permite cargar datos desde una direccin
URL
R permite cargar datos de Twitter y otras
redes sociales
Vamos a crear un
conjunto de datos
en Excell y lo
vamos a exportar
como un archivo
csv
Leer datos de un archivo en R

Directorio de trabajo
> getwd()
[1] "C:/Users/JorgeMario/Documents
Cambiar de directorio de trabajo. Usar el carcter (/)
para la ruta
> setwd("C:/Users/JorgeMario/Dropbox/Cursos/BigDataAnalysisCognitive/R")
> getwd()
[1] "C:/Users/JorgeMario/Dropbox/Cursos/BigDataAnalysisCognitive/R"
Leer el archivo y cargarlo en una variable
>data = read.csv("EdadPesoGrasas.csv")
Resumen de los datos leidos
>summary(data)
Resumen y estructura de los datos
ledos
> data = read.csv("EdadPesoGrasas.csv")
> summary(data)
peso edad grasas genero
Min. :27.00 Min. :20.00 Min. :181.0 F:12
1st Qu.:63.00 1st Qu.:30.00 1st Qu.:254.0 M:13
Median :69.00 Median :37.00 Median :303.0
Mean :68.68 Mean :39.12 Mean :310.7
3rd Qu.:76.00 3rd Qu.:50.00 3rd Qu.:374.0
Max. :89.00 Max. :60.00 Max. :451.0

> str(data)
'data.frame': 25 obs. of 4 variables:
$ peso : int 84 73 65 70 76 69 63 72 79 75 ...
$ edad : int 46 20 52 30 57 25 28 36 57 44 ...
$ grasas: int 354 190 405 263 451 302 288 385 402 365 ...
$ genero: Factor w/ 2 levels "F","M": 2 2 2 2 1 1 1 1 1
Datos Externos en R

Existen muchos conjuntos de datos en internet muy


tiles e interesantes para realizar anlisis
Existe una tendencia, sobre todo en el gobierno para
publicar datos. (Open Data Datos Abiertos)
Catalogo de datos abiertos de Colombia
Datos.gov.co
Data.gov Datos Abiertos de USA
Existe un sitio de Innovacin abierta en Datos y retos
de anlisis de datos
Kaggle.com
Cargar algn conjunto de datos externos
2016 Microsoft Corporation. All rights reserved. The text in this document is available under the Creative Commons Attribution 3.0 License, additional terms may apply. All other
content contained in this document (including, without limitation, trademarks, logos, images, etc.) are not included within the Creative Commons license grant. This document does
not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes.
This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear
the risk of using it. Some examples are for illustration only and are fictitious. No real association is intended or inferred. Microsoft makes no warranties, express or implied, with
respect to the information provided here.

Das könnte Ihnen auch gefallen