how can I create a new data frame using exact rows from the old data frame in R Studio?

anastasiia

I need to select the exact rows from the old data frame and create a new one. I need to choose rows which contain paired numbers (as 11, 22, 33, 44, 55, 66, 77, 88 and 99). How can I do this?

I tried using filter:

paired1 <- filter(paired1$Var1=='22')
# Error in UseMethod("filter") : 
#  no applicable method for 'filter' applied to an object of class "logical"

And with:

> with (paired1, sum (Freq[Var1 == '11' & '22']))
# Error in Var1 == "11" & "22" : 
#  operations are possible only for numeric, logical or complex types
Ric Villalba

For two digit numbers:

paired1[paired1$var1 %in% seq(11, 99, 11),]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I add new rows into a grouped data frame in R?

How can I create a new series by using specific rows and columns of a pandas data frame?

duplicate rows and create new data frame in R

How to predict values of column in new Python data frame using info from the old data frame

How to create a new rows from column values of pandas data frame

How to create a new column in R from data in another data frame?

How can I create a new data frame with several rows for each observation based on string column?

How can I create a new wide data frame with rows based on all combos of values in two columns?

in R, how can I keep all rows from one data frame based on groups from a second data frame?

How to create new columns in a new data frame from information in an existing data frame in R

How do I create multiple new data frames in R, derived from a single data frame and named sequentially?

How can I create a new data frame based on the existing columns?

Can I create a tibble with 1 row and 11 columns in R from a data frame with 0 rows and 0 columns?

Geting new data into old data frame in R

R: How can I add rows based on values of a data frame?

Create New Variable in an data frame using values from another data frame in R

Pivot table in R: create a new data frame and populate it from an existing data frame using logical statements

How to loop through the columns in an R data frame and create a new data frame using the column name in each iteration?

How do I remove all rows from data frame that equal unique value in seperate data frame in R?

R - How to create a data frame from a data frame with conditions?

How can I create a new column in a pandas data frame by extracting words from sentences in another column?

Populating new variable from ddply within old data frame in R

Pyspark create new data frame with updating few columns from old data frame

How can I create multiple shades in dygraphs using a data frame?

Create frequency data frame and transfer columns from old data frame

Loop over data frame rows and create data frame from new rows

R Efficient way to create new data frame from unique rows between two data frames

Creating new data frame from old dataframe

How can I make a new column and data frame with the percentage change from the start of a particular row in R?