Hi! I am new to R and I've run into problems when trying to run a t test on my data. I am trying to determine if there is significance between my independent and dependent variable under these conditions, I inputted this:
library(tidyverse)
attach(D_D_Sacc_Bottle_Data_stats_in)
select(PCB Treatment, Average .75%)%>%
filter(PCB Treatment == "A" | PCB Treatment == "B") %>%
t.test(data = df, Average .75%~PCB Treatment)
and was met with this error:
Error in UseMethod("select_") :
no applicable method for 'select_' applied to an object of class "character"
You should store the result of the select and filter calls in a data frame named df and then separately call the t.test. The code you posted tries to use the pipe to send the data into t.test() but then you call t.test with data = df and df does not exist.
Also, I would suggest changing the column names so they do not have spaces. It is a needless source of trouble.