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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:17:32+00:00 2026-05-17T17:17:32+00:00

Reading the data the following way data<-read.csv(userStats.csv, sep=,, header=F) I tried to select an

  • 0

Reading the data the following way

data<-read.csv("userStats.csv", sep=",", header=F)

I tried to select an element at the specific position.

The example of the data (first five rows) is the following (V2 is the date and V3 is the day of week):

   V1               V2
1 00002781A2ADA816CDB0D138146BD63323CCDAB2                 2010-09-04
2 00002D2354C7080C0868CB0E18C46157CA9F0FD4                 2010-09-04
3 00002D2354C7080C0868CB0E18C46157CA9F0FD4                 2010-09-07
4 00002D2354C7080C0868CB0E18C46157CA9F0FD4                 2010-09-08
5 00002D2354C7080C0868CB0E18C46157CA9F0FD4                 2010-09-17
                              V3 V4 V5          V6 V7 V8          V9
1 Saturday                        2  2         615  1  1          47
2 Saturday                        2  2          77  1  1          43
3 Tuesday                         1  3         201  1  1         117
4 Wednesday                       1  1          44  1  1          74
5 Friday                          1  1           3  1  1          18

I tried to divide 6th column with 9th column in the first row the following way:

data[1,6]/data[1,9]

but it returned an error

[1] NA
Warning message:
In Ops.factor(data[1, 6], data[1, 9]) : / not meaningful for factors

Then I tried to select just one element

> data[2,9]
[1]          43
11685 Levels:            0           1           2           3 ...       55311

but don’t know what these Levels are and what causes an error. Does anyone know how to select an element at the specific position data[row, column]?

Thank you!

  • 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-17T17:17:33+00:00Added an answer on May 17, 2026 at 5:17 pm

    My favorite tool to check variable class is str().

    What you have there is a data frame and at least one of the columns you’re trying to work with is a factor. See Dirk’s answer on how to change classes of a column.

    Command

    data[1,6]/data[1,9]
    

    is selecting the value in the first row of sixth column and dividing with the value in first row of the ninth column. Is this what you want? If you want to use values from the entire column (and not just the first row), you would write

    data[6] / data[9]
    

    or

    data[, 6] / data[, 9]
    

    Both arguments are equivalent for data.frames.

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

Sidebar

Related Questions

Thanks for reading this. I am dynamically generating some data which includes a select
I am using the following method for reading Csv file content: /// <summary> ///
I am reading in log data with the following time stamp format: Sat Aug
When reading data from the Input file I noticed that the ¥ symbom was
I'm reading data from a table( from a MySQL Database) with Hibernate SQL Query.
I'm reading data from a device which measures distance. My sample rate is high
I'm reading XML data from the HttpServletRequest in my servlets doPost() and passing the
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
In an Open Source program I wrote , I'm reading binary data (written by
How much data should be in a table so that reading is optimal? Assuming

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.