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 6538985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:48:07+00:00 2026-05-25T10:48:07+00:00

I have written application that is analyzing data and writing results in CSV file.

  • 0

I have written application that is analyzing data and writing results in CSV file. It contains three columns: id, diff and count.
1. id is the id of the cycle – in theory the greater id, the lower diff should be
2. Diff is the sum of

(Estimator - RealValue)^2

for each observation in the cycle

3 count is number of observation during cycle

For 15 different values of parameter K, I am generating CSV file with name: %K%.csv , where %K% is the used value. My total number of files is 15.

What I would like to do, is to write in R simple loop, that will be able to plot content of my files in order to let me decide, which value of K is the best (for which in general the diff is the lowest.

For single file I am doing something like

 ggplot(data = data) + geom_point(aes(x= id, y=sqrt(diff/count)))

Does it make sense what I am trying to do ? Please note that statistics is completely not my domain, nor is R (but you probably could figure out this already).

Is there any better approach I can choose? And from theoretical point of view, am I doing what I am expecting to do?

I Would be very greateful for any comments, hints, critic and answers

  • 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-05-25T10:48:08+00:00Added an answer on May 25, 2026 at 10:48 am

    Edited to clean up some typos and address the multiple K value issue.

    I’m going to assume that you’ve placed all your .csv files in a single directory (and there’s nothing else in this directory). I will also assume that each .csv really do have the same structure (same number of columns, in the same order). I would begin by generating a list of the file names:

    myCSVs <- list.files("path/to/directory")
    

    Then I would ‘loop’ over the list of file names using lapply, reading each file into a data frame using read.csv:

    setwd("path/to/directory")
    #This function just reads in the file and
    # appends a column with the K val taken from the file
    # name. You may need to tinker with the particulars here.
    myFun <- function(fn){
         tmp <- read.csv(fn)
         tmp$K <- strsplit(fn,".",fixed = TRUE)[[1]][1]
         tmp
    }
    dataList <- lapply(myCSVs, FUN = myFun,...)
    

    Depending on the structure of your .csv’s you may need to pass some additional arguments to read.csv. Finally, I would combine this list of data frames into a single data frame:

    myData <- do.call(rbind, dataList)
    

    Then you should have all your data in a single data frame, myData, that you can pass to ggplot.

    As for the statistical aspect of your question, it’s a little difficult to offer an opinion without concrete examples of your data. Once you’ve figured the programming part out, you could ask a separate question that provides some sample data (either here, or on stats.stackexchange.com) and folks will be able to suggest some visualization or analysis techniques that may help.

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

Sidebar

Related Questions

I have written a WinForms application (C# 2.0, VS2008) that registers several file types
I have written a standalone Java application that I've packaged into a jar file
I have written c# application that uses mdf file for database.when i make setup
I have written a web application that posts a file via http to a
I have written an AIR Application that downloads videos and documents from a server.
I have written a WPF application that I want to port to Silverlight 2.
I'm using C# and i have written a locally installed application that dynamically generates
I have written a console application in Delphi that queries information from several locations.
I have recently written an application(vb.net) that stores and allows searching for old council
I have inherited a poorly written web application that seems to have errors when

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.