Extra Row in Dataframe

Viewed 19

I am attempting to create a dataframe comprised of two vectors.

The two vectors are comprised of SIX elements which were the products of previous steps here they are:

CLsummary<-c(MaxCL, MinCL, MeanCL, MedianCL, RangeCL, SDCL)
PRsummary<-c(MaxPR, MinPR, MeanPR, MedianPR, RangePR, SDPR)

But when I create the data frame, like below, I get SEVEN rows of data:

FHsummary<-data.frame(CLsummary, PRsummary)

Specifically, the fifth row seems to be a duplicate of the MinCL and MinPR data.

What am I doing wrong?

Thank you!

1 Answers

When just replicating your code, making the objects in the vector into strings, the final dataframe is 6 rows as expected. You should take a look at your objects that comprise the vectors. What type are they? How were they made? My guess is that one of the objects in each vector is a vector itself, with two elements.

Related