Using UPDATE as an additional filtering criteria



I set up the following libraries:

# Libraries

I used the filter() function to remove rows that contain a missing value in my data:

Lab_Fibre_Filtered <- Lab_Fibre_Data %>;% filter(InitialSampleCanWeight_1 >0 &

                                                 InitialSampleCanWeight_2 >0 &

                                                 FinalSampleCanWeight_1 >0 &

                                                 FinalSampleCanWeight_1 >0 &

                                                 SampleWeight_1 >0 &

                                                 SampleWeight_2 >0)

I then checked for an absolute difference between the two estimates equal to or greater than 0.25 units:

Lab_Fibre_Filtered <- Lab_Fibre_Filtered %>;% filter(!(abs(Fibre1 - Fibre2) >= 0.25))

and now I have to use UPDATE to include the difference limit as an additional filtering criteria. However, when I try to run the following I receive an error:

Update(Lab_Fibre_Filtered, abs(Fibre1 - Fibre2))

Error in Update(Lab_Fibre_Filtered, abs(Fibre1 - Fibre2)) : 
  could not find function "Update"

What do I need to add to make this work?


I thought maybe the capital letter was causing the issue so I have updated the code to:

update(Lab_Fibre_Filtered, abs(Fibre1 - Fibre2))

I now have another error:

Error in update.default(Lab_Fibre_Filtered, abs(Fibre1 - Fibre2)) :
need an object with call component

What do I need to call?


Not to worry, just realised that my code has covered it.....