r googlesheets package Waiting for authentication in browser - r

I installed the googlesheets package and
code:
gs_auth()
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
The browser pop up in a blank website, it is not go to the google auth page.
Below is my session_info():
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.1
Matrix products: default
BLAS:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] googlesheets_0.2.2 Rcpp_0.12.14 ggplot2_2.2.1
quantmod_0.4-11
[5] TTR_0.23-2 xts_0.10-0 zoo_1.8-0
dplyr_0.7.4
[9] data.table_1.10.4-3 bindrcpp_0.2
alphavantager_0.1.0.9000 devtools_1.13.4
loaded via a namespace (and not attached):
[1] cellranger_1.1.0 compiler_3.4.2 git2r_0.19.0 plyr_1.8.4
bindr_0.1
[6] tools_3.4.2 digest_0.6.12 jsonlite_1.5 memoise_1.1.0
tibble_1.3.4
[11] gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.1 rlang_0.1.4
curl_3.0
[16] xml2_1.1.1 withr_2.1.0 httr_1.3.1 stringr_1.2.0
knitr_1.17
[21] hms_0.4.0 grid_3.4.2 glue_1.2.0 R6_2.2.2
purrr_0.2.4
[26] readr_1.1.1 magrittr_1.5 scales_0.5.0
assertthat_0.2.0 colorspace_1.3-2
[31] httpuv_1.3.5 stringi_1.1.6 openssl_0.9.9 lazyeval_0.2.1
munsell_0.4.3
I have checked my httr package is updated, so I have not idea where the problem is. please advice.
Thanks.

Per the R help for gs_auth(), this function is not typically called directly by end users. Instead, it is called by other functions in the googlesheets package when they need to authenticate with Google.
Instead, if you try to get a list of worksheets from a Google account, it will ask you to authenticate with a Google account. For example:
mySheetList <- gs_ls()
...will initiate a login sequence that asks you to cut & paste an authentication URL into your web browser. Subsequent steps generate a token that is pasted back into the R console to authenticate.
Details including screen shots on how to authenticate Google Sheets may be found in the Working with Google Sheets section of my article Running R and RStudio on a Chromebook.
Here is an R console log including sessionInfo() illustrating the packages and versions used.
> library(googlesheets)
> theSheetList <- gs_ls()
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
> theSheetList
# A tibble: 1 x 10
sheet_title author perm version updated sheet_key
<chr> <chr> <chr> <chr> <dttm> <chr>
1 PokemonStats greskilabs rw new 2017-07-08 22:40:15 13rGxY7S…
# ... with 4 more variables: ws_feed <chr>, alternate <chr>, self <chr>, alt_key <chr>
>
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] googlesheets_0.2.2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 dplyr_0.7.4 assertthat_0.2.0 cellranger_1.1.0 R6_2.2.2 jsonlite_1.5 magrittr_1.5
[8] httr_1.3.1 stringi_1.1.5 rlang_0.1.2 curl_3.0 bindrcpp_0.2 xml2_1.1.1 tools_3.4.2
[15] stringr_1.2.0 glue_1.1.1 purrr_0.2.4 httpuv_1.3.5 yaml_2.1.14 compiler_3.4.2 pkgconfig_2.0.1
[22] openssl_0.9.7 bindr_0.1 tibble_1.3.4
>

It is the chrome browser issue rather than any R packages, I have tested in Firefox and safari in Mac which can successfully connected the google sheets.

Related

excelTable from excelR package R programming is not showing out put

