Skip to content

Commit 4596170

Browse files
committed
submit to CRAN
1 parent a5a0602 commit 4596170

File tree

9 files changed

+38
-104
lines changed

9 files changed

+38
-104
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ README.md
99
^docs$
1010
^pkgdown$
1111
^\.github$
12+
^cran-comments\.md$
13+
^CRAN-SUBMISSION$

CRAN-SUBMISSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 2.1-2
2+
Date: 2024-10-08 02:54:14 UTC
3+
SHA: a5a0602be1ac6934e0e3b8e7ae0c36c5b35f47f2

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: gtfs2gps
33
Title: Converting Transport Data from GTFS Format to GPS-Like Records
4-
Version: 2.1-1
4+
Version: 2.1-2
55
Authors@R: c(person(given="Rafael H. M.", family="Pereira", email="[email protected]", role="aut", comment = c(ORCID = "0000-0003-2125-7465")),
66
person(given="Pedro R.", family="Andrade", email="[email protected]", role=c("aut", "cre"), comment = c(ORCID = "0000-0001-8675-4046")),
77
person(given="Joao", family="Bazzo", role="aut", comment = c(ORCID = "0000-0003-4536-5006")),

NEWS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* Minor changes
66
* puts package back on CRAN
77
* remove {magrittr} from Suggests
8-
* Clarifies in the documentation of the parameter `ncores` is , by default, all available cores minus one. closes #271
9-
8+
* Clarifies in the documentation the default behavior of the parameter `ncores`. closes #271. When `parallel = FALSE`, this argument is ignored. When `parallel = TRUE`, then by default the function uses all available cores minus one.
109

1110
# gtfs2gps v2.1-1
1211

R/gtfs2gps.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#' strategy "multisession" internally.
2222
#' Note that it is possible to create your own plan before calling gtfs2gps().
2323
#' In this case, do not use this argument.
24-
#' @param ncores Number of cores to be used in parallel execution. If parallel is
25-
#' FALSE then this argument is ignored. By Default, the function uses all
26-
#' available cores minus one.
24+
#' @param ncores Number of cores to be used in parallel execution. When
25+
#' `parallel = FALSE`, this argument is ignored. When `parallel = TRUE`,
26+
#' then by default the function uses all available cores minus one.
2727
#' @param strategy This argument is deprecated. Please use argument plan instead or
2828
#' use future::plan() directly.
2929
#' @param filepath Output file path. As default, the output is returned when gtfs2gps finishes.

cran-comments.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## R CMD check results
2+
3+
── R CMD check results ─────────────────────────────────── gtfs2gps 2.1-2 ────
4+
Duration: 4m 47.5s
5+
6+
0 errors ✔ | 0 warnings ✔ | 0 notes ✔
7+
8+
* The package was removed from CRAN because it depends on another package {gtfstools} that had been removed from CRAN. The {gtfstools} package has been restablished on CRAN, so this submission is intented to restablish {gtfs2gps} on CRAN.
9+
* In addition to that, this version fixes a couple minor issues, namely:
10+
* removes {magrittr} from Suggests
11+
* Clarifies in the documentation the default behavior of the parameter `ncores`. closes #271. When `parallel = FALSE`, this argument is ignored. When `parallel = TRUE`, then by default the function uses all available cores minus one.
12+

man/gtfs2gps.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_gps_as_sflinestring.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test_that("gps_as_sflinestring", {
2020
# -----
2121
# test to fix NA values
2222
gps <- read_gtfs(system.file("extdata/poa.zip", package="gtfs2gps")) |>
23-
gtfstools::filter_by_shape_id(.,"176-1") |>
23+
gtfstools::filter_by_shape_id("176-1") |>
2424
filter_single_trip() |>
2525
gtfs2gps() |>
2626
adjust_speed() |>

tests_rafa/test_rafa.R

Lines changed: 12 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,6 @@ library(gtfs2gps)
1616
devtools::document(pkg = ".")
1717

1818

19-
# calculate Distance between successive points
20-
new_stoptimes[ , dist := geosphere::distGeo(matrix(c(shape_pt_lon, shape_pt_lat), ncol = 2),
21-
matrix(c(data.table::shift(shape_pt_lon, type="lag"), data.table::shift(shape_pt_lat, type="lag")), ncol = 2))/1000]
22-
23-
24-
25-
26-
#### SPEED
27-
poa <- read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps"))
28-
29-
system.time(poa_gps <- gtfs2gps(poa))
30-
user system elapsed
31-
9.34 0.15 9.67
32-
7.59 0.15 7.73
33-
7.15 0.36 7.51
34-
35-
spo <- read_gtfs(system.file("extdata/saopaulo.zip", package = "gtfs2gps"))
36-
system.time(spo_gps <- gtfs2gps(spo))
37-
user system elapsed
38-
79.97 1.71 82.67
39-
79.31 1.68 81.69
40-
77.51 1.37 80.29
41-
##### INPUT ------------------------
42-
# normal
43-
gtfsn <- './inst/extdata/poa.zip'
44-
# freq based
45-
gtfsf <- './inst/extdata/saopaulo.zip'
46-
47-
emtu <- "R:/Dropbox/bases_de_dados/GTFS/SP GTFS/GTFS EMTU_20190815.zip"
48-
49-
50-
##### TESTS normal fun ------------------------
51-
# normal data
52-
system.time( normal <- gtfs2gps_dt_parallel2(emtu) ) # 61.55 secs
53-
54-
# freq data
55-
system.time( normfreq <- gtfs2gps_dt_parallel(gtfsf) ) # 130.50 secs
56-
5719

5820
##### Coverage ------------------------
5921

@@ -294,77 +256,33 @@ devtools::check(pkg = ".", cran = TRUE, env_vars = c(NOT_CRAN = "false"))
294256

295257

296258

297-
# build binary ----------------
298-
system("R CMD build . --resave-data") # build tar.gz
299-
system("R CMD build gtfs2gps --resave-data") # build tar.gz
300-
# devtools::build(pkg = "gtfs2gps", path=".", binary = TRUE, manual=TRUE)
301-
302-
# Check package errors
303-
# devtools::check("gtfs2gps")
304-
system("R CMD check gtfs2gps_1.0.tar.gz")
305-
system("R CMD check --as-cran gtfs2gps_1.0-0.tar.gz")
306-
307-
308-
309-
310-
311-
312-
313259

314260

315261

316262

317-
a <- all_feeds[[1]]$stops$stop_id
318263

319-
b <- all_feeds[[2]]$stops$stop_id
320264

321265

322-
intersect(a,b, a)
323266

324-
Reduce(intersect, list(a,b,c))
325267

268+
##### website ----------------------
269+
library(pkgdown)
270+
library(usethis)
326271

327-
all_feeds[[c(1,2)]]$stops$stop_id
328-
329-
330-
331-
spo <- system.file("extdata/saopaulo.zip", package = "gtfs2gps")
332-
poa <- system.file("extdata/poa.zip", package = "gtfs2gps")
333-
gtfs_list <- list(spo, poa)
334-
335-
# read all feeds
336-
all_feeds <- lapply(gtfs_list, read_gtfs)
337-
338-
339-
##### STOPS ----------------------
340-
341-
# extract stops from all GTFS feeds
342-
stops <- sapply(all_feeds, "[", 'stops')
343-
344-
# extract stop ids
345-
stop_ids <- sapply(stops, "[[", 'stop_id')
346-
347-
# check inersection between ids
348-
output_intersect <- Reduce(intersect, stop_ids)
272+
pkgdown::build_site()
349273

350-
# if there is any overlap
351-
if( length(output_intersect) = 0){
352-
stops <- rbindlist(stops, fill = T)
353-
}
354274

355275

356276

357277

358-
for(i in 1:length(agency_ids)){
359-
stop_ids[i] <- sprintf("%s_%s", agency_ids[[i]], stop_ids[[i]])
360-
# route_ids[i] <- sprintf("%s_%s", agency_ids[[i]], route_ids[[i]])
361-
# trip_ids[i] <- sprintf("%s_%s", agency_ids[[i]], trip_ids[[i]])
362-
# ...
363-
}
278+
# submit to CRAN -----------------
279+
usethis::use_cran_comments('teste 2222, , asdadsad')
364280

281+
urlchecker::url_check()
282+
devtools::check(remote = TRUE, manual = TRUE)
283+
devtools::check_win_release()
284+
devtools::check_mac_release()
285+
rhub::check_for_cran(show_status = FALSE)
365286

366-
##### website ----------------------
367-
library(pkgdown)
368-
library(usethis)
369287

370-
pkgdown::build_site()
288+
devtools::submit_cran()

0 commit comments

Comments
 (0)