Untitled R workspace
  • AI Chat
  • Code
  • Report
  • Spinner
    library("dplyr")
    library("tidyr")
    library("readxl")
    library("ggplot2")
    library("reshape2")
    library(scales)
    Prueba_fin <- read.csv("Prueba.csv",header = FALSE)
    Prueba_fin2 <- as.data.frame(t(Prueba_fin))
    Prueba_fin3 <- Prueba_fin2[-1,]
    names(Prueba_fin3) <- Prueba_fin3[1,]
    Prueba_fin4 <- Prueba_fin3[-1,]
    colnames(Prueba_fin4)[1]  <- "Fechas"
    colnames(Prueba_fin4)[2]  <- "Local_RCL"
    Prueba_fin4 %>% select(Fechas)
    Prueba_fin4 %>% select(Local_RCL)
    Prueba_fin4$Local_RCL <- gsub('%', '', Prueba_fin4$Local_RCL)
    class(Prueba_fin4$Local_RCL) = "Numeric"
    Prueba_fin4$Local_RCL<- as.numeric(as.character(Prueba_fin4$Local_RCL)) /100
    Prueba_fin4$Fechas <- as.Date(Prueba_fin4$Fechas, 
                                  format = "%Y/%m/%d")
    
    ggplot(Prueba_fin4, aes(Fechas, Local_RCL)) + 
      geom_line(aes(group=1),color="#69b3a2")  +
      geom_point(color = 'red') +
      theme_classic() +
      theme(axis.text.y = element_blank()) +
      scale_fill_grey()