Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to select records containing certain names in the column in R

$
0
0

@pagal_guy wrote:

Hello,

I am trying to keep only the records which contain a particular promotion name from a list of promotion names in R.

top_10_promo_name <- c("Price Winners",
                       "Two Day Sale",
                       "Weekend Markdown",
                       "Go For It",
                       "Save-It Sale",
                       "One Day Sale",
                       "Shelf Clearing Days",
                       "Big Time Discounts",
                       "Super Duper Savers",
                       "Two for One")

sales_promo_10 <- sales_promo[as.character(sales_promo$promotion_name) %in% top_10_promo_name,]

However,even though there is no error all the promotion names are getting selected.

I know this is a very basic question but I am not being able to figure it out.Can someone please help me with this??

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles