R t-test table for a word document

I would like to compare the job satisfaction of part-time workers in the health industry and the financial industry.
Should I do a t-test?
How can I do this with R. Can I use stargazer to get a table for a word document?

Variables

IND

  • 12 = Financial industry (161 observations)
  • 17 = Health industry (151 observations)

pv1 (Job satisfaction)
scale from 1 to 5 (I treat this as a continuous numerical variable. I know that this is controversial)

data=read.csv("jobsatisfaction.csv",header=T,sep=";")
t.test(data$pv1~data$IND)

Is this code correct. How can I get a t-test table for a word document?

A post was merged into an existing topic: t-test table for word document - comparing means of two populations

Please do not duplicate open topics