R scattered in shape, color and filling

I am very new to R and I am trying to build a scatter plot that encodes my data according to shape, color, and padding. I want 5 different colors, 3 different shapes, and they need to be filled or not filled (at an unfilled point, I still want a shape and color). My data looks basically like this:

blank.test <- read.table(header=T, text="Colour Shape Fill X13C X15N
1       B     B    A   16   10
2       D     A    A   16   12
3       E     A    B   17   14
4       C     A    A   14   18
5       A     A    B   13   18
6       C     B    B   18   13
7       E     C    B   10   12
8       E     A    B   11   10
9       A     C    B   14   13
10      B     A    A   11   14
11      C     B    A   11   10
12      E     B    A   11   19
13      A     B    A   10   18
14      A     C    B   17   16
15      E     B    A   16   13
16      A     C    A   16   14")

If I do this:

ggplot(blank.test, aes(x=X13C, y=X15N,size=5)) + 
                    geom_point(aes(shape=Shape,fill=Fill,color=Colour))

I do not get filled or blank data points

enter image description here

I did a little research, and it seems that the problem was with the characters themselves, which cannot accept different settings for line and padding; It was recommended that I use pch shapes between 21 and 25

But if I do this:

ggplot(blank.test, aes(x=X13C, y=X15N,color=(Colour), shape=(Shape),fill=(Fill),size=5)) + 
                 geom_point() + scale_shape_manual(values=c(21,22,25))`

I still don't want me to

enter image description here

I also tried to play with scale_fill_manualno good result.

+4
2

, . , , /

blank.test$inter <- with(blank.test, interaction(Shape,  Fill))

-

ggplot(blank.test, aes(x=X13C, y=X15N)) + 
                    geom_point(aes(shape=inter,color=Colour)) + scale_shape_manual(name="shape", values=c(0,15,1, 16, 2, 17)) + scale_color_manual(name="colour", values=c("red","blue","yellow", "green", "purple"))
+1

, , , , fill. , . , - .

5, , , aes, , .

:

ggplot(blank.test, aes(x = X13C, y = X15N, color = Colour, shape = Shape, fill = Fill)) + 
  geom_point(size = 5, stroke = 3) + 
  scale_shape_manual(values=c(21,22,25)) +
  scale_color_brewer(palette = "Set2") +
  scale_fill_brewer(palette = "Set1") +
  theme_bw()

enter image description here

+1

Source: https://habr.com/ru/post/1618791/


All Articles