I have loaded the following libraries:
library(dplyr) library(ggplot2) library(tidyr) # Import the Ash data into a data table called “Lab_Ash_Data” Lab_Ash_Data <- Lab_Ash_Weights str(Lab_Ash_Data)
But the following code produces an error:
# Calculate Ash Variables # Use a PIPE to filter out the missing values using filter() # Sequentially calculate “InitialWeight”, “FinalWeight” and “Ash” as new variables using mutate() Lab_Ash_Calculated <- Lab_Ash_Data %>% filter(InitialSampleTinWeight ==0 & FinalSampleTinWeight ==0 & mutate(Ash_Data=Ash_Data$FinalWeight)/ InitialWeight) Error in filter_impl(.data, quo) : Evaluation error: object 'InitialSampleTinWeight' not found.
Yet the object is a header that was imported with the data. Why am I receiving this error?