select & rename R Functions of dplyr Package (2 Examples) | Extract Column & Change Name of Variable

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • How to extract and rename variables with the select and rename functions of the dplyr package in the R programming language. More details: statisticsglob...
    R code of this video:
    data <- data.frame(x1 = 1:3, # Create example data
    x2 = LETTERS[1:3],
    x3 = 5)
    data # Print example data
    install.packages("dplyr") # Install dplyr
    library("dplyr") # Load dplyr
    select(data, c(x1, x3)) # Apply select function
    rename(data, x1_new = x1) # Apply rename function

Комментарии • 5

  • @agsoutas
    @agsoutas 4 года назад +1

    Hey Joachim, nice video.
    The only issue I have is that when I clicked the link on the description for Statistics Globe nothing appeared.
    I imagine there was an issue with the website.

    • @StatisticsGlobe
      @StatisticsGlobe  4 года назад +1

      Hey, thanks a lot! I had a typo in the link. Now it should work :)

    • @agsoutas
      @agsoutas 4 года назад +2

      @@StatisticsGlobe Thank you!!! Is fixed.

  • @edimathomas-cr4km
    @edimathomas-cr4km 11 месяцев назад

    Why doesnt this work on my data. I've watched several videos on this and followed the steps but I keep getting error messages. It's frustrating

    • @cansustatisticsglobe
      @cansustatisticsglobe 11 месяцев назад

      Hello Thomas,
      I am sorry to hear that. What is the error message you are receiving?
      Best,
      Cansu