1

I would like to add a new column, name it converted. In the converted column I would like to set all customers who have sales >0 to equal 1 and all customers who have 0 sales equal to 0.

I've tried this so far, but it doesn't create a new column.

converted <- ifelse(DisplayCampEval$sales>0, 1, 0)

1 Answer 1

2

We can use

DisplayCampEval$converted <- ifelse(DisplayCampEval$sales>0, 1, 0)
Sign up to request clarification or add additional context in comments.

1 Comment

I will, I have to wait 10 minutes before I can accept!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.