jeudi 15 octobre 2020

How to plot selected data of a column in R using ifelse conditional statements

I have a data set of placements with two of the columns being status and salary. There are other columns too but my question is regarding plotting of these two particular columns.

enter image description here

I want to plot only that data from the status column which has the value "Placed" in the rows, using conditional statements in the ggplot() function itself. Is it possible to do so and how?

My code is

ggplot(data = pl_data, mapping = aes(if x = (pl_data$status = "Placed"), y = (pl_data$salary), y = 'N/A'))

Aucun commentaire:

Enregistrer un commentaire