Skip to content

Instantly share code, notes, and snippets.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Opinion Lexicon: Negative
;
; This file contains a list of NEGATIVE opinion words (or sentiment words).
;
; This file and the papers can all be downloaded from
; http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html
;
; If you use this list, please cite one of the following two papers:
##-----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)
@rparatodxs
rparatodxs / treemap
Last active January 23, 2018 19:32
Visualización de datos
#------------------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"),
#---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()
# 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
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
@rparatodxs
rparatodxs / innobd.txt
Last active September 3, 2018 17:38
revisión bd
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
@rparatodxs
rparatodxs / venta_final.txt
Last active March 1, 2019 11:56
venta_final
rm(list=ls())
library(RODBC)
library(sqldf)
myconn <-odbcConnect("validacion_karina")
sqlTables(myconn , tableType = "TABLE")
#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*/
#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")