Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:32:55+00:00 2026-06-17T16:32:55+00:00

I would like to execute anova on multiple datasets stored in my working directory.

  • 0

I would like to execute anova on multiple datasets stored in my working directory. I have come up so far with:

files <- list.files(pattern = ".csv")
for (i in seq_along(files)) {
    mydataset.i <- files[i]
    AnovaModel.1 <- aov(DES ~ DOSE, data=mydataset.i)
    summary(AnovaModel.1)
} 

As you can see I am very new to loops and cannot make this work. I also understand that I need to add a code to append all summary outputs in one file. I would appreciate any help you can provide to guide to the working loop that can execute anovas on multiple .csv files in the directory (same headers) and produce outputs for the record.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:32:56+00:00Added an answer on June 17, 2026 at 4:32 pm

    you might want to use list.files with full.names = TRUE in case you are not on the same path.

    files <- list.files("path_to_my_dir", pattern="*.csv", full.names = T)
    # use lapply to loop over all files
    out <- lapply(1:length(files), function(idx) {
        # read the file
        this.data <- read.csv(files[idx], header = TRUE) # choose TRUE/FALSE accordingly
        aov.mod <- aov(DES ~ DOSE, data = this.data)
        # if you want just the summary as object of summary.aov class
        summary(aov.mod)
        # if you require it as a matrix, comment the previous line and uncomment the one below
        # as.matrix(summary(aov.mod)[[1]])
    })
    head(out)
    

    This should give you a list with each entry of the list having a summary matrix in the same order as the input file list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jar file that I would like to execute using PHP, but
I have a specific DB2 query, and I would like to execute this query
I would like to execute a stored proc that simply updates a record. At
I would like to execute a program in .NET server side code. So far
I would like to execute a function when Simplemodal opens a window, and have
I would like to execute foo.bat from within a Groovy program and have the
I would like to execute 2 splits using AWK (i have 2 fields separator),
I have Problem with symfony i would like to execute the backend process from
I would like to execute a method in a thread. The method has multiple
I have a PHP website and I would like to execute a very long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.