Hi,
I have a data frame, where some of the values are negative in debt column.
company<-c("comp1","comp1","comp2","comp2","comp2","comp3","comp3")
year<-c(2010,2011,2010,2011,2012,2009,2010)
MV<-c(12,54,23,54,66,54,34)
price<-c(43,34,43,54,65,34,65)
debt<-c(54,54,56,-12,54,23,45)
df<-data.frame(company,year,MV,price,debt)
My question is: I want to remove the companies that have negative "debt" values. That is, not just remove the row with the negative value, but remove all of the observations of company 2 (as there is one (or more) year with negative value).
Thanks!