R not recognizing first data point


This is the code I am using while having my data copied,

control<-read.table( pipe("pbpaste"),header=FALSE)

however, this is the data it keeps outputting,

> control
  control X30
1 control  36
2 control  66
3 control  21
4 control  63
5 control  38
6 control  35
7 control  45

The correct data is

control 30
control 36
control 66
control 21
control 63
control 38
control 35
control 45

How do I get it to stop adding the X and consider the first row a data point?


What does pipe("pbpaste") look like? It's hard to diagnose why read.rable() is doing that without being able to see what you're trying to have it read.


Hi, and welcome to community.rstudio.com! Without knowing what your data looks like, it's a little hard to answer your question. To help you get the right help for your question, can you please turn it into a reprex (reproducible example)? This will ensure we're all looking at the same data and code. A guide for creating a reprex can be found here.

I suspect there may be something about the way your data is formatted that's causing the output you see.