OHI-Science/ohicore

'exdir' does not exist

Opened this issue · 10 comments

Hi,

When trying to install the OHI from the text in the ohi-science.org website I get the following problem. Do you know what can be done to solve it? Thanks

> # remove old packages
> for (p in c('ohicore','ohigui','rCharts')){  
+     if (p %in% rownames(installed.packages())){
+         lib = subset(as.data.frame(installed.packages()), Package==p, LibPath, drop=T)
+         remove.packages(p, lib)  
+     }
+ }
> 
> # install dependencies
> for (p in c('devtools')){
+     if (!require(p, character.only=T)){
+         install.packages(p)
+         require(p, character.only=T)
+     }
+ }
Loading required package: devtools
> 
> # install packages
> install_github('ohi-science/rCharts')
Downloading github repo ohi-science/rCharts@master
Installing rCharts
"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\MB4514\AppData\Local\Temp\RtmpaEszAj\devtoolsa4411ed7c\OHI-Science-rCharts-d5018af" --library="C:/Program  \
  Files/R/R-3.1.2/library" --install-tests 

* installing *source* package 'rCharts' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rCharts)
> install_github('ohi-science/ohicore')
Downloading github repo ohi-science/ohicore@master
Installing ohicore
"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\MB4514\AppData\Local\Temp\RtmpaEszAj\devtoolsa446aab36a7\OHI-Science-ohicore-2f7a3d7" --library="C:/Program  \
  Files/R/R-3.1.2/library" --install-tests 

* installing *source* package 'ohicore' ...
** R
** inst
** tests
** preparing package for lazy loading
Warning: replacing previous import by 'ggvis::%>%' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::explain' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::group_by' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::resolution' when loading 'ohicore'
Warning: replacing previous import by 'plyr::arrange' when loading 'ohicore'
Warning: replacing previous import by 'plyr::count' when loading 'ohicore'
Warning: replacing previous import by 'plyr::desc' when loading 'ohicore'
Warning: replacing previous import by 'plyr::failwith' when loading 'ohicore'
Warning: replacing previous import by 'plyr::id' when loading 'ohicore'
Warning: replacing previous import by 'plyr::mutate' when loading 'ohicore'
Warning: replacing previous import by 'plyr::rename' when loading 'ohicore'
Warning: replacing previous import by 'plyr::summarise' when loading 'ohicore'
Warning: replacing previous import by 'plyr::summarize' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::arrange' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::desc' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::failwith' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::filter' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::id' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::intersect' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::mutate' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::setdiff' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::setequal' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::summarise' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::summarize' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::union' when loading 'ohicore'
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Warning: replacing previous import by 'ggvis::%>%' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::explain' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::group_by' when loading 'ohicore'
Warning: replacing previous import by 'ggvis::resolution' when loading 'ohicore'
Warning: replacing previous import by 'plyr::arrange' when loading 'ohicore'
Warning: replacing previous import by 'plyr::count' when loading 'ohicore'
Warning: replacing previous import by 'plyr::desc' when loading 'ohicore'
Warning: replacing previous import by 'plyr::failwith' when loading 'ohicore'
Warning: replacing previous import by 'plyr::id' when loading 'ohicore'
Warning: replacing previous import by 'plyr::mutate' when loading 'ohicore'
Warning: replacing previous import by 'plyr::rename' when loading 'ohicore'
Warning: replacing previous import by 'plyr::summarise' when loading 'ohicore'
Warning: replacing previous import by 'plyr::summarize' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::arrange' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::desc' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::failwith' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::filter' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::id' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::intersect' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::mutate' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::setdiff' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::setequal' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::summarise' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::summarize' when loading 'ohicore'
Warning: replacing previous import by 'dplyr::union' when loading 'ohicore'
* DONE (ohicore)
> 
> # get scenarios and launch
> library(ohicore)
There were 25 warnings (use warnings() to see them)
> get_scenarios('ohi-science/ohi-global', '~/ohi-global')
Deleting ~/ohi-global
Deleting ~/ohi-global-master
Downloading https://github.com/ohi-science/ohi-global 
  to ~/ohi-global
Error in unzip(zip, exdir = dirname(dir_dest)) : 'exdir' does not exist
> launch_app('~/ohi-global/eez2013')
Error: file.exists(sprintf("%s/conf", dir_scenario)) is not TRUE

Hi Michael,

Sorry about the hassles here. Thanks for posting as a Github issue.

I just tried on my Windows machine and the get_scenarios() function worked fine.

Can you please share with me the results of the following commands at the R console:

normalizePath('~/ohi-global')
sessionInfo()

For instance, here's the result of me running on mine:

