warning message when trying to plot with R

I am trying to plot this data set. I imported it through the import tab on the top of the screen. It was imported as "Hynes". When I type Hynes it shows the dataset just like it shows underneath these sentences. When I try to plot it I get an error message on the bottom of this page. I am brand new to R and I'm lost.

Hynes

A tibble: 11 x 7

Table 1 ...2 ...3 ...4 ...5 ...6 ...7

1 samples stoneflies mayflies caddisflies beetles flies detritus
2 1 25 37 6 3 4 1
3 2 27 18 5 6 19 1
4 3 26 17 4 4 11 2
5 4 60 43 6 4 10 2
6 5 52 52 8 9 34 4
7 6 82 82 7 6 47 7
8 7 86 80 8 27 56 7
9 8 81 88 7 6 14 8
10 9 91 92 16 16 76 10
11 10 118 103 8 6 57 12

plot(Hynes)
Warning messages:
1: In data.matrix(x) : NAs introduced by coercion
2: In data.matrix(x) : NAs introduced by coercion
3: In data.matrix(x) : NAs introduced by coercion
4: In data.matrix(x) : NAs introduced by coercion
5: In data.matrix(x) : NAs introduced by coercion
6: In data.matrix(x) : NAs introduced by coercion
7: In data.matrix(x) : NAs introduced by coercion

Try

id, samples, stoneflies, mayflies, caddisflies, beetles, flies, detritus
2, 1, 25, 37, 6, 3, 4, 1
3, 2, 27, 18, 5, 6, 19, 1
4, 3, 26, 17, 4, 4, 11, 2
5, 4, 60, 43, 6, 4, 10, 2
6, 5, 52, 52, 8, 9, 34, 4
7, 6, 82, 82, 7, 6, 47, 7
8, 7, 86, 80, 8, 27, 56, 7
9, 8, 81, 88, 7, 6, 14, 8
10, 9, 91, 92, 16, 16, 76, 10
11, 10, 118, 103, 8, 6, 57, 12

then plot will yield

readr::read_csv("~/Desktop/grist.csv") -> dat  
#> Parsed with column specification:
#> cols(
#>   id = col_double(),
#>   samples = col_double(),
#>   stoneflies = col_double(),
#>   mayflies = col_double(),
#>   caddisflies = col_double(),
#>   beetles = col_double(),
#>   flies = col_double(),
#>   detritus = col_double()
#> )
plot(dat)

Created on 2020-09-11 by the reprex package (v0.3.0)

Thank you, I was able to get that plot with my original data. Im just really confused about the plot. lol I assumed that I did it wrong when I saw that plot graph. Is there anyway for me to clean it up to be one picture instead of 49 individual boxes?

plot did as it was asked. To do otherwise, it, or another function, such as ggplot must be told what to plot, e.g., a scatter plot of mayflies vs. stoneflies.

okay cool thank you!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.