Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ETF = ETF_LU1834988278
- #Cobas Internacional
- rm(list = ls(all = TRUE)) #Clear workspace
- gc() #Clear memory
- library("gmnl") #paquete para estimar el MNL
- library("Hmisc") # Library of p-values in correlation matrix
- library("PerformanceAnalytics")
- #install.packages("FactoMineR")
- library("FactoMineR")
- #install.packages("openxlsx")
- library("openxlsx")
- library(data.table)
- library(datasets)
- library("DAAG")
- library("dplyr")
- library("lubridate")
- library("tidyverse")
- library("ggplot2")
- setwd('C:\\Users\\USUARIO\\OneDrive\\Documentos\\R\\CorrelationCobas\\Datos')
- set.seed(100)
- #Creo tabla.
- #Utilizo vectores 1:n para posteriormente ordenar.
- Cobas <- read.xlsx("CobasInt.xlsx")
- CobasOrdenado <- cbind(Cobas, c(1:1695))
- colnames(CobasOrdenado) <- c("Fecha", "VL_Cobas", "OrdenCobas")
- ETF <- read.xlsx("ETF.xlsx")
- ETFOrdenado <- cbind(ETF, c(1:3025))
- colnames(ETFOrdenado) <- c("Fecha", "VL_ETF", "OrdenETF")
- Datos <- merge(x=CobasOrdenado, y=ETFOrdenado, by="Fecha")
- Datos <- Datos
- #Quitamos lo que no vale para nada.
- DF <- Datos[-c(3, 5)]
- #Empieza lo divertido
- ggplot(data=DF, aes(x=VL_ETF, y=VL_Cobas)) + geom_point() + stat_smooth()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement