0
all right? I am trying to make a graph of interaction between the subjects (Variable S) being these subjects colored in 5 colors (which are the groups (variable G), but is giving the following error:
Error in select(. , Weight, Time, S) unused Arguments (Weight, Time, S)
setwd("C:\\Users\\breni\\Google Drive\\Acadêmica\\Mestrado\\Splines")
dados = read.table("dadosnovo1.csv", header = T, sep=";", dec=",")
dados$G <- factor(dados$G)
dados$S <- factor(dados$S)
dados$S1 <- factor(dados$S1)
str(dados)
attach(dados)
library(tidyverse)
interaction <- dados %>%
select(Peso, Tempo, S) %>%
group_by(S, Tempo) %>%
summarise(Average = mean(Peso))
x11()
ggplot(interaction, aes(x=Tempo, y=Average, colour=G, group=S)) +
ggtitle("Evolução do peso no tempo para cada individuo em grupos") +
geom_line()
I cannot reproduce this error. The (obvious) error is that
G
is not a variable ofinteraction
and therefore cannot becolour = G
. Just switch toselect(Peso, Tempo, G, S)
andgroup_by(G, S, Tempo)
and everything goes well.– Rui Barradas
interaction
is a base R function, maybe you want to switch to, for example,interact
.– Rui Barradas