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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:05:08+00:00 2026-06-11T07:05:08+00:00

I thought the summary function in R could take character variables given the file

  • 0

I thought the summary function in R could take character variables given the file it points to is numeric. bbb is giving me good results but the summary of aaa is giving me problems.

# Descriptives For Machine.x
for (n in 1:3500){
   machine_name = paste("machine.wt$Machine.", n, sep="")
   aaa = summary (paste("machine.wt$Machine.", n, sep=""))
   bbb = summary (machine.wt$Machine.1)
}

Error in x - mx : non-numeric argument to binary operator
In addition: Warning messages:
1: In mean.default(x, na.rm = na.rm) :
  argument is not numeric or logical: returning NA
2: In var(x, na.rm = na.rm) : NAs introduced by coercion
3: In mean.default(x, na.rm = na.rm, trim = trim) :
  argument is not numeric or logical: returning NA
4: In var(x, na.rm = na.rm) : NAs introduced by coercion
5: In mean.default(x) : argument is not numeric or logical: returning NA

My data is very simple:

Obs.1   Machine.1   Obs.1   Machine.2   Obs.2   Machine.3   Obs.3   Machine.4
1   302.3   1   302.8   1   315.1   1   300.9
2   295.3   2   314.3   2   306.7   2   317.5
3   301.4   3   308.4   3   309.0   3   304.3
4   318.2   4   295.2   4   321.3   4   293.2
5   320.4   5   313.5   5   326.4   5   308.0
  • 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-11T07:05:10+00:00Added an answer on June 11, 2026 at 7:05 am

    How about using subset and grepl to avoid the loop altogether?

    summary(subset(machine.wt,select=grepl("^Machine",names(machine.wt))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought it was a good idea to add some testing to my project,
Summary I want to write a .png file as quickly as possible, without a
I had thought I actually had a pretty good handle on the whole view
Summary: I have a struct that is read/written to file. This struct changes frequently,
Thought my range of search options would easily find this. I wish to combine
I thought I had resolved this but I obviously haven't and was hoping someone
I thought the following script will create div element but I got nothing output
I thought I would be smart and create member functions that accepted output iterators.
I thought this would be fairly simple but it turns out not to work
I thought I'd find more about this topic but I didn't. I have to

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.