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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:03:47+00:00 2026-05-25T20:03:47+00:00

I have a dataset with 11 columns with over a 1000 rows each. The

  • 0

I have a dataset with 11 columns with over a 1000 rows each. The columns were labeled V1, V2, V11, etc..
I replaced the names with something more useful to me using the “c” command.
I didn’t realize that row 1 also contained labels for each column and my actual data starts on row 2.

Is there a way to delete row 1 and decrement?

  • 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-25T20:03:48+00:00Added an answer on May 25, 2026 at 8:03 pm

    Keep the labels from your original file like this:

    df = read.table('data.txt', header = T)
    

    If you have columns named x and y, you can address them like this:

    df$x
    df$y
    

    If you’d like to actually delete the first row from a data.frame, you can use negative indices like this:

    df = df[-1,]
    

    If you’d like to delete a column from a data.frame, you can assign NULL to it:

    df$x = NULL
    

    Here are some simple examples of how to create and manipulate a data.frame in R:

    # create a data.frame with 10 rows
    > x = rnorm(10)
    > y = runif(10)
    > df = data.frame( x, y )
    
    # write it to a file
    > write.table( df, 'test.txt', row.names = F, quote = F )
    
    # read a data.frame from a file: 
    > read.table( df, 'test.txt', header = T )
    
    > df$x
     [1] -0.95343778 -0.63098637 -1.30646529  1.38906143  0.51703237 -0.02246754
     [7]  0.20583548  0.21530721  0.69087460  2.30610998
    > df$y
     [1] 0.66658148 0.15355851 0.60098886 0.14284576 0.20408723 0.58271061
     [7] 0.05170994 0.83627336 0.76713317 0.95052671
    
    > df$x = x
    > df
                y           x
    1  0.66658148 -0.95343778
    2  0.15355851 -0.63098637
    3  0.60098886 -1.30646529
    4  0.14284576  1.38906143
    5  0.20408723  0.51703237
    6  0.58271061 -0.02246754
    7  0.05170994  0.20583548
    8  0.83627336  0.21530721
    9  0.76713317  0.69087460
    10 0.95052671  2.30610998
    
    > df[-1,]
                y           x
    2  0.15355851 -0.63098637
    3  0.60098886 -1.30646529
    4  0.14284576  1.38906143
    5  0.20408723  0.51703237
    6  0.58271061 -0.02246754
    7  0.05170994  0.20583548
    8  0.83627336  0.21530721
    9  0.76713317  0.69087460
    10 0.95052671  2.30610998
    
    > df$x = NULL
    > df 
                y
    1  0.66658148
    2  0.15355851
    3  0.60098886
    4  0.14284576
    5  0.20408723
    6  0.58271061
    7  0.05170994
    8  0.83627336
    9  0.76713317
    10 0.95052671
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In DataSet.Tables[0].Columns[0] we have a DataType property. Now, I would like to iterate over
I have DataSet which has 3 columns. Name - insurance comp. name - treatmentDate
I have a DataSet that contains a few columns. One of these columns is
I have a DataGridView that's bound to a DataSet. It has columns DateCreated, Weight,
I have a data set that is around 700 rows with eight columns of
I have an array of doubles, roughly 200,000 rows by 100 columns, and I'm
Suppose I have 2 tables, each tables has N columns. There are NO duplicate
I have a dataset will a lot of columns. What I need to do
I have a dataset with 119 columns separated by a space and like to
I have a Dataset with a Bunch of Columns used in a Report (DevExpress

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.