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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:59:01+00:00 2026-06-09T06:59:01+00:00

Please download the file into your computer,and run : http://freeuploadfiles.com/bb3cwypih2d2 data=read.table(path/to/file, sep=|,quote=”, head=T,blank.lines.skip=T,as.is=T) ddata=array(data,dim=c(nrow(data),ncol(data)))

  • 0

Please download the file into your computer,and run :
http://freeuploadfiles.com/bb3cwypih2d2

data=read.table("path/to/file", sep="|",quote='',
       head=T,blank.lines.skip=T,as.is=T)
ddata=array(data,dim=c(nrow(data),ncol(data)))
ddata[1,1]

I want to extract the first element of the first column. The answer should be AAC.

How do I do that?

  • 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-09T06:59:03+00:00Added an answer on June 9, 2026 at 6:59 am

    Some suggestions to clean your code and make life easier in the long term:

    1. Work with the data in a data.frame, not an array.
    2. Never refer to TRUE as T. TRUE is a reserved word that can never be redefined, whereas T can take any value, including FALSE
    3. Use the <- symbol for assignment
    4. Don’t use abbreviate argument names. The arguement is header, not head. This might bite you

    Arrays can only contain a single class of object. Thus converting your data to array will implicitly convert the numeric column to character, which surely is a bad thing.

    You then index the data frame like this:

    dat <- read.table("nasdaqlisted.txt", sep="|", quote='',
                       header=TRUE, blank.lines.skip=TRUE, as.is=TRUE)
    
    dat$Symbol[1]
    [1] "AAC"
    

    The following alternative ways of indexing also return the same element:

    dat[1, "Symbol"]
    dat[1, 1]
    dat[, 1][1]
    dat[["Symbol"]][1]
    

    If you really want to do the foolish thing and convert your data to an array, then use matrix:

    mdat <- as.matrix(dat)
    mdat[1, 1]
    Symbol 
     "AAC" 
    

    Disclaimer: I only post this since you ask. Arrays and matrices are powerful and fast, but not appropriate for this data.

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

Sidebar

Related Questions

please download the file in the https://www.box.com/s/z3tldpdykhppmivfexjl ,save it as '/tmp/mydata' and run the
Please download the following code : http://media.pragprog.com/titles/eband3/code/Sudokuv2/src/org/example/sudoku/PuzzleView.java In the code, What initial value does
My PHP knowledge is limited and I am trying to implement http://www.tutorialchip.com/php-download-file-script/ this script
How can I add custom components into loadUI please? I want to download the
I am using a HTTP handler to raise a file download.Basically code in the
ok so I am trying to parse XML data into a table, this is
Please help me somebody to convert unicodestring into string This is how i am
Please see demo here: http://jsfiddle.net/mA6qm/1/ (expand console) Why aren't events being sent or received
I have this file (warning: potentially unsafe file download site) that I need to
It took me FOREVER to finally find code that can download a doc file

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.