Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitddb7865

Browse files
committed
fixed a double import of %>%
1 parentf9d0f94 commitddb7865

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

‎DESCRIPTION‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ License: GPL-3
1010
URL: https://github.com/maxconway/gsheet
1111
BugReports: https://github.com/maxconway/gsheet/issues
1212
Imports: rvest,
13-
stringr
13+
stringr,
14+
magrittr
1415
Suggests: testthat

‎NAMESPACE‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Generated by roxygen2 (4.1.0): do not edit by hand
1+
# Generated by roxygen2 (4.1.1): do not edit by hand
22

33
export(gsheet2tbl)
44
export(gsheet2text)
5-
import(rvest)
6-
import(stringr)
5+
import(magrittr)

‎R/gsheet2text.R‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#' @seealso \code{\link{gsheet2text}} to download as a table
1515
#' @export
1616
#'
17-
#' @import rvest
18-
#' @import stringr
17+
#' @import magrittr
1918
#'
2019
#' @examples
2120
#'
@@ -24,18 +23,18 @@
2423
#' b <- read.csv(text=a)
2524
#'
2625
gsheet2text<-function(url,format='csv',sheetid=NULL){
27-
key<- str_extract(url,'[[:alnum:]_-]{30,}')
28-
if(is.null(sheetid)& str_detect(url,'gid=[[:digit:]]+')){
29-
sheetid<-url %>% str_extract('gid=[[:digit:]]+') %>% str_extract('[[:digit:]]+') %>% as.numeric()
26+
key<-stringr::str_extract(url,'[[:alnum:]_-]{30,}')
27+
if(is.null(sheetid)&stringr::str_detect(url,'gid=[[:digit:]]+')){
28+
sheetid<-url %>%stringr::str_extract('gid=[[:digit:]]+') %>%stringr::str_extract('[[:digit:]]+') %>% as.numeric()
3029
}
3130
address<- paste0('https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=',key,'&exportFormat=',format)
3231
if(!is.null(sheetid)){
3332
address<- paste0(address,'&gid=',sheetid)
3433
}
35-
page<- html(address)
36-
if(page %>% html_nodes('script') %>% length()>0|page %>% html_nodes('style') %>% length()>0){
34+
page<-rvest::html(address)
35+
if(page %>%rvest::html_nodes('script') %>% length()>0|page %>%rvest::html_nodes('style') %>% length()>0){
3736
stop("Unable to retrieve document. Is 'share by link' enabled for this sheet?")
3837
}
39-
content<- html_text(html_node(page,'p'))
38+
content<-rvest::html_text(rvest::html_node(page,'p'))
4039
return(content)
4140
}

‎man/gsheet2tbl.Rd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%Generatedby roxygen2 (4.1.0):donoteditbyhand
1+
%Generatedby roxygen2 (4.1.1):donoteditbyhand
22
%PleaseeditdocumentationinR/gsheet2tbl.R
33
\name{gsheet2tbl}
44
\alias{gsheet2tbl}

‎man/gsheet2text.Rd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%Generatedby roxygen2 (4.1.0):donoteditbyhand
1+
%Generatedby roxygen2 (4.1.1):donoteditbyhand
22
%PleaseeditdocumentationinR/gsheet2text.R
33
\name{gsheet2text}
44
\alias{gsheet2text}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp