subset values including null values
I am trying to solve an problem where I am essentially trying to subset
some data while inserting a 0 for data if the criteria is not met and keep
certain characteristics of the data frame.
For example: I have a data set:
Plot Species Status
1A ABBI L
1A PIEN D
1B ABBI D
1B PIEN L
2A ABBI L
Using the following selection criteria:
Species== 'ABBI', Status== 'L'
but the crux that I have is that I need the plot information intact,
therefore I need to add a row that is a 0 value if the ABBI criteria is
not met. For example:
Plot Species Status
1A ABBI L
1B 0
2A ABBI L
Any suggestions? Thanks in advance!
No comments:
Post a Comment