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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:19+00:00 2026-05-25T13:29:19+00:00

I am creating a simple data frame like this: qcCtrl <- data.frame(2D6=DNS00012345, 3A4=DNS000013579) My

  • 0

I am creating a simple data frame like this:

qcCtrl <- data.frame("2D6"="DNS00012345", "3A4"="DNS000013579")

My understanding is that the column names should be “2D6” and “3A4”, but they are actually “X2D6” and “X3A4”. Why are the X’s being added and how do I make that stop?

  • 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-25T13:29:20+00:00Added an answer on May 25, 2026 at 1:29 pm

    I do not recommend working with column names starting with numbers, but if you insist, use the check.names=FALSE argument of data.frame:

    qcCtrl <- data.frame("2D6"="DNS00012345", "3A4"="DNS000013579", 
                check.names=FALSE)
    qcCtrl
    
              2D6          3A4
    1 DNS00012345 DNS000013579
    

    One of the reasons I caution against this, is that the $ operator becomes more tricky to work with. For example, the following fails with an error:

    > qcCtrl$2D6
    Error: unexpected numeric constant in "qcCtrl$2"
    

    To get round this, you have to enclose your column name in back-ticks whenever you work with it:

    > qcCtrl$`2D6`
    [1] DNS00012345
    Levels: DNS00012345
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple API that creates typed classes based on JSON data that
I am creating a simple REST API that outputs JSON data. However I am
I'm creating a simple device that sends data to a Windows PC over serial
When creating a simple object hierarchy in Python, I'd like to be able to
I'm creating a simple tag system that allows me to link a tag to
I am creating a simple application with Django. I realized that I am doing
I've been charged with creating a simple data source so clients can retrieve a
I'm creating a simple Hack2 app, and I can read body data with: directory
I am creating a simple form. I would like to use embedded javascript to
I'm creating a simple BizTalk 2010 process that will convert a 4010 835 file

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.