I am new to R and am trying to understand some codes that other people have written. The code I am focusing on right now was written by @andresrcs in this thread:
df %>%
pivot_longer(c("PA", "PUA"), names_to = "type") %>%
ggplot(aes(y = Country, x = value, fill = type)) +
geom_col() +
scale_x_continuous(labels = scales::percent_format(scale = 1))
#> Error in df %>% pivot_longer(c("PA", "PUA"), names_to = "type") %>% ggplot(aes(y = Country, : could not find function "%>%"
As you can see, andresrcs writes "10L" in the c() function following row.names. What does "-10L" mean? From what I understand, including "-10L" will produce a data frame with 10 rows. But I cannot find any instruction document to confirm that. Furthermore, why is the integer negative (-10 instead of 10)? Does it have something to do with the "L" element?
Also, I haven't manually written the "L"s, that part of the code comes from the sample data (in a copy/paste friendly format). That format is usually produced by the use of the dput() or datapasta::df_paste() functions.
Read this reprex guide to better understand the concept
P.S. Is it okay to thank people on RStudio? The guidelines on StackOverflow (another coding forum, which I'm sure you've heard of) recommend that we do not thank each other lest we clog up our threads. Does the same policy apply in RStudio?