> normalizePath('~/ohi-global')
[1] "Z:\\Documents\\ohi-global"
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

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] httr_0.5       ohicore_0.1    devtools_1.6.1

loaded via a namespace (and not attached):
 [1] assertthat_0.1     bitops_1.0-6       colorspace_1.2-4   DBI_0.3.1          digest_0.6.4       dplyr_0.3.0.2     
 [7] evaluate_0.5.5     formatR_1.0        ggplot2_1.0.0      ggvis_0.4          grid_3.1.1         gtable_0.1.2      
[13] htmltools_0.2.6    httpuv_1.3.0       knitr_1.8          lattice_0.20-29    magrittr_1.5       markdown_0.7.4    
[19] MASS_7.3-33        mime_0.2           munsell_0.4.2      parallel_3.1.1     plyr_1.8.1         proto_0.3-10      
[25] R6_2.0             rCharts_0.4.1      RColorBrewer_1.0-5 Rcpp_0.11.3        RCurl_1.95-4.4     reshape2_1.4      
[31] RJSONIO_1.3-0      scales_0.2.4       shiny_0.10.2.1     stringr_0.6.2      tools_3.1.1        whisker_0.3-2     
[37] xtable_1.7-4       yaml_2.1.13    

And if all is well with get_scenario(), it will look like this:

> get_scenarios('ohi-science/ohi-global', '~/ohi-global')
Deleting ~/ohi-global
Deleting ~/ohi-global-master
Downloading https://github.com/ohi-science/ohi-global 
  to ~/ohi-global
Writing launch_app.* shortcut to ~/ohi-global/antarctica2014
Writing launch_app.* shortcut to ~/ohi-global/eez2012
Writing launch_app.* shortcut to ~/ohi-global/eez2013
Writing launch_app.* shortcut to ~/ohi-global/eez2014
Writing launch_app.* shortcut to ~/ohi-global/highseas2014

I'm hoping you simply need to update R packages, ensure you home directory (`~') is writeable or some such easy fix.

PS CC'ing @jules32.

Hi Mike,

Thanks for posting this and Ben for your response. I am definitely here to
help how I can.

Cheers,
Julie

On Fri, Dec 5, 2014 at 12:00 PM, Ben Best notifications@github.com wrote:

Hi Michael,

Sorry about the hassles here. Thanks for posting as a Github issue.

I just tried on my Windows machine and the get_scenarios() function
worked fine.

Can you please share with me the results of the following commands at the
R console:

normalizePath('~/ohi-global')
sessionInfo()

For instance, here's the result of me running on mine:

normalizePath('~/ohi-global')
[1] "Z:\Documents\ohi-global"
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

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] httr_0.5 ohicore_0.1 devtools_1.6.1

loaded via a namespace (and not attached):
[1] assertthat_0.1 bitops_1.0-6 colorspace_1.2-4 DBI_0.3.1 digest_0.6.4 dplyr_0.3.0.2
[7] evaluate_0.5.5 formatR_1.0 ggplot2_1.0.0 ggvis_0.4 grid_3.1.1 gtable_0.1.2
[13] htmltools_0.2.6 httpuv_1.3.0 knitr_1.8 lattice_0.20-29 magrittr_1.5 markdown_0.7.4
[19] MASS_7.3-33 mime_0.2 munsell_0.4.2 parallel_3.1.1 plyr_1.8.1 proto_0.3-10
[25] R6_2.0 rCharts_0.4.1 RColorBrewer_1.0-5 Rcpp_0.11.3 RCurl_1.95-4.4 reshape2_1.4
[31] RJSONIO_1.3-0 scales_0.2.4 shiny_0.10.2.1 stringr_0.6.2 tools_3.1.1 whisker_0.3-2
[37] xtable_1.7-4 yaml_2.1.13

And if all is well with get_scenario(), it will look like this:

get_scenarios('ohi-science/ohi-global', '~/ohi-global')
Deleting ~/ohi-global
Deleting ~/ohi-global-master
Downloading https://github.com/ohi-science/ohi-global
to ~/ohi-global
Writing launch_app.* shortcut to ~/ohi-global/antarctica2014
Writing launch_app.* shortcut to ~/ohi-global/eez2012
Writing launch_app.* shortcut to ~/ohi-global/eez2013
Writing launch_app.* shortcut to ~/ohi-global/eez2014
Writing launch_app.* shortcut to ~/ohi-global/highseas2014

