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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:52:52+00:00 2026-06-15T04:52:52+00:00

I have a strange issue with subset : it doesn’t recognize the variables in

  • 0

I have a strange issue with subset: it doesn’t recognize the variables in my dataframe.

For example, if I want a summary of the variable v1 in the dataframe DF, I get:

summary(DF$v1)

 Min.    1st Qu. Median  Mean   3rd Qu. Max
-123.00  4.00    14.00   84.62  49.00   13140.00 

Now, this variable should always be non-negative, so I want to inspect the negative values by subsetting the dataframe DF into the dataframe PROBS. But if I try this:

PROB <- subset[DF, v1 < 0]

I get:

Error: object "v1" not found

I am positive that I am not misspelling this variable name. I have tried with other variables in this dataframe, but it keeps throwing this error at me.

Does anyone have any idea about the reason for such a strange behaviour? I have never had any problem with the subset function!

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-15T04:52:54+00:00Added an answer on June 15, 2026 at 4:52 am

    Subset is a function, so you should use subset(DF, v1 < 0) instead of the square brackets.

    Square brackets are used for subsetting dataframes or matrices directly. subset[DF, v1 < 0] is trying to subset the subset function by looking for the variable v1 within the scope of the subset object. The object subset is a function, so it can’t find the v1 object.

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

Sidebar

Related Questions

I have a strange issue when adding items to a listbox. I want it
I have a strange issue. I'm trying to get Apple Push Notifications working with
I have a strange issue with a MVC 3 app running as an Azure
I have a strange issue . I am currently working on a mail app
i have a strange issue with phpexcel on a pair of formulas and can't
I have a strange issue: When I scroll vertically it triggers swipe right/left events.
I have a strange issue (at least for me :)) with the MySQL's locking
I have a strange issue that has arisen recently: Whenever I enter text, even
I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have a strange issue with eclipse. When I put a .xls file in

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.