Skip to content

Commit 9b521e1

Browse files
author
dgrtwo
committed
Fixes for CRAN submission; added globals.R to avoid notes, changed description to title case, added README.md and man-roxygen to .Rbuildignore.
1 parent dbc7405 commit 9b521e1

File tree

9 files changed

+34
-10
lines changed

9 files changed

+34
-10
lines changed

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
3+
^NEWS\.md$
4+
^man-roxygen$
5+
cran-comments.md

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.RData
55
vignettes/*cache
66
inst/doc
7+
cran-comments.md

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: broom
22
Type: Package
3-
Title: Convert statistical analysis objects from R into tidy format
3+
Title: Convert Statistical Analysis Objects Into Tidy Data Frames
44
Version: 0.3.4
55
Date: 2014-09-11
66
Authors@R: as.person(c(
@@ -10,7 +10,7 @@ Authors@R: as.person(c(
1010
"Hadley Wickham <hadley@rstudio.com> [ctb]"
1111
))
1212
Maintainer: David Robinson <admiral.david@gmail.com>
13-
Description: Convert statistical analysis objects from R into tidy format,
13+
Description: Convert statistical analysis objects from R into tidy data frames,
1414
so that they can more easily be combined, reshaped and otherwise processed
1515
with tools like dplyr, tidyr and ggplot2. The package provides three S3
1616
generics: tidy, which summarizes a model's statistical findings such as

NEWS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
broom 0.3.4
22
-----------
33

4-
* The behavior of `augment`, particularly with regard to missing data and the `na.exclude` argument, has through the use of the \code{augment_columns} function been made consistent across the following models:
4+
* The behavior of `augment`, particularly with regard to missing data and the `na.exclude` argument, has through the use of the `augment_columns` function been made consistent across the following models:
55
* `lm`
66
* `glm`
77
* `nls`
@@ -18,7 +18,9 @@ broom 0.3.4
1818

1919
See `?rowwise_df_tidiers` for more.
2020
* Added `tidy` and `glance` methods for `Arima` objects, and `tidy` for `pairwise.htest` objects.
21-
* This is the version originally submitted to CRAN.
21+
* Fixes for CRAN: change package description to title case, removed NOTES, mostly by adding `globals.R` to declare global variables.
22+
* This is the original version published on CRAN.
23+
2224

2325
broom 0.3
2426
---------

R/felm_tidiers.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ tidy.felm <- function(x, conf.int=FALSE, conf.level=.95, fe = FALSE, fe.error =
7171

7272
if (fe){
7373
ret <- mutate(ret, N = NA, comp = NA)
74-
object <- getfe(x)
74+
object <- lfe::getfe(x)
7575
if (fe.error){
7676
nn <- c("estimate", "std.error", "N", "comp")
77-
ret_fe <- getfe(x, se = TRUE, bN = 100) %>%
77+
ret_fe <- lfe::getfe(x, se = TRUE, bN = 100) %>%
7878
select(effect, se, obs, comp) %>%
7979
fix_data_frame(nn) %>%
8080
mutate(statistic = estimate/std.error) %>%
8181
mutate(p.value = 2*(1-pt(statistic, df = N)))
8282
} else{
8383
nn <- c("estimate", "N", "comp")
84-
ret_fe <- getfe(x) %>%
84+
ret_fe <- lfe::getfe(x) %>%
8585
select(effect, obs, comp) %>%
8686
fix_data_frame(nn) %>%
8787
mutate(statistic = NA, p.value = NA)
@@ -124,7 +124,7 @@ augment.felm <- function(x, data = NULL, ...) {
124124
y <- eval(x$call$formula[[2]], envir = data)
125125
data$.fitted <- x$fitted.values
126126
data$.resid <- x$residuals
127-
object <- getfe(x)
127+
object <- lfe::getfe(x)
128128
if (!is.null(object)){
129129
fe_list <- levels(object$fe)
130130
object <- object %>% mutate(effect = as.numeric(effect))%>% mutate(fe = as.character(fe))

R/globals.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
globalVariables(c(".", "estimate", "std.error", "statistic", "term", "p.value",
2+
"effect", "se", "objs", "comp", "N", "lambda", "GCV", "obs",
3+
".id", "level", "group1", "group2", "series", "value",
4+
"index"))

R/rowwise_df_tidiers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wrap_rowwise_df_ <- function(func) {
1919

2020
wrap_rowwise_df <- function(func) {
2121
function(x, data, ...) {
22-
n <- tidyr:::col_name(substitute(data), "object")
22+
n <- col_name(substitute(data))
2323
func(x, n, ...)
2424
}
2525
}

R/sp_tidiers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tidy.SpatialPolygonsDataFrame <- function(x, region = NULL, ...) {
3737
require("maptools")
3838

3939
# Union together all polygons that make up a region
40-
unioned <- unionSpatialPolygons(cp, attr[, region])
40+
unioned <- maptools::unionSpatialPolygons(cp, attr[, region])
4141
coords <- tidy(unioned)
4242
coords$order <- 1:nrow(coords)
4343
}

R/utilities.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,17 @@ inflate <- function(.data, ..., stringsAsFactors = FALSE) {
257257
ret
258258
}
259259

260+
261+
# utility function from tidyr::col_name
262+
col_name <- function (x, default = stop("Please supply column name", call. = FALSE))
263+
{
264+
if (is.character(x))
265+
return(x)
266+
if (identical(x, quote(expr = )))
267+
return(default)
268+
if (is.name(x))
269+
return(as.character(x))
270+
if (is.null(x))
271+
return(x)
272+
stop("Invalid column specification", call. = FALSE)
273+
}

0 commit comments

Comments
 (0)