Error in `[.data.frame`(x, xok) : undefined columns selected

DV Man

New Member
#1
Here is my data

Code:
vungle <- structure(list(Strategy = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Vungle A", "Vungle B"), class = "factor"), 
    Date = structure(c(1L, 12L, 23L, 25L, 26L, 27L, 28L, 29L, 
    30L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 24L, 1L, 12L, 23L, 
    25L, 26L, 27L, 28L, 29L, 30L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 
    9L, 10L, 11L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 
    22L, 24L), .Label = c("1-Jun-14", "10-Jun-14", "11-Jun-14", 
    "12-Jun-14", "13-Jun-14", "14-Jun-14", "15-Jun-14", "16-Jun-14", 
    "17-Jun-14", "18-Jun-14", "19-Jun-14", "2-Jun-14", "20-Jun-14", 
    "21-Jun-14", "22-Jun-14", "23-Jun-14", "24-Jun-14", "25-Jun-14", 
    "26-Jun-14", "27-Jun-14", "28-Jun-14", "29-Jun-14", "3-Jun-14", 
    "30-Jun-14", "4-Jun-14", "5-Jun-14", "6-Jun-14", "7-Jun-14", 
    "8-Jun-14", "9-Jun-14"), class = "factor"), Impressions = c(6777407L, 
    6004310L, 5832627L, 5875702L, 6843405L, 7790350L, 8643430L, 
    8929848L, 8075571L, 7726694L, 7781497L, 7770595L, 7916282L, 
    8724061L, 9027910L, 7957999L, 8102155L, 8043855L, 8073992L, 
    8085480L, 8760745L, 8884803L, 8040402L, 7882136L, 7782617L, 
    7734447L, 7891063L, 8460726L, 8849803L, 8189490L, 569044L, 
    505963L, 492804L, 498772L, 491463L, 509657L, 564247L, 575302L, 
    523689L, 504636L, 506060L, 505083L, 513106L, 562772L, 586702L, 
    516148L, 526671L, 526713L, 531452L, 420187L, 548116L, 581785L, 
    525631L, 517748L, 511505L, 508097L, 518004L, 562854L, 583732L, 
    537433L), Completes = c(5978434L, 5331727L, 5193549L, 5227917L, 
    6111378L, 6981471L, 7733750L, 7993169L, 7259148L, 6941293L, 
    6999630L, 6984082L, 7091841L, 7782877L, 8075018L, 7149399L, 
    7283722L, 7229427L, 7226473L, 7224975L, 7825166L, 7937481L, 
    7182500L, 7013876L, 6932529L, 6887125L, 7025318L, 7487623L, 
    7785905L, 7233880L, 499235L, 447695L, 437495L, 442791L, 436858L, 
    454702L, 502016L, 512228L, 469082L, 452753L, 454773L, 452687L, 
    458354L, 499196L, 522522L, 462646L, 471763L, 471137L, 472466L, 
    373085L, 485150L, 515575L, 466427L, 455814L, 451388L, 448333L, 
    457335L, 494686L, 510194L, 470054L), Clicks = c(345309L, 
    299732L, 291384L, 295099L, 339529L, 392987L, 444682L, 449680L, 
    392829L, 382769L, 389369L, 391254L, 407582L, 459952L, 465869L, 
    395612L, 404716L, 407014L, 403193L, 406766L, 454646L, 453647L, 
    401226L, 389975L, 385477L, 388935L, 409449L, 457487L, 478901L, 
    411884L, 28035L, 24621L, 24070L, 25023L, 24337L, 25223L, 
    28127L, 28200L, 25075L, 24414L, 24637L, 24879L, 26018L, 29088L, 
    29163L, 24635L, 25325L, 25761L, 25361L, 20629L, 27480L, 28701L, 
    25462L, 24808L, 24894L, 25111L, 25832L, 28491L, 29483L, 26669L
    ), Installs = c(31119L, 24601L, 24220L, 23382L, 27725L, 31820L, 
    38119L, 38260L, 32825L, 31609L, 31683L, 30985L, 31679L, 36773L, 
    37701L, 31098L, 31359L, 32414L, 31665L, 30473L, 33178L, 33543L, 
    28864L, 30302L, 30369L, 30920L, 31689L, 34664L, 36467L, 32160L, 
    2111L, 1713L, 1705L, 1801L, 1875L, 1932L, 2221L, 2203L, 1950L, 
    1914L, 1839L, 1812L, 1893L, 2076L, 2097L, 1805L, 1786L, 1912L, 
    1740L, 1360L, 1668L, 1816L, 1618L, 1715L, 1725L, 1773L, 1852L, 
    2041L, 2168L, 1910L), eRPM = c(3.33, 2.94, 3.03, 2.99, 3.08, 
    3.14, 3.32, 3.27, 3.15, 3.24, 3.2, 3.21, 3.25, 3.48, 3.47, 
    3.25, 3.32, 3.46, 3.58, 3.48, 3.48, 3.46, 3.34, 3.33, 3.37, 
    3.53, 3.67, 3.83, 3.78, 3.48, 2.95, 2.59, 2.76, 3, 3.24, 
    3.43, 3.44, 3.46, 3.27, 3.39, 3.37, 3.32, 3.49, 3.53, 3.34, 
    3.3, 3.33, 3.6, 3.85, 3.89, 3.69, 3.64, 3.6, 3.42, 3.41, 
    3.72, 3.94, 4.07, 4.05, 3.69)), .Names = c("Strategy", "Date", 
"Impressions", "Completes", "Clicks", "Installs", "eRPM"), class = "data.frame", row.names = c(NA, 
-60L))
I am trying to use a paired T-Test on Strategy A and B with the variable "eRPM" in both, using the following code:

Code:
A <- filter(vungle, Strategy == "Vungle A") %>%
	select(Strategy, eRPM)

B <- filter(vungle, Strategy == "Vungle B", eRPM) %>%
	select(Strategy, eRPM)
I then did a T-Test on it with this code with the following error

Code:
> t.test(A, B, paired = TRUE)
Error in `[.data.frame`(x, xox) : undefined columns selected
I then tried this:

Code:
> A <- A[,1]
Error in `[.default`(A, , 1) : incorrect number of dimensions
> B <- B[,1]
Error in `[.default`(B, , 1) : incorrect number of dimensions
But to no luck. Does anyone know how I can do this T-Test?
 

DV Man

New Member
#2
Oh yeah, I got the original error in the title, but it went away when I couldn't even do

Code:
A <- [A,1]
so you can disregard the title. The actual errors are in my original post
 

DV Man

New Member
#3
I think I figured it out. I shouldn't have selected "Strategy"

Code:
> A <- filter(vungle, Strategy == "Vungle A") %>%
+ 	select(eRPM)
> B <- filter(vungle, Strategy == "Vungle B", eRPM) %>%
+ 	select(eRPM)

> A <- A[,1]
> B <- B[,1]
> t.test(A, B, paired = TRUE)

	Paired t-test

data:  A and B
t = -3.2837, df = 29, p-value = 0.002677
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.17959566 -0.04173767
sample estimates:
mean of the differences 
             -0.1106667