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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:30:02+00:00 2026-06-14T04:30:02+00:00

I have just started using R not long ago, as a replacement for Excel.

  • 0

I have just started using R not long ago, as a replacement for Excel. The databases I deal with are very large and I needed a new tool to work better with them. I’ve managed to find a lot of answers on this website about R, which have helped me build my scripts, but was unable to find anything conclusive for one particular type of analysis.

My data looks like this:

Col1   Col2     Col3    ... Col50  

 M    18-24     Single  ... Employed

 F    18-24     Married ... Unemployed

 F    Under 18  Single  ... Employed

Usually the databases I deal with have got even 100,000 rows and 30 – 70 columns and usually there are not more than 20 unique values per column

What I want is an subset output that will give me the frequency counts for each unique
value in each column :

Col1

Variable name / F / M

Frequency / 2 / 1

.....

Col50

Variable name / Employed / Un-employed

Frequency /  2 / 1

Can anybody at least give me a hint of what I should be looking for to count those categorical values. Do I need a special package or something? I was able to find some functions that count values, but they only refer to numerical values (like the "table()function".

David Rogers

  • 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-14T04:30:03+00:00Added an answer on June 14, 2026 at 4:30 am

    table sounds like what you want. It will give you the number of occurrences of each value. To easily apply table to each column we can just use lapply

    lapply(your_data, table)
    # Example use and output
    lapply(mtcars, table)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using RSpec and I copied the very simple test on
I have just started using Boost 1.36. These libraries would be very useful in
we have just started using a git account of our Django website project so
I have just started using flexigrid and wanted to use the resource string to
I have just started using android, and have about 5 layout files finished. However,
i have just started using Moq ver (3.1) and i have read blogs and
I have just started using jQuery and although following code gets the job done,
I have just started using the Data Access Application Block from microsoft. There are
I have just started using C2DM. I prefer to send REGISTRATION intent only once
I have just started using Vim in a terminal (PuTTY or MinTTY), after always

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.