0

I want to use spread function from tidyr package but my RStudio says "Error in spread(., nama_event, created_at) : could not find function spread" Therefore, I want to install tidyr package but it doesn't exist in RStudio 1.4.1.

Giuseppe
  • 25
  • 8
  • You are looking for pivot_wider? – jsv Apr 13 '21 at 04:46
  • 2
    Did you install the package, and did you load it before calling the function? This doesn't seem like a problem that's specific to `tidyr` or `spread`, just about generally loading things properly – camille Apr 13 '21 at 04:53
  • Thanks Camille, you're right it didn't load properly. – Giuseppe Apr 13 '21 at 05:10

1 Answers1

0

Instead of using spread you should use pivot_longer. https://tidyr.tidyverse.org/articles/pivot.html

To install a package, you shoud use install.packages.

crestor
  • 1,388
  • 8
  • 21