I've been trying to use this code and keep getting the error: Error: unexpected symbol in:
"WtLoss <- InData %>% pivot_longer(Al:S, names_to = "Trt", values to". Here's the code, does anyone have any suggestions?
InData <- read.csv("~/Data/ex9-13.txt", quote="'")
library(tidyverse)
WtLoss <- InData %>%
pivot_longer(Al:S, names_to = "Trt", values to= "Loss") %>% mutate(Trt = as_factor(Trt)) %>%
mutate(Trt = fct relevel(Trt, "S")) str(WtLoss)
table(WtLoss$Trt)