unexpected symbol in R

Trying to do a two sample t test and keep getting error in terms. formula (formula[2L-]) invalid model in extractVArs
heres my code

independant t test between starch and liveweight

t.test('Starch' ~ 'Liveweight change kg/day')

Hi @pete_reis, you can get a better response if you put more information about your problem, like the data example.
For now I can understand that you have difficulties with the column names when using the t.test(). Check that you are using the column names of your data.

you_data 

names(you_data ) # check the letters, spaces y other symbol.

# `Liveweight change kg/day` For this you need put in backtick because have a /.

t.test(Starch ~ `Liveweight change kg/day`, data = you_data) #
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.