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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:50:04+00:00 2026-06-15T16:50:04+00:00

I have x = 1,2,3,4 which is my categorical variable but when I use

  • 0

I have x = 1,2,3,4 which is my categorical variable
but when I use summary() it automatically thinks that this is discrete : so I would get something like this

Min :
1st Qu.:
Median :


But what I want is to give me just the frequency for this variable within the summary()

1:
2:
3:
4:

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-06-15T16:50:05+00:00Added an answer on June 15, 2026 at 4:50 pm
    > x <- seq(1:10)
    
    > summary(as.factor(x))
     1  2  3  4  5  6  7  8  9 10 
     1  1  1  1  1  1  1  1  1  1
    

    Or, if you want to permanently assign x as categorical variable in a dataframe named mydata, do this before the summary() call:

    mydata$x <- factor(mydata$x) 
    

    (Spending an hour or two with any of the many books or online intros to R and typing out the examples is a smart investment and saves a lot of time.)

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

Sidebar

Related Questions

I have a regression model in which the dependent variable is continuous but ninety
Let's say that you have a normally distributed variable y with a 3-group categorical
I have a dataset with a categorical variable hospital_code which has 10 levels. The
I have this class. I would create an array ex. Categoria[] cat in which
Consider the apps that large blogs have (which work pretty much like an RSS
I have button which post values of form to url but during post i
I have UIScrollView which i populate with UIImageViews programmatically. After that I change contentSize
In R, I have 600,000 categorical variables, each of which is classified as "0",
I would like to have which-function-mode on by default when I open up Emacs.
I have a tiny shell in C which does nothing but print Hello, im

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.