I can not plot data taken from a csv file. Here's how to get the data:

nS <- read.csv(file="8.csv", header=TRUE, sep=";"); nS <- nS[,-1]; 

It turns out this table:

  Daily Fact 1 01.01.2008 2060,54 2 02.01.2008 2321,89 3 03.01.2008 2465,55 4 04.01.2008 2629,14 

How to build a day / value graph in R language

    1 answer 1

     x <- read.table(text = ' Daily Fact 1 01.01.2008 2060,54 2 02.01.2008 2321,89 3 03.01.2008 2465,55 4 04.01.2008 2629,14', header = TRUE, dec = ",") x$Daily <- as.Date(x$Daily, format = "%d.%m.%Y") 

    Schedule standard means R:

     plot(x = x$Daily, y = x$Fact, type = "p") lines(x = x$Daily, y = x$Fact) 

    Using the ggplot2 package:

     library(ggplot2) ggplot(x, aes(x = Daily, y = Fact)) + geom_point(stat = "identity") + geom_line(stat = "identity") 

    Bar chart:

     ggplot(x, aes(x = Daily, y = Fact)) + geom_col() 
    • help me please. Now your code is building a graph, but only dates are mapped from 1 to 4, not the value of the Fact column. - Version8
    • This is because Fact was considered as a string (factor). Added dec = "," . - Artem Klevtsov
    • For the separator ";" there is a standard read read.csv2() - ikashnitsky
    • @ArtemKlevtsov, Thank you very much. - Version8
    • @ikashnitsky, I understand, I will study. - Version8