0

So I want to remove the first row in the data frame. my code is like

reddot.info<-reddot.info[-1,]

But then i find i can not view this data frame. i figure out the reason. because when i run code

reddot.info[1,]

if appears as Num Product_names URL 1 NA Product Names URL which means that if i use this code i will also remove the column names. so what should i do to remove the first row in stead of removing the column names and first row together.

Thank you so much.

1
  • Can you include dput(reddot.info) so that we could understand your problem better ? Commented Feb 24, 2014 at 5:56

1 Answer 1

4

You probably don't have column names to begin with because removing the first row like that doesn't remove the column names.

colnames(reddot.info) <- reddot.info[1,]
reddot.info <- reddot.info[-1,]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.