excelTable() from ExcelR package is showing no output in the Viewer Pane. I have updated all the dependent packages. what could be the problem?
data = data.frame(Model = c('Mazda', 'Pegeout', 'Honda Fit', 'Honda CRV'),
Date=c('2006-01-01', '2005-01-01','2004-01-01', '2003-01-01' ),
Availability = c(TRUE, FALSE, TRUE, TRUE))
columns = data.frame(title=c('Model', 'Date', 'Availability'),
width= c(300, 300, 300),
type=c('text', 'calendar', 'checkbox'))
excelTable(data=data, columns = columns)
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
1 LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
1 stats graphics grDevices utils datasets methods base
other attached packages:
1 jsonlite_1.6 htmlwidgets_1.5.1 excelR_0.3.1 covr_3.3.2 testthat_2.1.1 shiny_1.4.0
loaded via a namespace (and not attached):
1 Rcpp_1.0.0 pillar_1.3.1 compiler_3.5.1 later_1.0.0 plyr_1.8.4 tools_3.5.1 digest_0.6.18 tibble_2.0.1 gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.2 rlang_0.4.1 Matrix_1.2-14
[14] rex_1.1.2 rstudioapi_0.9.0 yaml_2.2.0 fastmap_1.0.1 dplyr_0.8.0.1 grid_3.5.1 tidyselect_0.2.5 glue_1.3.0 R6_2.4.0 ggplot2_3.1.0 purrr_0.3.1 magrittr_1.5 scales_1.0.0
[27] promises_1.1.0 htmltools_0.4.0 assertthat_0.2.0 mime_0.6 colorspace_1.4-0 xtable_1.8-3 httpuv_1.5.2 bs4Dash_0.3.0 lazyeval_0.2.1 munsell_0.5.0 crayon_1.3.4
After discussing this issue with the package developer, I found that the version of the rstudio is the main cause of the problem of not viewing the output. The code is running successfully on the versions 1.2.5019 and 1.2.1322 and not in the older versions like 1.1.456. Thanks all!
Check if you are using html_notebook output type. That output type will always have inline output. May be try to choose a different R markdown document type. Go to File and click 'New' then click 'R Markdown' and then 'Document'. That should open an html_document output type, which will follow your preferences for inline output.

Rhandsontable displays on a locally deployed app, but not on app displayed in AWS EC2 Ubuntu 18.04 server

