Closed vtmacox closed 6 years ago
In a fresh session of R, without loading any packages, try installing ‘httr’ from cran via ‘install.packages(“httr”). Then install devtools, then install the CHORDS package via devtools.
The ‘httr’ package is used by devtools so it might not be loading because devtools is loaded.
Also, I don’t think you need the “dependencies = TRUE” arguments in your calls to the install functions. I noticed it is trying to install “BiocInstaller” but I don’t have that in my library so clearly you don’t need it.
See if that works and let me know.
The install.packages('httr') was successful, but running 'devtools' didn't find the file. See log below- I wonder if the session isn't finding the library where the packages are downloaded/unpacked?
R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages("httr", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/httr_1.3.1.zip'
Content type 'application/zip' length 300015 bytes (292 KB)
downloaded 292 KB
package ‘httr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\14\RtmpcTNojc\downloaded_packages
> install.packages("devtools", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/devtools_1.13.5.zip'
Content type 'application/zip' length 443954 bytes (433 KB)
downloaded 433 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\14\RtmpcTNojc\downloaded_packages
> devtools::install_github("UCCC/CHORDS-QA")
Installation failed: there is no package called ‘httr’
>
I think what is going on is that you need to specify the library for your packages before you run the "devtools::install_github("UCC/CHORDS-QA"). My guess is that R is looking for the package dependencies for devtools in the default location, which isn't where your packages are located.
Try running this code first:
.libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
I'm assuming the path above is correct for where you are storing your packages. If not, just replace the path above with the correct one.
Thanks Matt. I spent more time than I should trying to figure out how to get libpaths working (I wasn't googling the right thing). New error-
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCC/CHORDS-QA")
Downloading GitHub repo UCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCC/CHORDS-QA/zipball/master
Installation failed: Not Found (404)
So that is an error on my end not yours (I get the same error). Let me look into this and get back to you.
I figured it out. The code you used above is incorrect. It should be:
devtools::install_github("UCCC/CHORDS-QA")
You were missing a "C" in your github path. Let me know if that works and I will close this issue.
Thanks Matt. Sorry this process is so iterative. I'm still wondering if firewalls or something are blocking my installations. I'm getting errors about other packages, but I did install them successfully in other instances. See below-
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
Installing 1 package: rmarkdown
Installing package into ‘C:/Users/M426654/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.4/rmarkdown_1.9.zip'
Content type 'application/zip' length 2301254 bytes (2.2 MB)
downloaded 2.2 MB
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘C:\Users\M426654\Documents\R\win-library\3.4\file19f84f561dc\rmarkdown’ to ‘C:\Users\M426654\Documents\R\win-library\3.4\rmarkdown’
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\17\Rtmpc7bx0t\downloaded_packages
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/17/Rtmpc7bx0t/devtools19f811596837/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'backports'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
>
Do you have the "backports" package installed in your library?
Yeah, I get the error, I download the "missing" package, then re-run and get another error for missing packages.
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
Installing 1 package: rmarkdown
Installing package into ‘C:/Users/M426654/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.4/rmarkdown_1.9.zip'
Content type 'application/zip' length 2301254 bytes (2.2 MB)
downloaded 2.2 MB
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘C:\Users\M426654\Documents\R\win-library\3.4\file56076e558\rmarkdown’ to ‘C:\Users\M426654\Documents\R\win-library\3.4\rmarkdown’
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/18/Rtmpq0k6cE/devtools5605a5068f/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'backports'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
> install.packages("backports", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/backports_1.1.2.zip'
Content type 'application/zip' length 54964 bytes (53 KB)
downloaded 53 KB
package ‘backports’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
> > .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
Error: unexpected '>' in ">"
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
Installing 1 package: rmarkdown
Installing package into ‘C:/Users/M426654/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/rmarkdown_1.9.zip'
Content type 'application/zip' length 2301254 bytes (2.2 MB)
downloaded 2.2 MB
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘C:\Users\M426654\Documents\R\win-library\3.4\file5605ccc33a9\rmarkdown’ to ‘C:\Users\M426654\Documents\R\win-library\3.4\rmarkdown’
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/18/Rtmpq0k6cE/devtools5605e4b17f3/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'xtable'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
> install.packages("xtable", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/xtable_1.8-2.zip'
Content type 'application/zip' length 710149 bytes (693 KB)
downloaded 693 KB
package ‘xtable’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
Installing 1 package: rmarkdown
Installing package into ‘C:/Users/M426654/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/rmarkdown_1.9.zip'
Content type 'application/zip' length 2301254 bytes (2.2 MB)
downloaded 2.2 MB
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘C:\Users\M426654\Documents\R\win-library\3.4\file5601777430b\rmarkdown’ to ‘C:\Users\M426654\Documents\R\win-library\3.4\rmarkdown’
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/18/Rtmpq0k6cE/devtools56027a52ada/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'broom'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
> install.packages("broom", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
also installing the dependencies ‘purrr’, ‘tidyr’
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/purrr_0.2.4.zip'
Content type 'application/zip' length 244020 bytes (238 KB)
downloaded 238 KB
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/tidyr_0.8.0.zip'
Content type 'application/zip' length 899611 bytes (878 KB)
downloaded 878 KB
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/broom_0.4.3.zip'
Content type 'application/zip' length 1625675 bytes (1.6 MB)
downloaded 1.6 MB
package ‘purrr’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘\\kpco-ihr-1.ihr.or.kp.org\Analytic_Projects_2016\2016_Steiner_CHORDS_EX\Data\R Programming\file56033bb528a\purrr’ to ‘\\kpco-ihr-1.ihr.or.kp.org\Analytic_Projects_2016\2016_Steiner_CHORDS_EX\Data\R Programming\purrr’
package ‘tidyr’ successfully unpacked and MD5 sums checked
package ‘broom’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
Installing 1 package: rmarkdown
Installing package into ‘C:/Users/M426654/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/rmarkdown_1.9.zip'
Content type 'application/zip' length 2301254 bytes (2.2 MB)
downloaded 2.2 MB
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/18/Rtmpq0k6cE/devtools5606d506541/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'purrr'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
> install.packages("purrr", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/purrr_0.2.4.zip'
Content type 'application/zip' length 244020 bytes (238 KB)
downloaded 238 KB
package ‘purrr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\18\Rtmpq0k6cE\downloaded_packages
> .libPaths( c( .libPaths(), "//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming") )
> devtools::install_github("UCCC/CHORDS-QA")
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/18/Rtmpq0k6cE/devtools5603248983/UCCC-CHORDS-QA-8d37648" --library="C:/Users/M426654/Documents/R/win-library/3.4" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'mnormt'
ERROR: lazy loading failed for package 'chordsTables'
* removing 'C:/Users/M426654/Documents/R/win-library/3.4/chordsTables'
In R CMD INSTALL
Installation failed: Command failed (1)
Try this:
install.packages("withr", lib="//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming")
withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", devtools::install_github("UCCC/CHORDS-QA"))
This should temporarily ensure that the path for the library is specified to the correct location for what ever code is executed in the with_libpaths
function. I was able to specify a different library where all the packages were installed.
If this works, you might have to use the same function to then use the run_report
function from the chordsTables package. It would look like this:
withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
There is a way to permanently change the library path, but that involves changing your R environment, which I'm reluctant to tell you to do. This work around won't cause any permanent changes to your system. I would also continue to add the file path of your library using the .libPath
function as before with each new R session.
Progress (I think)! I switched to the 32-bit R, not sure if that changed anything. I never got a database name or database prompt, just a prompt for an additional input?
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/bin/windows/contrib/3.4/withr_2.1.1.zip'
Content type 'application/zip' length 120290 bytes (117 KB)
downloaded 117 KB
package ‘withr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\19\RtmpGgxbuu\downloaded_packages
>
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", devtools::install_github("UCCC/CHORDS-QA"))
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
"C:/PROGRA~1/R/R-34~1.3/bin/i386/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/19/RtmpGgxbuu/devtools1928f05bb9/UCCC-CHORDS-QA-8d37648" \
--library="\\kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'chordsTables'
finding HTML links ... done
ccsMDxI10 html
ccsMDxI9 html
ccsSDxI9 html
chordsTables html
isoLang html
prov_type html
run_report html
specialties html
stateCnty html
valSets html
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (chordsTables)
In R CMD INSTALL
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
+
It looks like it is working now. I don't think switching to 32-bit did anything. The 64-bit version should be substantially faster, but I haven't done any benchmarking. If you have a chance I would try running the code with the 64-bit version.
If the report generates, let me know and I will close this issue
I tried again today, using the 64-bit version. It looks like the subfolders were created, but after several hours I never got a report.
The downloaded binary packages are in
C:\Users\M426654\AppData\Local\Temp\20\RtmpqePpEp\downloaded_packages
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", devtools::install_github("UCCC/CHORDS-QA"))
Downloading GitHub repo UCCC/CHORDS-QA@master
from URL https://api.github.com/repos/UCCC/CHORDS-QA/zipball/master
Installing chordsTables
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/M426654/AppData/Local/Temp/20/RtmpqePpEp/devtools17343271506e/UCCC-CHORDS-QA-8d37648" \
--library="\\kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming" --install-tests
* installing *source* package 'chordsTables' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'chordsTables'
finding HTML links ... done
ccsMDxI10 html
ccsMDxI9 html
ccsSDxI9 html
chordsTables html
isoLang html
prov_type html
run_report html
specialties html
stateCnty html
valSets html
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (chordsTables)
In R CMD INSTALL
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
When I hit "Esc" to end the R session I got this error-
Error: unexpected symbol in:
"withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
q"
R might throw an error if you terminate it unexpectedly.
I'm assuming you are running the code in RStudio. In the lower left had corner of the screen, there is a section with several tabs. They include "Console", "Terminal", and "RMarkdown". When you are running the code, the RMarkdown tab should have messages on the screen indicating the percent code that has been executed. Check this screen to make sure that the percent keeps going up.
I would let the code run over night and see what happens. Depending on how much data is being pulled and how fast your machine is, it's theoretically possible that it could take several hours to generate a report. If the percent in the RMarkdown tab doesn't change from when you start it to when you check on it the next day, then there is a problem. Otherwise it is just taking a long time.
Sorry for the late reply. No, I'm running a base R, not RStudio. Is there another way to see progress?
You have to use RStudio to run the code. If you don't, I don't think it will run. Have you seen the vignette for the package? If not, go to this link: https://github.com/UCCC/CHORDS-QA/blob/with_vignette/vignettes/chordstable-vignette.Rmd
Update- I've got RStudio installed and running. I wen back and reviewed the vignette- following step 3, I'm not getting an explorer window opening to set data base server or anything of the like? Wouldn't this be instantaneous?
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", devtools::install_github("UCCC/CHORDS-QA"))
Skipping install of 'chordsTables' from a github remote, the SHA1 (8d376488) has not changed since last install.
Use `force = TRUE` to force installation
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
+ withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
Error: unexpected symbol in:
"withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
withr"
> withr::with_libpaths("//kpco-ihr-1.ihr.or.kp.org/Analytic_Projects_2016/2016_Steiner_CHORDS_EX/Data/R Programming", chordsTables::run_report("P1")
The browser window should come up almost instantaneously (no more than a couple seconds).
Am I missing another package that would kick off the browser prompt?
Just to be clear, it ins't opening an explorer window, it is opening your default web browser and running a local html page from your machine.
If the package is downloaded and you can run the function, I think there are technical issues from the IT end that are causing these problems. Maybe something to do with how Rstudio is trying to call your default browser and your admin set up won't allow it. As far as I know, none of the other sites have had these issues. I can't dismiss that it might be your library directory issue from before, but you should be getting errors if that is the case.
I would try to talk to your IT person about what is happening (perhaps show them the vignette so they get an idea of how this should function). It doesn't look like R is throwing any errors so I can't really diagnose what is going on.
If you want, we can try to set up a zoom meeting and you can show me your setup, but I would check with your IT person before taking this step.
This is how to change the R environment settings. You may need administrative rights to do this FYI:
Step 1: Open control panel
Step 2: Click on "System and Security"
Step 3: Click on "System"
Step 4: On the left panel click "Advanced system settings" (this is where you might need an admin)
Step 5: You should be in a window with multiple tabs and you should be on the "Advanced" tab
Step 6: Click on the "Environmental Variables" button
Step 7: Under the "User variables for
This should permanently fix the issue with the library. In theory, you shouldn't need to change the library path ever again (i.e., no need to do "lib =" or use the withr::with_libpaths() function).
Thanks Matt. Looks like I need admin rights for this step. I've reached out to the server admins- I'll let you know what they say and if I can get us all on a live webex to review the issues.
Hi Matt! Progress has been made! The system admin gave me additional write access to the docs folder to resolve the permissions issues so I don't need to write out to a directory folder library (although that code is handy, so I'm holding on to it). He also and provided me with R code to increase the wait time when unpacking library files long enough for the Antivirus software to finish scanning it so my packages can be installed and unpacked.
trace(utils:::unpackPkgZip, edit=TRUE)
Then go to Line 140 and change Sys.sleep(0.5) to Sys.sleep(2.5) and save the changes. You should now be able to run the package installer successfully.
I've gotten chordsTables::run_report("P1") to open a explorer window and prompt me to connect to SQL server, but I get a password error message afterwards (see below). Should there be a password prompt as well?
> chordsTables::run_report("P1")
Listening on http://127.0.0.1:7227
processing file: P1.Rmd
|. | 1%
ordinary text without R code
|. | 2%
label: setup (with options)
List of 1
$ include: logi FALSE
Quitting from lines 19-56 (P1.Rmd)
Error: nanodbc/nanodbc.cpp:950: 28000: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'IHR\M426654'.
>
This doesn't look to be a package problem. It looks like your credentials don't work for accessing the VDW. It says that your user name is IHR\M42665
which doesn't seem right.
The code uses the credentials for your user login to access the VDW. Are you able to run SQL code with the machine and login you are using to run the package (without having to provide any other username or password information)? If not, then the code won't work.
Ah, that makes sense. It's assuming I'm running R in the same domain as the VDW and SQL Server. I would need to change that. Is there a way I can manually tell R my credentials?
You would have to modify the code manually. I set up the package so there would be minimal interface from the providers so there is no prompt to input this info using the package.
Can you walk me through how/where to edit the package? I did some googling last week on editing packages and got lost pretty quick.
I wouldn't recommend going this route. You would be creating your own branch and and subsequent changes I make to the package wouldn't perpetuate to your branch. Are you unable to login to the computer using the credentials for the VDW?
The creds RStudio are passing on to SQL Server are incorrect, so I can't access the VDW. I talked to our DBA and he said we could create a second credential profile for the remote desktop to accommodate the R program, but that could lead to issues down the road with running CHORDS queries in the different environments I need to use. Sounds like it's coming down to either branching logic in the R program or in my systems.
Hi David,
Can you say a little bit more about the potential problems that could create with the other CHORDS queries in the different environments?
Instead of branching the code, Matt has suggested we add a username and password request to the R package that everyone would be required to enter. I think we should go ahead and give that a try as our next step.
The DBA said their could be issues if multiple requests to the SQL Server were being performed in different environments at the same time. He wasn't ruling this out as an option, but was concerned if I created another instance of my creds and were running multiple/overlapping requests that account verification could get criss-crossed and I could lock myself out of both.
Requiring credentials to be input by the user would be the preferred option at KP, to get us over this particular issue and more generally from a IT security standpoint. But if this is a major rebuild of the R package, I can follow-up with the DBA and create another profile to see if that gets us over the hurdle.
Just checking in- should I have the DBA edit my credentials?
Hi David,
Matt is working on the addition to the program that will have you input your user credentials. We need a little assistance in getting this set up -- we may not have this up and running in time to have the KP report for the DQWG meeting on the 19th.
As far as editing the credentials - I think that's something that's hard for us to say on our end. If the user credential input results in RStudio passing the correct credentials to SQLServer so that you can access the VDW, no changes should be necessary. If there is still an issue accessing the VDW we may need the DBA to edit the credentials.
Given that there are potential problems in editing the credentials that are discussed above, I think it is worth it to wait until we can try out the user credential input and see if that fixes the issue. (But, I'm speaking beyond my knowledge here, so if you disagree please let me know!)
I've created a branch that now accepts a username and password to make the SQL server connection. I tested it with a username and password that Bryant provided and it works. Concurrently, using the wrong username and password prevents the code from running.
To install the branch use the following code:
devtools::install_github("UCCC/CHORDS-QA", ref = "password")
The same place that prompts for the Server Name and DB name, now also prompts for a username and password. Once you hit save, look at RStudio to make sure that the code doesn't produce any errors. Let me know if that works.
That worked Matt! Now another problem. The query for the P1 tables bombed. See error below- I think this is due to our CHORDS tables existing as views on SQL Server in the same environment as our other VDW tables (so DEMOGRAPHICS exists, but for CHORDS I need to point to CHORDS_DEMOGRAPHICS which contains the field PERSON_ID).
> chordsTables::run_report("P1")
Listening on http://127.0.0.1:7394
processing file: P1.Rmd
|. | 1%
ordinary text without R code
|. | 2%
label: setup (with options)
List of 1
$ include: logi FALSE
|.. | 3%
inline R code fragments
|... | 4%
label: supporting data and functions (with options)
List of 1
$ include: logi FALSE
|.... | 6%
ordinary text without R code
|.... | 7%
label: tab1_sum_stats (with options)
List of 1
$ echo: symbol F
Quitting from lines 153-201 (P1.Rmd)
Error: <SQL> 'select count(*) as nrows,
count(distinct person_id) as npats
from demographics'
nanodbc/nanodbc.cpp:1587: 42S22: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'person_id'.
>
I think Rachel will need to weigh in here as it seems that your VDW nomenclature deviates from the CHORDS protocols. If all of the tables in your DB have different names, then the entire package will have to be rewritten to your institution specific nomenclature. From a programming perspective this would be problematic, because there would need to be one package for KP and a separate package for all other CHORDS institutions.
My recommendation would be to create a separate DB where you can store all the tables and have them conform to the CHORDS naming conventions.
Discussing some different options with Matt, assuming the table names at KP will stay the same. David, if the separate database option is something we could look at now, let us know! I know that was not an option on the table in earlier discussions with your IT folks.
I can revisit the separate DB on my end. In the past this wasn't an option, but now that our data resides in a new environment I can see if we can move the CHORDS views to a unique DB (or build them as tables in a new DB).
For the time being, I've updated the branch that prompts for the password to work with the KP naming convention. I can't test this code though so I can't guarantee it works. Also, making updates that perpetuate to this code will be difficult. Until we can formalize a permanent solution, this will allow you to run the code.
Using git, I am able to make changes to the "master" branch that perpetuate to the "password" branch. Moving forward, we may want to think about streamlining some of the changes so we aren't maintaining two separate packages. Does it make sense to make the "password" branch to main package? This would prompt everyone to enter a password and username. I'm not an expert on credentials for accessing the VDW and don't know if this would work for everyone.
I'm glad those changes perpetuate! I think having one package would be ideal. In the nonpassword, current main branch, is the credential passed along just the credentials that folks used to log in to their system?
Yes. It uses what's called Windows Authentication which uses the login credentials of the user to access the SQL server.
Let's go ahead and make the password branch the main package. If too many folks encounter issues we can roll back if needed. I can ask a few sites to give it a test run for us.
I'm going to close this issue as it has gotten fairly off task from the original issue. I'll open a separate issue regarding combining the two branches.
From David Tobano: