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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:03:48+00:00 2026-05-28T00:03:48+00:00

2 CSV fs: works read.table(‘./Trial7/glob.csv’)->e1 read.table(‘./Trial7/keh.csv’)->e2 b1<-data.frame(as.Date(e1$V1, %d.%m.%Y), e1$V2) b2<-data.frame(as.Date(e2$V1, %d.%m.%Y), e2$V2) png(‘./Pictures/compare2.png’) plot(b1,

  • 0

2 CSV fs: works

    read.table('./Trial7/glob.csv')->e1
    read.table('./Trial7/keh.csv')->e2
    b1<-data.frame(as.Date(e1$V1, "%d.%m.%Y"), e1$V2)
    b2<-data.frame(as.Date(e2$V1, "%d.%m.%Y"), e2$V2)

    png('./Pictures/compare2.png')
    plot(b1, type='l', ylim=range(b1[2],b2[2]))
    lines(b2)

    dev.off()

General case: not working

    trial_files<-Sys.glob('./Trial7/*.csv')

    lapply(trial_files, read.table)->e
    b<-data.frame(as.Date(e$V1, "%d.%m.%Y"), e$V2)   ## ERR? (1)
    png('./Pictures/compareMany.png')
    plot(b[1], type='l', ylim=range(b[,2]))          ## ERR? (2)
    lines(b[2])                                      ## Not general, have to 
                                                     ## solve 1/2 first

    dev.off()

I find it hard to explain this without Pythonic list-comprehensions so I want:

[data.frame(as.Date(ee$V1, "%d.%m.%Y"), ee$V2) for ee in e]

…now with R, some lapply(...) or how to do this list-comprehension?

  • 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-28T00:03:49+00:00Added an answer on May 28, 2026 at 12:03 am
    b <- lapply(Sys.glob('Trial7/*.csv'), function(file) {
        e <- read.table(file)
        data.frame(as.Date(e$V1, "%d.%m.%Y"), e$V2)
    })
    
    png('./Pictures/compare2.png')
    plot(b[[1]], type='l', ylim=range(b[[1]][[2]],b[[2]][[2]]))
    lines(b[[2]])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read my csv using the line below data = FCSV.table(test.csv, {:quote_char => '',
I have a data set which I read from my a .csv file. After
I generate csv files with fputcsv and it works just fine, but when I
I generate csv files with fputcsv and it works just fine, but when I
I use a generic algorithm to write CSV files that in theory works for
I need to upload a csv file to a server. works fine for smaller
I have an application that allows the user to download a csv. This works
The following code snippet works fine for CSV file sizes larger than 10 K.
Possible Duplicate: how to extract data from csv file in php i'm new on
I am looking for a direct and efficient method to read out csv-files and

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.