I'm hoping you simply need to update R packages, ensure you home directory
(`~') is writeable or some such easy fix.

PS CC'ing @jules32 https://github.com/jules32.


Reply to this email directly or view it on GitHub
#167 (comment).

Julia Stewart Lowndes, PhD
Project Scientist, Ocean Health Index http://www.oceanhealthindex.org
National Center for Ecological Analysis and Synthesis (NCEAS
http://www.nceas.ucsb.edu)
University of California, Santa Barbara
735 State Street, Suite 300
Santa Barbara, CA, 93101, USA
Phone: 1-805-893-7523

Thanks guys. I'm almost certain it is something wrong in my setup of R as I have installed this properly on a different machine but since my laptop was formatted by IT funny things have been happening. Ben, when running the normalize Path, I get the following:

> normalizePath('~/ohi-global')
[1] "\\\\icnas1.cc.ic.ac.uk\\mb4514\\ohi-global"
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="//icnas1.cc.ic.ac.uk/mb4514/ohi-global": The system cannot find the file specified
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] httr_0.5       ohicore_0.1    devtools_1.6.1

loaded via a namespace (and not attached):
 [1] assertthat_0.1     bitops_1.0-6       colorspace_1.2-4   DBI_0.3.1          digest_0.6.4       dplyr_0.3.0.2     
 [7] evaluate_0.5.5     formatR_1.0        ggplot2_1.0.0      ggvis_0.4          grid_3.1.2         gtable_0.1.2      
[13] htmltools_0.2.6    httpuv_1.3.2       knitr_1.8          lattice_0.20-29    magrittr_1.5       markdown_0.7.4    
[19] MASS_7.3-35        mime_0.2           munsell_0.4.2      parallel_3.1.2     plyr_1.8.1         proto_0.3-10      
[25] R6_2.0.1           rCharts_0.4.1      RColorBrewer_1.0-5 Rcpp_0.11.3        RCurl_1.95-4.4     reshape2_1.4      
[31] RJSONIO_1.3-0      scales_0.2.4       shiny_0.10.2.1     stringr_0.6.2      tools_3.1.2        whisker_0.3-2     
[37] xtable_1.7-4       yaml_2.1.13       

With the get scenario, I still get the following error message:

Error: could not find function "get_scenario"

Thanks so much for your help. To introduce myself, I've recently started a PhD at Imperial College London with Ben Halpern as my supervisor - I will be applying the OHI to the Arctic. I'm coming out to Santa Barbara in January so look forward to meeting you!

Cheers,
Mike

Hi Mike,

Are you on the network and can write to your home directory? You can confirm this by pasting the path into the location bar of Windows Explorer and creating a new file or folder there:

\\icnas1.cc.ic.ac.uk\mb4514

You might try using a local path instead, ie on your C drive. Here's a revised version of the install script presuming you've already successfully installed the necessary packages (the first part). Notice the new variable which you should update to a writable local location.

# set this path to a writable local directory (note forward slashes)
dir_local = 'C:/Users/mburgass/Documents'

# get scenarios and launch
require(ohicore)
get_scenarios('ohi-science/ohi-global', file.path(dir_local, 'ohi-global'))
launch_app(file.path(dir_local, 'ohi-global/eez2013')

The get_scenarios() function is made available by loading the ohicore library. Please let me know if you get any error messages with the code above.

Yes, Ben mentioned you. Happy to hear you'll be visiting in January and look forward to meeting you!

Hi Ben,

The university computers are slightly odd in that there is a c drive and network drive and I think R gets confused between the two. I installed everything to the C drive so I'm not sure why it now goes to that network drive as default.

I changed the directory location as you said and the following happened:

> # set this path to a writable local directory (note forward slashes)
> dir_local = 'C:/R'
> 
> # get scenarios and launch
> require(ohicore)
> get_scenarios('ohi-science/ohi-global', file.path(dir_local, 'ohi-global'))
Deleting C:/R/ohi-global
Deleting C:/R/ohi-global-master
Downloading https://github.com/ohi-science/ohi-global 
  to C:/R/ohi-global
Writing launch_app.* shortcut to C:/R/ohi-global/antarctica2014
Writing launch_app.* shortcut to C:/R/ohi-global/eez2012
Writing launch_app.* shortcut to C:/R/ohi-global/eez2013
Writing launch_app.* shortcut to C:/R/ohi-global/eez2014
Writing launch_app.* shortcut to C:/R/ohi-global/highseas2014
> launch_app(file.path(dir_local, 'ohi-global/eez2013')
+ 

When I run get_scenarios() function I get the following:

> get_scenarios()
Error in sprintf("https://github.com/%s/archive/master.zip", github_repo) : 
  argument "github_repo" is missing, with no default

Sorry for the hassle and thank you so much as I know this is just a problem with the set up of my machine rather than your code. I've tried to go to IT but they're not familiar with R so aren't much use...I thought it best to get this sorted first before I come out though, in case I need to alter something with my computer.

Cheers,
Mike

don't apologize Mike for discovering an issue with using the toolbox --
every error found is one we can fix to make things easier for others.
Once we get this sorted out, we can include instructions or FAQ notes
that explain it in case others encounter it in the future.

On 12/8/2014 12:37 PM, mburgass wrote:

Hi Ben,

The university computers are slightly odd in that there is a c drive
and network drive and I think R gets confused between the two. I
installed everything to the C drive so I'm not sure why it now goes to
that network drive as default.

I changed the directory location as you said and the following happened:

  set this path to a writable local directory (note forward slashes)

dir_local = 'C:/R'


  get scenarios and launch

require(ohicore)
get_scenarios('ohi-science/ohi-global', file.path(dir_local,
'ohi-global'))
Deleting C:/R/ohi-global
Deleting C:/R/ohi-global-master
Downloading https://github.com/ohi-science/ohi-global
to C:/R/ohi-global
Writing launch_app.* shortcut to C:/R/ohi-global/antarctica2014
Writing launch_app.* shortcut to C:/R/ohi-global/eez2012
Writing launch_app.* shortcut to C:/R/ohi-global/eez2013
Writing launch_app.* shortcut to C:/R/ohi-global/eez2014
Writing launch_app.* shortcut to C:/R/ohi-global/highseas2014
launch_app(file.path(dir_local, 'ohi-global/eez2013')

 *

When I run get_scenarios() function I get the following:

get_scenarios()
Error in sprintf("https://github.com/%s/archive/master.zip",
github_repo) :
argument "github_repo" is missing, with no default

Sorry for the hassle and thank you so much as I know this is just a
problem with the set up of my machine rather than your code. I've
tried to go to IT but they're not familiar with R so aren't much
use...I thought it best to get this sorted first before I come out
though, in case I need to alter something with my computer.

Cheers,
Mike


Reply to this email directly or view it on GitHub
#167 (comment).


Benjamin S. Halpern
Professor, Bren School of Environmental Science and Management
UCSB, Santa Barbara, CA 93106
(ph) 805.893.2862
halpern@bren.ucsb.edu

Chair in Marine Conservation, Imperial College London
Grand Challenges in Ecosystems and the Environment
http://www3.imperial.ac.uk/ecosystemsandenvironment

Director, Center for Marine Assessment and Planning (CMAP)
http://cmap.msi.ucsb.edu

Senior Fellow, UN Envir. Prog.- World Conserv. Monitor. Cent. (UNEP-WCMC)

Research Biologist, Nat'l. Center for Ecol. Anal. & Synth. (NCEAS)
735 State St., Suite 300, Santa Barbara, CA 93101
phone: 805.893.7470 (new as of June 25); fax: 805.892.2510


Hi Mike,

Thanks for you patience getting through this. I see a typo now in my previous script shared just with you (not from original install): forgot a closing parenthesis. I can tell because of the extra + on a newline in your copy/paste from the console which indicates the console is awaiting further code to complete the previous line.

Try this instead:

# set this path to a writable local directory (note forward slashes)
dir_local = 'C:/R'

# get scenarios and launch
require(ohicore)
get_scenarios('ohi-science/ohi-global', file.path(dir_local, 'ohi-global'))
launch_app(file.path(dir_local, 'ohi-global/eez2013'))

The good news is that the console results indicate this new local path on your C drive now works with the get_scenarios() function. Previously the tilde ~ in the path got substituted for your home directory which is //icnas1.cc.ic.ac.uk/mb4514 per your "home" folder Windows user profile settings, which must not be accessible and/or writable. Note that I casually referenced the function get_scenarios(), but you do need the additional arguments included inside as above, which explains the subsequent error you got. To get help on a function in R, I like using the ? shortcut like so:

library(ohicore)  # have to load the library containing the function first
?get_scenarios    # get help on the function

So as you suggest, I think this was an issue with your home directory setup, rather than a toolbox error per se. In future, we could add an extra line or two of code in the get_scenarios() function code to provide a comprehensible error message suggesting as much if the home directory is not available and/or writable. Will rely on @jules32 to take care of that or assign it to me to do in future as I'm currently on a dissertation "vacation".

thanks for resolving this: I will create an issue about fixing the error message.

Great thanks guys - works fine now. Do you think I will have further problems generally given the fact my home folder is not writable? It doesn't appear that I can change it myself so would it be worth to go to IT and ask them to change it?

Thanks,
Mike

Hi Mike,

I think it would be worth asking IT to change it, because I'm assuming otherwise that you won't have permission to edit existing files in that folder or add new ones? You'll need to be doing that.

Cheers,
Julie