In R I try and make a loop/lapply function to run a list of characters through a function that processes and t.tests them. I am currently trying to run the function with a predefined variable, however I would like to have the function repeat down a list.
Data_F = ABC #this references a row in the Data1 Matrix. Data_Fs is the Columns.
Variable="item"
ttestFunc <-function(x){
#Make a matrix one tall to turn into a numeric vector
Data1[Data_F, Data_Fs]-> "ttesttest"
as.numeric-> "ttestvect"
t.test(ttestvect, ttestvect)
Basically, I would like to know how to loop through multiple variables to input into Data_F instead of the predefined ABC. I want to loop through a vector like
c("ABC", "ABB", "XYZ")