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

  • SEARCH
  • Home
  • 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 8577689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:12:59+00:00 2026-06-11T20:12:59+00:00

I have a lot of result from parametric study to analyze. Fortunately there is

  • 0

I have a lot of result from parametric study to analyze. Fortunately there is an output file where the output file are saved. I need to save the name of file. I used this routine:

IndexJobs<-read.csv("C:/Users/.../File versione7.1/
  "IndexJobs.csv",sep=",",header=TRUE,stringsAsFactors=FALSE)

dir<-IndexJobs$WORKDIR
Dir<-gsub("\\\\","/",dir)
Dir1<-gsub(" C","C",Dir)

Now I use e for in order to read CSV and create different dataframe

for(i in Dir1){
  filepath <- file.path(paste(i,"eplusout.csv",sep=""))
  dat<-NULL
  dat<-read.table(filepath,header=TRUE,sep=",")
  filenames <- substr(filepath,117,150)
  names <-substr(filenames,1,21)
  assign(names, dat)
  }

Now I want to extract selected variables from each database, and putting together each variable for each database into separated database. I would also joint name of variable and single database in order to have a clear database for making some analysis. I try to make something but with bad results.
I tried to insert in for some other row:

 for(i in Dir1){
  filepath <- file.path(paste(i,"eplusout.csv",sep=""))
  dat<-NULL
  dat<-read.table(filepath,header=TRUE,sep=",")
  filenames <- substr(filepath,117,150)
  names <-substr(filenames,1,21)
  assign(names, dat)
  datTest<-dat$X5EC132.Surface.Outside.Face.Temperature..C..TimeStep.
  nameTest<-paste(names,"_Test",sep="")
  assign(nameTest,datTest)
  DFtest=c[,nameTest]
}

But for each i there is an overwriting of DFtest and remain only the last database column.

Some suggestion?Thanks

  • 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-11T20:13:00+00:00Added an answer on June 11, 2026 at 8:13 pm

    Maybe it will work if you replace DFtest=c[,nameTest] with

    DFtest[nameTest] <- get(nameTest)
    

    or, alternatively,

    DFtest[nameTest] <- datTest
    

    This procedure assumes the object DFtest exists before you run the loop.


    An alternative way is to create an empty list before running the loop:

    DFtest <- list()
    

    In the loop, you can use the following command:

    DFtest[[nameTest]] <- datTest
    

    After the loop, all values in the list DFtest can be combined using

    do.call("cbind", DFtest)
    

    Note that this will only work if all vectors in the list DFtesthave the same length.

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

Sidebar

Related Questions

I have uploaded a lot of images from the website, and need to organize
I am creating Excel file download using NOPI libraries. I have lot of data
I have a Fragment F. After getting result from a service, F needs to
I have this result set from my query: OrderId CustomerId ProducerId CustomerPayment ProducerPayment 1
I have written a gateway to get a result set from my database. How
I have to create an audio file from a stream generated by the SpeechSynthesizer.
I have a lot of code like this in one of my projects (from
I have a situation where in i need to pull data from one table
Have a lot of unnecessary results using contains() method in my query. Don't tell
I have this query where I am expecting a lot of results. private void

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.