R, a question about data mining. I'm an R super beginner and asked a similar question a few days ago.
I want to plot the statistics of the imported data from the csv file below on a line graph with ggplot.
If i import a csv file and write it in R, it will be displayed as shown at the bottom. Using this data directly, I would like to plot the "Signal" average on the Y axis and the "Time" as a categorial variable on the X axis.
If i draw the graph with the code below using the data for practice on other websites, the graph will appear properly, so I think there is a problem with the data formatting, but there is something wrong Is it? I would be pleased if someone could teach me.
I wrote the code as follows.
"DT"is the data originally in csv placed at the bottom.
a<-ggplot (DT, aes (x = as.numeric (Time), y = Signal)) +
stat_summary (fun.y = mean, geom = "point", size = 4) +
stat_summary (fun.y = mean, geom = "line", size = 1)
a +
xlab ("Time") +
theme (axis.title.x = element_text (color = "Black", size = 25),
axis.title.y = element_text (color = "Black", size = 25),
axis.text.x = element_text (size = 15),
axis.text.y = element_text (size = 15),
legend.title = element_text (size = 15),
legend.text = element_text (size = 15),
legend.position = c (1,1),
legend.justification = c (1,1))
A tibble: 16 x 3
ID Time Signal
<chr><chr><int>
1 MDC16b-1 0min 342
2 MDC16b-2-1 0min 360
3 MDC16b-2-2 0min 248
4 MDC16b-3-1 0min 144
5 MDC16b-1 1min 336
6 MDC16b-2-1 1min 348
7 MDC16b-2-2 1min 241
8 MDC16b-3-1 1min 145
9 MDC16b-1 5min 330
10 MDC16b-2-1 5min 347
11 MDC16b-2-2 5min 237
12 MDC16b-3-1 5min 145
13 MDC16b-1 10min 335
14 MDC16b-2-1 10min 345
15 MDC16b-2-2 10min 233
16 MDC16b-3-1 10min 145
Warning messages:
1: In fun (x, ...): NAs introduced by coercion
2: In FUN (X [[i]], ...): NAs introduced by coercion
3: In FUN (X [[i]], ...): NAs introduced by coercion
4: Removed 16 rows containing non-finite values (stat_summary).
5: Removed 16 rows containing non-finite values (stat_summary).
Warning will come out.
-
Answer # 1
Related articles
- python - graph drawing with matplotlib
- about python graph drawing library
- python bar graph drawing, setting appropriate bar thickness
- automate graph drawing with matplotlib of python
- python sympy graph drawing
- python - about graph drawing of time more than 24 hours
- python graph drawing code
- [error] creating bar graph
- i want to speed up graph drawing in c #
- python - can you save the graph created by snsjointplot in png format?
- C # method of drawing a graph
- graph drawing using python pandas matplotlib
- Python implementation example of drawing a graph using matplotlib in tkinter
- Analysis of Python scatter plot and line graph drawing process
- Python implements association graph drawing based on pyecharts
- graph drawing in ruby or c
- graph drawing with numpy and matplotlib
- [r] graph the ratio of fibonacci numbers
- cannot create line graph with ggplot2
- javascript - chartjs about graph drawing
- r : Change ggplot legend options
- regarding the method to output the histograms of all columns at once
- changing the shape and color of dot plot of ggplot
- r - about handling geom_vline in ggplot2
- coastline plot in r
- r - i want to use a function instead of opts in ggplot2
- i want to specify the bubble color using variables in the data frame with ggplot2 of r
- cannot create line graph with ggplot2
- [r] method to output boxplot graph of r by condition (aes(fill=●●) cannot be used for color coding)
You can probably see the direct cause of the error by trying the following code: