This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rvest) | |
#sitio web donde se "toma la decisión" sobre que estación, año, mes extraer (hay que agregar valores) | |
url <- html_session("https://climatologia.meteochile.gob.cl/application/index/productos/RE1005") | |
#extraer la "form" que se debe completar | |
quesepuederellenar <- html_form(url) | |
extraercamposarellenar <- quesepuederellenar[[1]] | |
#Vamos a extraer valores para todos los meses de una estación el año 2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE TotalUL") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE PanelMensual_PF") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE VentasMesFP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CodRec_2018P") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CuentaOrigP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CuentaRectP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE NoCoincidentes") | |
bd<-RODBC::sqlQuery(channel = myconn,query = "select * from VentasMesFP") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE oriP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE recP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CodOri_2019P") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CodRec_2019P") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CuentaOrigP") | |
#RODBC::sqlQuery(channel = myconn,query = "DROP TABLE CuentaRectP") | |
#/*Tiempo de ejecución OCT2019 00:40:34*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
library(RODBC) | |
library(sqldf) | |
myconn <-odbcConnect("validacion_karina") | |
sqlTables(myconn , tableType = "TABLE") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
setwd("C:/Users/Jbustos/Documents/Jose_Bustos/Innoprint_2018/") | |
bd<-read.csv2("Innoprint_meses.csv", sep=";", dec=",", h=T) | |
bd_kiwi<-read.csv2( "Kiwi_meses.csv" , sep=";", dec=",", h=T) | |
#----arreglo de las temporadas a meses años----- | |
bd$año[bd$TEMPORADA=="TEMP.2011-2012" & bd$MES=="Septiembre"] <- 2011 | |
bd$año[bd$TEMPORADA=="TEMP.2011-2012" & bd$MES=="Octubre"] <- 2011 | |
bd$año[bd$TEMPORADA=="TEMP.2011-2012" & bd$MES=="Noviembre"] <- 2011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(dplyr) | |
library(deldir) | |
library(colourlovers) | |
library(rlist) | |
# Parameters | |
iter=3 # Number of iterations (depth) | |
points=14 # Number of points | |
radius=1.14 # Factor of expansion/compression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load in libraries | |
library(ggplot2) | |
library(dplyr) | |
library(deldir) | |
# Parameters to change as you like | |
iter=3 # Number of iterations (depth) | |
points=6 # Number of points | |
radius=3.8 # Factor of expansion/compression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---Harvard Ejemplos de Estudio---------- | |
#http://tutorials.iq.harvard.edu/R/Rgraphics/Rgraphics.html | |
setwd("C:/Users/Jbustos/Documents/CURSO_R/Curso_R_INE_2018/datos/Rgraphics/Rgraphics") | |
housing <- read.csv("dataSets/landdata-states.csv") | |
head(housing[1:5]) | |
hist(housing$Home.Value) | |
library(ggplot2) | |
ggplot(housing, aes(x = Home.Value)) + | |
geom_histogram() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------visualización estadisticas oficiales----------------- | |
library(openxlsx) | |
library(treemap) | |
setwd("C:/indices/IVC_ISUP/ENTREGABLES") | |
bd<-read.xlsx("Historico_IVC_Real_LDP_C_G_D_NOV2017 .xlsx" , 1) | |
#---------treemap | |
treemap(bd, | |
index=c("C", "LDP"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##-----ESTA ES UN REPLICA DE VARIOS EJEMPLOS DE COMO HACER UN ANALISIS DE SENTIMIENTO EN R---- | |
#----1. conectar r con twitter | |
#----desde tu cuenta de twitter crea una api en el sitio de twitter: https://apps.twitter.com/ | |
#----luego hay hacer la coneccion, para lo que hay q obtener: | |
library(twitteR) | |
library(ROAuth) | |
library(httr) |
NewerOlder