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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:48:28+00:00 2026-06-16T23:48:28+00:00

I have a piece of script as below: temp <- getURL(http://chart.yahoo.com/table.csv?s=^HSI&a=0&b=01&c=1900&d=0&e=07&f=2013&g=d&q=q&y=0&z=^HSI&x=.csv,.opts=opts) write(temp,file=test.txt) temp <-

  • 0

I have a piece of script as below:

temp <- getURL("http://chart.yahoo.com/table.csv?s=^HSI&a=0&b=01&c=1900&d=0&e=07&f=2013&g=d&q=q&y=0&z=^HSI&x=.csv",.opts=opts)
write(temp,file="test.txt")
temp <- read.csv("test.txt")

I hate saving it as a txt before import it again as a dataframe, I have heard something like connection, can I skip this “write and load” process?

  • 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-16T23:48:29+00:00Added an answer on June 16, 2026 at 11:48 pm

    Another answer shows how to do this in one step by providing a URL to read.csv, the more general case of reading from any text string uses the textConnection function:

    > data = read.csv(textConnection("A,B,C\n4,5,6\n99,5,4"))
    > data
       A B C
    1  4 5 6
    2 99 5 4
    

    With your web page example, this becomes:

    > data = read.csv(textConnection(getURL("http://chart.yahoo.com/table.csv?s=^HSI&a=0&b=01&c=1900&d=0&e=07&f=2013&g=d&q=q&y=0&z=^HSI&x=.csv")))
    > head(data)
            Date     Open     High      Low    Close     Volume Adj.Close
    1 2013-01-04 23370.36 23370.36 23172.28 23331.09 1505752800  23331.09
    2 2013-01-03 23390.54 23400.74 23234.43 23398.60 2211207000  23398.60
    3 2013-01-02 22860.25 23317.39 22860.25 23311.98 2129252800  23311.98
    4 2012-12-31 22584.44 22698.33 22566.89 22656.92  685413000  22656.92
    5 2012-12-28 22706.33 22706.33 22628.46 22666.59 1043816200  22666.59
    6 2012-12-27 22705.46 22718.83 22608.60 22619.78 1053372600  22619.78
    

    but obviously that’s better done with read.csv("http:/...etc").

    See help(connection) for more.

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

Sidebar

Related Questions

I have this piece of code below: <html> <head> <link href=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css rel=stylesheet type=text/css/> <script
Hello everyone Masters Of Web Delevopment :) I have a piece of PHP script
I have this piece of script : #!/usr/bin/perl use strict; use warnings; use Data::Dumper;
I have a question about Perl from the script below. If the input for
I have a piece of shell code run.sh like below: #!/bin/sh PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH export LD_LIBRARY_PATH=../../lib
Requirement : I have a piece of code similar to the code below. I
In javascript suppose you have this piece of code: <div> <script type=text/javascript>var output =
Below I have a piece of code where it is suppose to display 2
I have the below java script function in which I want to redirect the
I have some PHP script querying a mysql database and echoing out a piece

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.