-1

I have a large dataset and I want to filter out every row that has a certain value for year. I'm using R for the first time

I searched a lot for it online and this is what it got me. My dataset is called matches.

library(tidyverse)  
matches %>%
  filter(Jaar.x > 1619 & Jaar.y < 1812) %>%
  select(match, Jaar.x, Jaar.y)

This works fine, but just shows a tibble with all values. However, the data in the right upper side of my screen doesn't change, and I can't seem to make a data frame of this tibble I just created. How do I do this?

AnilGoyal
  • 25,297
  • 4
  • 27
  • 45
  • You have to assign the result of the code to some object by adding like `-> resulting_data` to the end of the code. – AnilGoyal Jun 11 '21 at 09:16
  • Welcome. :) I removed the redundant tags `RStudio` as the problem has nothing to do with IDE whether RStudio or other? Hope you will include Rstudio tags, in future, having question related to IDE only. To cite from tag information `RStudio is an IDE for the R statistical programming language. DO NOT use this tag for general R programming problems, just use the R tag. ONLY use for RStudio-specific questions.` – AnilGoyal Jun 11 '21 at 09:24
  • Welcome! Please, provide a [minimal reproducible example](https://stackoverflow.com/a/5963610/9537439) with `dput()` function and I recommend getting used to provide also an example of the output expected. – Chris Jun 18 '21 at 03:17

1 Answers1

0

You can't see your amended data because you haven't assigned it to a variable. To store your changes to your matches data, you'll have to do:

matches <- matches %>%
  filter(Jaar.x > 1619 & Jaar.y < 1812) %>%
  select(match, Jaar.x, Jaar.y)
Rory S
  • 1,278
  • 5
  • 17