No need to worry about this because when I re-import the data set again it worked.
I also forget to add one more condition which is splitting the three conditions by (Opening_text = Image and Sound).
slope_n <- df %>%
+ group_nest(Source.Name, visbility, soundvolume, Opening_text) %>%
+ mutate(model = map(data, ~lm(m ~ stim_ending_t, data = .x))) %>%
+ mutate(slope = map_dbl(model, ~tidy(.x)$estimate[2]))
And here is what I got
Source.Name visbility soundvolume Opening_text slope
001_visual_demo1.csv 0 0 Now focus on the Image 0.533132088
001_visual_demo1.csv 0 0 Now focus on the Sound 0.437678643
001_visual_demo1.csv 0 1 Now focus on the Image 0.443719612
001_visual_demo1.csv 0 1 Now focus on the Sound 0.59256568
001_visual_demo1.csv 1 0 Now focus on the Image 0.651976049
001_visual_demo1.csv 1 0 Now focus on the Sound 0.572769348
002_visual_demo1.csv 0 0 Now focus on the Image 0.740229364
002_visual_demo1.csv 0 0 Now focus on the Sound 0.642380473
002_visual_demo1.csv 0 1 Now focus on the Image 0.66209081
002_visual_demo1.csv 0 1 Now focus on the Sound 0.745573256
002_visual_demo1.csv 1 0 Now focus on the Image 0.826084381
002_visual_demo1.csv 1 0 Now focus on the Sound 0.740139004
When I tried to export the data to .csv file using this code
write.table(slope_n, file = "slope_n.csv", row.names=F, sep = ",")
I got this error message unimplemented type 'list' in 'EncodeElement' which basically means some of the columns are lists instead of being factors.
So simple way to fix it using this code:
slope_n <- apply(slope_n,2,as.character)