0

I am trying to plot a data frame that has two columns in r that have the following format:

Col1-----name:"Date"-----class:"Date"----example: 2001-01-01 Col2-----name:TC---------class:"Numeric"----example:"4.50"

Here is a summary of the data frame I want to plot:

enter image description here

enter image description here

In order to plot the dataframe I am using the following command:

library(highcharter)
####################
#TC_df$fecha=as.numeric(as.POSIXct(TC_df$fecha))
####################
highchart(type="stock")%>%
  hc_title(text = "Tipo de cambio") %>% 
  hc_subtitle(text = "ARS/USD y dolar sombra ") %>%
  hc_xAxis(type = "Datetime", showLastLabel = TRUE,dateTimeLabelFormats = 
list(day = "%d", month="%b",year="%y"))%>%
 #hc_xAxis(categories = TC_df$fecha)%>%
  hc_add_series(TC_df$TC, name = "reservas",type="line",color="green")
 #hc_add_series(TC_df$dolarsombra, name = "USD 
Sombra",type="line",color="blue")

The result I am having has the problem that dates in the x-axis are all on 1 January 1970 as this image shows:

[enter image description here

Thanks in advance, so far this is my first post in stackoverflow, glad to receive some help from the community.

MLavoie
  • 9,671
  • 41
  • 36
  • 56
  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use `str()`, `head()` or screenshot)? You can use the [`reprex`](https://reprex.tidyverse.org/articles/articles/magic-reprex.html) and [`datapasta`](https://cran.r-project.org/web/packages/datapasta/vignettes/how-to-datapasta.html) packages to assist you with that. See also [Help me Help you](https://speakerdeck.com/jennybc/reprex-help-me-help-you?slide=5) & [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269) – Tung Nov 26 '18 at 05:31
  • Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot. – Martin Castellan Dec 27 '18 at 01:20
  • https://drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z – Martin Castellan Dec 27 '18 at 12:11
  • https://drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c – Martin Castellan Dec 27 '18 at 12:11

0 Answers0