File tree Expand file tree Collapse file tree 2 files changed +27
-33
lines changed Expand file tree Collapse file tree 2 files changed +27
-33
lines changed Original file line number Diff line number Diff line change @@ -112,15 +112,7 @@ test_that("error conditions", {
112
112
trade ~ log_dist | rta ,
113
113
data = list ()
114
114
),
115
- " 'data' has to be of class data.frame"
116
- )
117
-
118
- expect_error(
119
- fepoisson(
120
- trade ~ log_dist | rta ,
121
- data = list ()
122
- ),
123
- " 'data' has to be of class data.frame"
115
+ " length zero"
124
116
)
125
117
126
118
expect_error(
Original file line number Diff line number Diff line change @@ -50,30 +50,32 @@ test_that("fepoisson is similar to fixest", {
50
50
# unique(trade_panel$year)
51
51
trade_panel_2006 <- trade_panel [trade_panel $ year == 2006 , ]
52
52
53
- t_fepoisson <- rep(0 ,10 )
54
- for (i in 1 : 10 ) {
55
- t1 <- Sys.time()
56
- fit <- fepoisson(
57
- trade ~ log_dist + lang + cntg + clny | exp_year + imp_year ,
58
- trade_panel_2006
59
- )
60
- t2 <- Sys.time()
61
- t_fepoisson <- t2 - t1
62
- }
63
- t_fepoisson <- median(t_fepoisson )
53
+ if (identical(Sys.info()[[' user' ]], ' pacha' )) {
54
+ t_fepoisson <- rep(0 ,10 )
55
+ for (i in 1 : 10 ) {
56
+ t1 <- Sys.time()
57
+ fit <- fepoisson(
58
+ trade ~ log_dist + lang + cntg + clny | exp_year + imp_year ,
59
+ trade_panel_2006
60
+ )
61
+ t2 <- Sys.time()
62
+ t_fepoisson <- t2 - t1
63
+ }
64
+ t_fepoisson <- median(t_fepoisson )
64
65
65
- t_glm <- rep(0 ,10 )
66
- for (i in 1 : 0 ) {
67
- t1 <- Sys.time()
68
- fit <- suppressWarnings(glm(
69
- trade ~ log_dist + lang + cntg + clny + as.factor(exp_year ) + as.factor(imp_year ),
70
- trade_panel_2006 ,
71
- family = poisson(link = " log" )
72
- ))
73
- t2 <- Sys.time()
74
- t_glm <- t2 - t1
75
- }
76
- t_glm <- median(t_glm )
66
+ t_glm <- rep(0 ,10 )
67
+ for (i in 1 : 0 ) {
68
+ t1 <- Sys.time()
69
+ fit <- suppressWarnings(glm(
70
+ trade ~ log_dist + lang + cntg + clny + as.factor(exp_year ) + as.factor(imp_year ),
71
+ trade_panel_2006 ,
72
+ family = poisson(link = " log" )
73
+ ))
74
+ t2 <- Sys.time()
75
+ t_glm <- t2 - t1
76
+ }
77
+ t_glm <- median(t_glm )
77
78
78
- expect_lte(t_fepoisson , t_glm )
79
+ expect_lte(t_fepoisson , t_glm )
80
+ }
79
81
})
You can’t perform that action at this time.
0 commit comments