I want to create a new variable with logical operators

Hi there, and welcome to community.rstudio.com! It's a little difficult to understand what your goal is - should D be calculated for every value of A, including those that exceed 5? Have you attempted writing any code to calculate D?

A little bit more context and explanation will help us understand your needs. Instead of posting an image, can you please add a reprex (reproducible example) to your post? This will ensure we're all looking at the same data and code. A guide for creating a reprex can be found here.

1 Like