New data that keeps others variables ?

Hello there,

I'm new to the RStudio World. Sorry if it's an idiot question..

My data is a large list of 657 elements. I wrote this :

tapply(bdd$child, bdd$couple, freq, total = TRUE)

n % val%
No 641 15.1 15.1
Yes 3595 84.9 84.9
Total 4236 100.0 100.0

n % val%
No 5 0 0
Yes 14052 100 100
Total 14057 100 100

I want to create a new data with only people that got children but with all the other data

The base data is a questionnary, so I want al answers from people with children on one side, and all answers from people without childre on the other side)
I think I have to use dataframe but not sure..

Thank you so much !

if you use tidyverse package/library, you could simply use a filter() on your dataframe to select all columns but only rows/observations with children

I tried

filter(data, data$child == "Yes")

It doesn't work :confused:

Wrong syntax, it should be something like

filter(data, child == "Yes")

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.