I'm trying to deploy on a private server an app that allows me to edit an RHandsontable object. For privacy reasons I cannot be showing a demonstration here.
I have successfully tested my app locally, but when I deploy it on my server the RHandsontable doesn't display, and the app "screen goes gray" after I start interacting there, so it doesn't allow any further interactions there.
This is how it looks on my Windows 10 browser. You can even see a 2 rhandsontables (that are empty because it has no selection whatsoever), that can be edited. The "Guardar" button is currently a dummy.
This is how it looks on AWS Ubuntu 18.04 Shiny Server. No rhandsontable loads (though the button loads). Same script, just different directories. I verified that the data loaded into both shiny apps were the same. You can also appreciate that the dummy button "Guardar" still appears.
I tried the same rendering equivalent data.tables from both the shiny and DT packages, leading to the same results as shown above.
Also, when I check my server logs at /var/log/shiny-server/ no issue arises (eg.: missing packages, broken code, etc). Last log goes as follows:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Attaching package: ‘DT’
The following objects are masked from ‘package:shiny’:
dataTableOutput, renderDataTable
Listening on http://127.0.0.1:41757
This suggests me that I have a compatibility / interaction issue that arises in Shiny Server or in Ubuntu that doesn't arise in my PC.
I have seen different sources in Stack Overflow and in jrowen's GitHub page without any success, and I'd like to know if I'm missing anything.
There's a minor difference between R version between both machines (my Ubuntu VM is fresh, so some packages are updated). This could also cause a problem, but I'm not positive this could be the reason.
I also installed JRE on both instances (I also thought this could be caused due to a Java issue that I haven't fixed properly). Running java -version on my VM yields
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
My personal computer is a Windows 10 Machine. Details:
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readxl_1.1.0 lubridate_1.7.4 mailR_0.4.1 forcats_0.3.0
[5] stringr_1.3.1 purrr_0.2.5 readr_1.1.1 tidyr_0.8.1
[9] tibble_2.0.1 ggplot2_3.0.0.9000 tidyverse_1.2.1 DBI_1.0.0
[13] RODBC_1.3-15 DT_0.4 rhandsontable_0.3.7 Cairo_1.5-9
[17] openxlsx_4.1.0 knitr_1.20 dplyr_0.8.0.1 shiny_1.1.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 lattice_0.20-35 assertthat_0.2.0 digest_0.6.15 mime_0.5
[6] R6_2.2.2 cellranger_1.1.0 plyr_1.8.4 backports_1.1.2 evaluate_0.10.1
[11] httr_1.3.1 highr_0.7 pillar_1.3.1 rlang_0.3.1 lazyeval_0.2.1
[16] rstudioapi_0.7 R.oo_1.22.0 R.utils_2.8.0 rmarkdown_1.11 htmlwidgets_1.2
[21] munsell_0.5.0 broom_0.5.0 compiler_3.5.0 httpuv_1.4.4.1 modelr_0.1.2
[26] pkgconfig_2.0.2 htmltools_0.3.6 tidyselect_0.2.5 crayon_1.3.4 withr_2.1.2
[31] later_0.7.3 R.methodsS3_1.7.1 grid_3.5.0 nlme_3.1-137 jsonlite_1.5
[36] xtable_1.8-2 gtable_0.2.0 magrittr_1.5 scales_0.5.0 zip_1.0.0
[41] cli_1.0.1 stringi_1.1.7 promises_1.0.1 xml2_1.2.0 tools_3.5.0
[46] glue_1.3.0 hms_0.4.2 rsconnect_0.8.12 yaml_2.1.19 colorspace_1.3-2
[51] rvest_0.3.2 rJava_0.9-10 haven_1.1.2
The Ubuntu 18.04 machine goes as follows:
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readxl_1.3.1 DT_0.5 rhandsontable_0.3.7
[4] knitr_1.22 shiny_1.2.0 dplyr_0.8.0.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 magrittr_1.5 tidyselect_0.2.5 xtable_1.8-3
[5] R6_2.4.0 rlang_0.3.3 tools_3.5.3 xfun_0.5
[9] htmltools_0.3.6 assertthat_0.2.1 digest_0.6.18 tibble_2.1.1
[13] crayon_1.3.4 purrr_0.3.2 later_0.8.0 htmlwidgets_1.3
[17] promises_1.0.1 glue_1.3.1 mime_0.6 cellranger_1.1.0
[21] compiler_3.5.3 pillar_1.3.1 jsonlite_1.6 httpuv_1.5.0
[25] pkgconfig_2.0.2
In advance, thanks very much for your help. Please clarify at comments if you need any extra information (that I can provide).
Edit: I checked as well outputting data.tables instead of rhandsontables both locally and on Ubuntu and failed as well rendering only on my Ubuntu VM.
For anyone interested in my problem, it was actually related to a firewall issue, not to a server-side or compatibility issue.
When I accessed my application from a network that wasn't my organization's (i.e. my cell phone's shared internet or home network) I had no problem at all.

Error on shiny server ERROR: 'restoreInput' is not an exported object from 'namespace:shiny'

I'm trying to run a shiny app that works perfectly well when I run it locally but not when I try and run it on a shiny web server. When I try and access it through the browser all I get is the following error message:
ERROR: 'restoreInput' is not an exported object from 'namespace:shiny'
I'm aware that a question regarding this error message has previously been asked here: Shinydashboard: 'restoreInput' is not an exported object from 'namespace:shiny' but I believe that person was running the app locally so my question is distinct from their's. Nevertheless I have obviously tried to implement all of the solutions provided for that answer which are basically just "ensure you have the latest version of R and the latest version of the required packages". I've done this and when I ssh into the shiny server and source my ui and server scripts and then call sessionInfo() this is the output:
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1 ggplot2_2.2.1
[4] raster_2.6-7 sp_1.2-7 leaflet_1.1.0
[7] shiny_1.0.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.15 magrittr_1.5 munsell_0.4.3 colorspace_1.3-2
[5] xtable_1.8-2 lattice_0.20-35 R6_2.2.2 rlang_0.2.0
[9] plyr_1.8.4 grid_3.4.3 gtable_0.2.0 htmltools_0.3.6
[13] crosstalk_1.0.0 yaml_2.1.17 lazyeval_0.2.1 digest_0.6.15
[17] tibble_1.4.2 htmlwidgets_1.0 mime_0.5 compiler_3.4.3
[21] pillar_1.2.1 scales_0.5.0 httpuv_1.3.6.1
which is almost identical to the output I get when I call sessionInfo() in my local version of R in which the app runs seamlessly. See below:
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1 ggplot2_2.2.1 raster_2.6-7
[5] sp_1.2-6 leaflet_1.1.0 shiny_1.0.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 magrittr_1.5 munsell_0.4.3 colorspace_1.3-2 xtable_1.8-2
[6] lattice_0.20-35 R6_2.2.2 rlang_0.1.2 plyr_1.8.4 tools_3.4.3
[11] rgdal_1.2-16 grid_3.4.3 gtable_0.2.0 rgeos_0.3-26 htmltools_0.3.6
[16] crosstalk_1.0.0 yaml_2.1.14 lazyeval_0.2.1 digest_0.6.14 tibble_1.3.4
[21] htmlwidgets_0.9 rsconnect_0.8.5 mime_0.5 compiler_3.4.3 scales_0.5.0
[26] jsonlite_1.5 httpuv_1.3.5
What's particularly strange is that initially when I ssh-ed into the shiny server and sourced the ui.R file I was getting this same error message. After updating R and all the packages this doesn't happen anymore but I still get the same error when I try and open the app in the browser. I added the following lines to the start of both my server and ui scripts to ensure that it was using the correct version of R and the up-to-date packages.
loc <- '/path/to/location/of/correct/r/packages'
.libPaths(c(loc, .libPaths()))
Can anybody advise me as to what might be going on or how best to troubleshoot?

Error in loading package SASxport: object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'

I'm trying to read data in the XPT format into R (the format can be found for example in the NHANES data). I found two functions doing this:
library("Hmisc")
sasxport.get("C:/path/file.XPT")
and
library("SASxport")
read.xport("C:/path/file.XPT")
The sasxport.get works, so I'm basically fine, but still inquisitive enough to understand (and solve) the following error: after the installation of the SASxport package, I cannot load it. When I run library("SASxport"), I get the error message:
Error: package or namespace load failed for ‘SASxport’:
object ‘label<-.data.frame’ is not exported by 'namespace:Hmisc'
Adopting this suggestion, I also ran
remove.packages(c("SASxport", "Hmisc"))
install.packages('Hmisc', dependencies = TRUE)
install.packages('SASxport', dependencies = TRUE)
what did not change the error message.
This is my sessionInfo():
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Hmisc_4.1-1 ggplot2_2.2.1 Formula_1.2-2 survival_2.41-3 lattice_0.20-35
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 pillar_1.0.1 compiler_3.4.3 RColorBrewer_1.1-2 plyr_1.8.4
[6] base64enc_0.1-3 iterators_1.0.9 tools_3.4.3 rpart_4.1-11 digest_0.6.13
[11] tibble_1.4.1 gtable_0.2.0 htmlTable_1.11.1 checkmate_1.8.5 rlang_0.1.6
[16] icenReg_2.0.7 Matrix_1.2-12 foreach_1.4.4 rstudioapi_0.7 yaml_2.1.16
[21] gridExtra_2.3 coda_0.19-1 stringr_1.2.0 cluster_2.0.6 knitr_1.18
[26] htmlwidgets_0.9 grid_3.4.3 nnet_7.3-12 data.table_1.10.4-3 foreign_0.8-69
[31] latticeExtra_0.6-28 magrittr_1.5 scales_0.5.0 backports_1.1.2 codetools_0.2-15
[36] htmltools_0.3.6 splines_3.4.3 colorspace_1.3-2 stringi_1.1.6 acepack_1.4.1
[41] lazyeval_0.2.1 munsell_0.4.3
The last update of SASxport happend nearly two years ago (2016-03-11). So the Hmisc package it imports might have changed in the meantime. Looking up the Hmisc archive I found the version number on 2016-03-11 to be 3.17-2. So installing this version fixes the problem:
library("devtools")
install_version("Hmisc", version = "3.17-2")
Two reasons speak against using SASxport in this case:
You need to use a old version of a package which might happer your work in later steps.
SASxport needs Hmisc for a task that Hmisc can do already by itself, so SASxport is expendable when reading in XPT files.

How to route R via proxy to download a FTP file?

SessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] gridExtra_2.3 gtable_0.2.0 quantmod_0.4-11 TTR_0.23-2
[5] xts_0.10-0 cowplot_0.9.1 ggplot2_2.2.1 scales_0.5.0
[9] zoo_1.8-0 data.table_1.10.4-3
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 lattice_0.20-35 plyr_1.8.4 rlang_0.1.4 curl_3.0
[6] lazyeval_0.2.1 tools_3.4.1 munsell_0.4.3 compiler_3.4.1 colorspace_1.3-2
[11] tibble_1.3.4
My Proxy servers IP address is xxx.xxx.xx.x:8080, with no username and passwords and I want to download an ftp file which cannot be downloaded from my current place. ftp file has a username and password.
So basically I want to route my ftp file downloading in R via a proxy server.
Any help would be appreciated.

Resources