دنبال کننده ها

۱۳۹۶ اسفند ۲۳, چهارشنبه

ggplot2 - How do I remove a specific row in ggplot in r when working with y element of ggplot()? (Explanation better below)

[ad_1]



Currently graphing the below scatterplot and I have a "null" category on the x-axis. I have used which for NumofBed to remove the rows with "null" in them, but how do I remove this category from the sales_price y? (I'm getting the error that my x and y numbers don't match up because sales_price is including the rows where NumofBed is null).



scatterBedValue <- ggplot(housedata, aes(x=which(NumofBed != "null"), y=sales_price)) 


Graph below is using scatterBedValue <- ggplot(housedata, aes(x=NumofBed, y=sales_price))
enter image description here




[ad_2]

لینک منبع