Re: [R] withr::set_makevars

2017-09-06 Thread Roy Mendelssohn - NOAA Federal
Perfect,  thank you very much for the tip.

-Roy
> On Sep 6, 2017, at 5:26 PM, William Dunlap  wrote:
> 
> withr:::set_makevars() can give that error if the makefile named by the 
> 'old_path' argument (default "~/.R/Makevars) contains more than one 
> definition of a variable of the form 'name=value'.  You can see what file it 
> is reading and its contents by using the trace() function:
> 
> trace(withr:::set_makevars, quote({ cat(old_path, "\n"); writeLines(paste0("  
>   ", tryCatch(readLines(old_path), error=function(e)conditionMessage(e}))
> 
> Then run your test and see what file set_makevars is complaining about and 
> what in the file might cause trouble for set_makevars.
> 
> 
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com 
> On Wed, Sep 6, 2017 at 3:41 PM, Roy Mendelssohn - NOAA Federal 
> mailto:roy.mendelss...@noaa.gov>> wrote:
> Hi All;
> 
> This problem has come about from trying to learn some of the review practices 
> recommend by rOpensci.  One of them is to use the package goodpractice.  
> After installing goodpractice, it kept failing on my own packages which are 
> under development, and I was concerned something was funny in my own ,  so I 
> have a fork of the package rerddap,  and I tested goodpractice on that.  I 
> get the error:
> 
> > Error in set_makevars(new, path, makevars_file, assignment = assignment) :
> >   Multiple results for CXXFLAGS found, something is wrong.FALSE
> >
> 
> 
> So after some playing around that is from the very first test,  which uses 
> the covr:package_coverage(), and sure enough running that produces the same 
> error.  Looking at the code,  that error is being thrown by the function 
> withr::set_makevars().  We are now too many layers deep into packages for me 
> to follow what is going on,  but the kicker is Scott Chamberlain can run it 
> without any errors on the same package.  Session_info for both of us follows. 
>  If any one has any suggestions both as to what is causing this and a 
> possible solution,  would appreciate it.
> 
> Roy's sessionInfo is after running the commands:
> 
> Sys.setenv(NOT_CRAN = "true")
> x = goodpractice::gp(path = ".", checks = all_checks()[2:230])
> 
> Scott's is after running:
> 
> Sys.setenv(NOT_CRAN = "true")
> x = goodpractice::gp()
> 
> 
> 
> 
> Roy's_session_info()
> ─ Session info 
> ──
>  setting  value
>  version  R version 3.4.1 (2017-06-30)
>  os   macOS Sierra 10.12.6
>  system   x86_64, darwin15.6.0
>  ui   RStudio
>  language (EN)
>  collate  en_US.UTF-8
>  tz   America/Los_Angeles
>  date 2017-09-06
> 
> ─ Packages  package  * version date   source
>  assertthat 0.2.0   2017-04-11 CRAN (R 3.4.1)
>  backports  1.1.0   2017-05-22 CRAN (R 3.4.0)
>  callr  1.0.0.9000  2017-09-02 Github (r-lib/callr@2dffbbe)
>  clisymbols 1.2.0   2017-09-02 Github (gaborcsardi/clisymbols@e49b4f5)
>  covr   3.0.0   2017-06-26 CRAN (R 3.4.1)
>  crayon 1.3.2.9000  2017-08-25 Github (gaborcsardi/crayon@e4dba3b)
>  cyclocomp  1.1.0   2017-09-02 Github (MangoTheCat/cyclocomp@6156a12)
>  debugme1.0.2   2017-03-01 CRAN (R 3.4.0)
>  desc   1.1.1   2017-08-03 CRAN (R 3.4.1)
>  devtools   1.13.3.9000 2017-08-31 Github (hadley/devtools@91490d1)
>  digest 0.6.12  2017-01-27 CRAN (R 3.4.1)
>  goodpractice * 1.0.0   2017-09-02 Github 
> (MangoTheCat/goodpractice@9969799)
>  httr   1.3.1   2017-08-20 CRAN (R 3.4.1)
>  igraph 1.1.2   2017-07-21 CRAN (R 3.4.1)
>  jsonlite   1.5 2017-06-01 CRAN (R 3.4.0)
>  knitr  1.172017-08-10 CRAN (R 3.4.1)
>  lazyeval   0.2.0   2016-06-12 CRAN (R 3.4.0)
>  lintr  1.0.1   2017-08-10 CRAN (R 3.4.1)
>  magrittr   1.5 2014-11-22 CRAN (R 3.4.0)
>  memoise1.1.0   2017-04-21 CRAN (R 3.4.0)
>  pkgbuild   0.0.0.9000  2017-08-31 Github (r-lib/pkgbuild@6574561)
>  pkgconfig  2.0.1   2017-03-21 CRAN (R 3.4.0)
>  pkgload0.0.0.9000  2017-08-31 Github (r-pkgs/pkgload@80a6493)
>  praise 1.0.0   2015-08-11 CRAN (R 3.4.0)
>  processx   2.0.0.1 2017-07-30 CRAN (R 3.4.1)
>  R6 2.2.2   2017-06-17 CRAN (R 3.4.0)
>  rcmdcheck  1.2.1   2016-09-28 CRAN (R 3.4.0)
>  Rcpp   0.12.12 2017-07-15 CRAN (R 3.4.1)
>  remotes1.1.0   2017-07-09 CRAN (R 3.4.1)
>  rex1.1.1   2016-12-05 CRAN (R 3.4.0)
>  rlang  0.1.2.9000  2017-09-05 Github (tidyverse/rlang@fd64bce)
>  rprojroot  1.2 2017-01-16 CRAN (R 3.4.0)
>  rstudioapi 0.6.0.9000  2017-08-31 Github (rstudio/rstudioapi@e1e466b)
>  sessioninfo1.0.1   2017-08-31 Github (r-lib/sessioninfo@e813de4)
>  stringi1.1.5   2017-04-07 CRAN (R 3.4.0)
>  stringr1.2.0   2017-02-18 CRAN (

Re: [R] withr::set_makevars

2017-09-06 Thread William Dunlap via R-help
withr:::set_makevars() can give that error if the makefile named by the
'old_path' argument (default "~/.R/Makevars) contains more than one
definition of a variable of the form 'name=value'.  You can see what file
it is reading and its contents by using the trace() function:

trace(withr:::set_makevars, quote({ cat(old_path, "\n");
writeLines(paste0("", tryCatch(readLines(old_path),
error=function(e)conditionMessage(e}))

Then run your test and see what file set_makevars is complaining about and
what in the file might cause trouble for set_makevars.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Wed, Sep 6, 2017 at 3:41 PM, Roy Mendelssohn - NOAA Federal <
roy.mendelss...@noaa.gov> wrote:

> Hi All;
>
> This problem has come about from trying to learn some of the review
> practices recommend by rOpensci.  One of them is to use the package
> goodpractice.  After installing goodpractice, it kept failing on my own
> packages which are under development, and I was concerned something was
> funny in my own ,  so I have a fork of the package rerddap,  and I tested
> goodpractice on that.  I get the error:
>
> > Error in set_makevars(new, path, makevars_file, assignment = assignment)
> :
> >   Multiple results for CXXFLAGS found, something is wrong.FALSE
> >
>
>
> So after some playing around that is from the very first test,  which uses
> the covr:package_coverage(), and sure enough running that produces the same
> error.  Looking at the code,  that error is being thrown by the function
> withr::set_makevars().  We are now too many layers deep into packages for
> me to follow what is going on,  but the kicker is Scott Chamberlain can run
> it without any errors on the same package.  Session_info for both of us
> follows.  If any one has any suggestions both as to what is causing this
> and a possible solution,  would appreciate it.
>
> Roy's sessionInfo is after running the commands:
>
> Sys.setenv(NOT_CRAN = "true")
> x = goodpractice::gp(path = ".", checks = all_checks()[2:230])
>
> Scott's is after running:
>
> Sys.setenv(NOT_CRAN = "true")
> x = goodpractice::gp()
>
>
>
>
> Roy's_session_info()
> ─ Session info ──
> 
> 
>  setting  value
>  version  R version 3.4.1 (2017-06-30)
>  os   macOS Sierra 10.12.6
>  system   x86_64, darwin15.6.0
>  ui   RStudio
>  language (EN)
>  collate  en_US.UTF-8
>  tz   America/Los_Angeles
>  date 2017-09-06
>
> ─ Packages  package  * version date   source
>  assertthat 0.2.0   2017-04-11 CRAN (R 3.4.1)
>  backports  1.1.0   2017-05-22 CRAN (R 3.4.0)
>  callr  1.0.0.9000  2017-09-02 Github (r-lib/callr@2dffbbe)
>  clisymbols 1.2.0   2017-09-02 Github (gaborcsardi/clisymbols@
> e49b4f5)
>  covr   3.0.0   2017-06-26 CRAN (R 3.4.1)
>  crayon 1.3.2.9000  2017-08-25 Github (gaborcsardi/crayon@e4dba3b)
>  cyclocomp  1.1.0   2017-09-02 Github
> (MangoTheCat/cyclocomp@6156a12)
>  debugme1.0.2   2017-03-01 CRAN (R 3.4.0)
>  desc   1.1.1   2017-08-03 CRAN (R 3.4.1)
>  devtools   1.13.3.9000 2017-08-31 Github (hadley/devtools@91490d1)
>  digest 0.6.12  2017-01-27 CRAN (R 3.4.1)
>  goodpractice * 1.0.0   2017-09-02 Github (MangoTheCat/goodpractice@
> 9969799)
>  httr   1.3.1   2017-08-20 CRAN (R 3.4.1)
>  igraph 1.1.2   2017-07-21 CRAN (R 3.4.1)
>  jsonlite   1.5 2017-06-01 CRAN (R 3.4.0)
>  knitr  1.172017-08-10 CRAN (R 3.4.1)
>  lazyeval   0.2.0   2016-06-12 CRAN (R 3.4.0)
>  lintr  1.0.1   2017-08-10 CRAN (R 3.4.1)
>  magrittr   1.5 2014-11-22 CRAN (R 3.4.0)
>  memoise1.1.0   2017-04-21 CRAN (R 3.4.0)
>  pkgbuild   0.0.0.9000  2017-08-31 Github (r-lib/pkgbuild@6574561)
>  pkgconfig  2.0.1   2017-03-21 CRAN (R 3.4.0)
>  pkgload0.0.0.9000  2017-08-31 Github (r-pkgs/pkgload@80a6493)
>  praise 1.0.0   2015-08-11 CRAN (R 3.4.0)
>  processx   2.0.0.1 2017-07-30 CRAN (R 3.4.1)
>  R6 2.2.2   2017-06-17 CRAN (R 3.4.0)
>  rcmdcheck  1.2.1   2016-09-28 CRAN (R 3.4.0)
>  Rcpp   0.12.12 2017-07-15 CRAN (R 3.4.1)
>  remotes1.1.0   2017-07-09 CRAN (R 3.4.1)
>  rex1.1.1   2016-12-05 CRAN (R 3.4.0)
>  rlang  0.1.2.9000  2017-09-05 Github (tidyverse/rlang@fd64bce)
>  rprojroot  1.2 2017-01-16 CRAN (R 3.4.0)
>  rstudioapi 0.6.0.9000  2017-08-31 Github (rstudio/rstudioapi@e1e466b)
>  sessioninfo1.0.1   2017-08-31 Github (r-lib/sessioninfo@e813de4)
>  stringi1.1.5   2017-04-07 CRAN (R 3.4.0)
>  stringr1.2.0   2017-02-18 CRAN (R 3.4.0)
>  usethis0.0.0.9000  2017-08-31 Github (r-lib/usethis@12e6f95)
>  whoami 1.1.1   2015-07-13 CRAN (R 3.4.0)
>  withr  2.0.0   2017-07-28 CRAN (

Re: [R] rgdal error when trying to import raster

2017-09-06 Thread Ben Tupper
Ah, I didn't read the entire message.  Sorry about that!


> On Sep 6, 2017, at 7:20 PM, Jeff Newmiller  wrote:
> 
> Indeed, Ben, but the question was something more like it is not a Dependency, 
> just Suggested, so why the error...
> 
> John:
> 
> If you read the Introduction to the 'raster' package vignette, it indicates 
> that some input formats are supported within the raster package and some rely 
> on other packages. Clearly the attempt to read a TIFF was an example of the 
> latter. Had you used a different input file format the issue of rgdal might 
> never have appeared... ergo, Suggests rather than Depends. 
> 
> Note that someone may feel pity for your plight, John, and give you a 
> convenient alternative way to import the data to raster (there are other 
> packages that read TIFF but you would probably have to roll the geolocation 
> yourself... an avenue for which help would be better pursued on R-sig-geo), 
> but the premise of your email (cannot upgrade) does put it squarely in the 
> off-topic category according to the Posting Guide. Fortunately R is 
> open-source so if you are diligent you can write/borrow R code as needed or 
> even recompile R and necessary packages entirely within your personal 
> development directories with no system installation to bother your sysadmin 
> about... but you might also just go find another computer to do your work on.
> -- 
> Sent from my phone. Please excuse my brevity.
> 
> On September 6, 2017 3:29:41 PM PDT, Ben Tupper  wrote:
>> Hi,
>> 
>> The message "there is no package called 'rgdal'" means that you don't
>> have rgdal installed.
>> 
>> https://cran.r-project.org/web/packages/rgdal/index.html
>> 
>> Also, you will get very good patial-centric help if you subscribed to
>> r-sig-geo here
>> 
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>> 
>> Cheers,
>> Ben
>> 
>> 
>> 
>>> On Sep 6, 2017, at 2:52 PM, john polo  wrote:
>>> 
>>> Dear useRs,
>>> 
>>> I am trying to import a raster with the line:
>>> 
>>> nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif")
>>> 
>>> And I keep getting an error like this:
>>> 
>>> "Warning message:
>>> In library(package, lib.loc = lib.loc, character.only = TRUE,
>> logical.return = TRUE,  :
>>>  there is no package called 'rgdal'
>>> Error in .rasterObjectFromFile(x, band = band, objecttype =
>> "RasterLayer",  :
>>>  Cannot create RasterLayer object from this file; perhaps you need
>> to install rgdal first
>>> Calls: raster -> raster -> .local -> .rasterObjectFromFile
>>> Execution halted"
>>> 
>>> This is the session info:
>>> 
>>> "R version 3.2.5 (2016-04-14)
>>> Platform: x86_64-pc-linux-gnu (64-bit)
>>> Running under: CentOS release 6.3 (Final)
>>> 
>>> locale:
>>> [1] C
>>> 
>>> attached base packages:
>>> [1] methods   stats graphics  grDevices utils datasets  base
>>> 
>>> other attached packages:
>>> [1] raster_2.5-8 sp_1.2-4 rgeos_0.3-23
>>> 
>>> loaded via a namespace (and not attached):
>>> [1] Rcpp_0.12.10grid_3.2.5  lattice_0.20-35 "
>>> 
>>> I know the R version is old, but this is a system that I can not
>> update, I have no control over it. Because the version of R is old, the
>> admin told me that they cannot install rgdal. I am not using
>> library(rgdal) and none of the other libraries that are loaded require
>> rgdal. The package raster does suggest it though. Is that causing the
>> problem? Is there a way to avoid this? Any help is welcome.
>>> 
>>> best,
>>> 
>>> John
>>> 
>>> 
>>> -- 
>>> "Ask a man to be quiet,
>>> and he'll be silent for a moment.
>>> Feed a man to a red dragon
>>> and he'll be silent for a lifetime."
>>> -Anne Isabella Thackeray Ritchie
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
>> Ben Tupper
>> Bigelow Laboratory for Ocean Sciences
>> 60 Bigelow Drive, P.O. Box 380
>> East Boothbay, Maine 04544
>> http://www.bigelow.org
>> 
>> Ecocast Reports: http://seascapemodeling.org/ecocast.html
>> Tick Reports: https://report.bigelow.org/tick/
>> Jellyfish Reports: https://jellyfish.bigelow.org/jellyfish/
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecocast Reports: http://seascapemodeling.org/ecocast.html
Tick Reports: https://report.bigelow.org/tick/
Jellyfish Reports: https://jellyfish.bigelow.org/jellyfish/

__
R-help@r-pro

Re: [R] rgdal error when trying to import raster

2017-09-06 Thread Jeff Newmiller
Indeed, Ben, but the question was something more like it is not a Dependency, 
just Suggested, so why the error...

John:

If you read the Introduction to the 'raster' package vignette, it indicates 
that some input formats are supported within the raster package and some rely 
on other packages. Clearly the attempt to read a TIFF was an example of the 
latter. Had you used a different input file format the issue of rgdal might 
never have appeared... ergo, Suggests rather than Depends. 

Note that someone may feel pity for your plight, John, and give you a 
convenient alternative way to import the data to raster (there are other 
packages that read TIFF but you would probably have to roll the geolocation 
yourself... an avenue for which help would be better pursued on R-sig-geo), but 
the premise of your email (cannot upgrade) does put it squarely in the 
off-topic category according to the Posting Guide. Fortunately R is open-source 
so if you are diligent you can write/borrow R code as needed or even recompile 
R and necessary packages entirely within your personal development directories 
with no system installation to bother your sysadmin about... but you might also 
just go find another computer to do your work on.
-- 
Sent from my phone. Please excuse my brevity.

On September 6, 2017 3:29:41 PM PDT, Ben Tupper  wrote:
>Hi,
>
>The message "there is no package called 'rgdal'" means that you don't
>have rgdal installed.
>
>https://cran.r-project.org/web/packages/rgdal/index.html
>
>Also, you will get very good patial-centric help if you subscribed to
>r-sig-geo here
>
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>Cheers,
>Ben
>
>
>
>> On Sep 6, 2017, at 2:52 PM, john polo  wrote:
>> 
>> Dear useRs,
>> 
>> I am trying to import a raster with the line:
>> 
>> nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif")
>> 
>> And I keep getting an error like this:
>> 
>> "Warning message:
>> In library(package, lib.loc = lib.loc, character.only = TRUE,
>logical.return = TRUE,  :
>>   there is no package called 'rgdal'
>> Error in .rasterObjectFromFile(x, band = band, objecttype =
>"RasterLayer",  :
>>   Cannot create RasterLayer object from this file; perhaps you need
>to install rgdal first
>> Calls: raster -> raster -> .local -> .rasterObjectFromFile
>> Execution halted"
>> 
>> This is the session info:
>> 
>> "R version 3.2.5 (2016-04-14)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: CentOS release 6.3 (Final)
>> 
>> locale:
>> [1] C
>> 
>> attached base packages:
>> [1] methods   stats graphics  grDevices utils datasets  base
>> 
>> other attached packages:
>> [1] raster_2.5-8 sp_1.2-4 rgeos_0.3-23
>> 
>> loaded via a namespace (and not attached):
>> [1] Rcpp_0.12.10grid_3.2.5  lattice_0.20-35 "
>> 
>> I know the R version is old, but this is a system that I can not
>update, I have no control over it. Because the version of R is old, the
>admin told me that they cannot install rgdal. I am not using
>library(rgdal) and none of the other libraries that are loaded require
>rgdal. The package raster does suggest it though. Is that causing the
>problem? Is there a way to avoid this? Any help is welcome.
>> 
>> best,
>> 
>> John
>> 
>> 
>> -- 
>> "Ask a man to be quiet,
>> and he'll be silent for a moment.
>> Feed a man to a red dragon
>> and he'll be silent for a lifetime."
>> -Anne Isabella Thackeray Ritchie
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>Ben Tupper
>Bigelow Laboratory for Ocean Sciences
>60 Bigelow Drive, P.O. Box 380
>East Boothbay, Maine 04544
>http://www.bigelow.org
>
>Ecocast Reports: http://seascapemodeling.org/ecocast.html
>Tick Reports: https://report.bigelow.org/tick/
>Jellyfish Reports: https://jellyfish.bigelow.org/jellyfish/
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] withr::set_makevars

2017-09-06 Thread Roy Mendelssohn - NOAA Federal
Hi All;

This problem has come about from trying to learn some of the review practices 
recommend by rOpensci.  One of them is to use the package goodpractice.  After 
installing goodpractice, it kept failing on my own packages which are under 
development, and I was concerned something was funny in my own ,  so I have a 
fork of the package rerddap,  and I tested goodpractice on that.  I get the 
error:

> Error in set_makevars(new, path, makevars_file, assignment = assignment) : 
>   Multiple results for CXXFLAGS found, something is wrong.FALSE
> 


So after some playing around that is from the very first test,  which uses the 
covr:package_coverage(), and sure enough running that produces the same error.  
Looking at the code,  that error is being thrown by the function 
withr::set_makevars().  We are now too many layers deep into packages for me to 
follow what is going on,  but the kicker is Scott Chamberlain can run it 
without any errors on the same package.  Session_info for both of us follows.  
If any one has any suggestions both as to what is causing this and a possible 
solution,  would appreciate it.

Roy's sessionInfo is after running the commands:

Sys.setenv(NOT_CRAN = "true") 
x = goodpractice::gp(path = ".", checks = all_checks()[2:230])

Scott's is after running:

Sys.setenv(NOT_CRAN = "true") 
x = goodpractice::gp()




Roy's_session_info()
─ Session info 
──
 setting  value   
 version  R version 3.4.1 (2017-06-30)
 os   macOS Sierra 10.12.6
 system   x86_64, darwin15.6.0
 ui   RStudio 
 language (EN)
 collate  en_US.UTF-8 
 tz   America/Los_Angeles 
 date 2017-09-06  

─ Packages  package  * version date   source
   
 assertthat 0.2.0   2017-04-11 CRAN (R 3.4.1)   
 backports  1.1.0   2017-05-22 CRAN (R 3.4.0)   
 callr  1.0.0.9000  2017-09-02 Github (r-lib/callr@2dffbbe) 
 clisymbols 1.2.0   2017-09-02 Github (gaborcsardi/clisymbols@e49b4f5)  
 covr   3.0.0   2017-06-26 CRAN (R 3.4.1)   
 crayon 1.3.2.9000  2017-08-25 Github (gaborcsardi/crayon@e4dba3b)  
 cyclocomp  1.1.0   2017-09-02 Github (MangoTheCat/cyclocomp@6156a12)   
 debugme1.0.2   2017-03-01 CRAN (R 3.4.0)   
 desc   1.1.1   2017-08-03 CRAN (R 3.4.1)   
 devtools   1.13.3.9000 2017-08-31 Github (hadley/devtools@91490d1) 
 digest 0.6.12  2017-01-27 CRAN (R 3.4.1)   
 goodpractice * 1.0.0   2017-09-02 Github (MangoTheCat/goodpractice@9969799)
 httr   1.3.1   2017-08-20 CRAN (R 3.4.1)   
 igraph 1.1.2   2017-07-21 CRAN (R 3.4.1)   
 jsonlite   1.5 2017-06-01 CRAN (R 3.4.0)   
 knitr  1.172017-08-10 CRAN (R 3.4.1)   
 lazyeval   0.2.0   2016-06-12 CRAN (R 3.4.0)   
 lintr  1.0.1   2017-08-10 CRAN (R 3.4.1)   
 magrittr   1.5 2014-11-22 CRAN (R 3.4.0)   
 memoise1.1.0   2017-04-21 CRAN (R 3.4.0)   
 pkgbuild   0.0.0.9000  2017-08-31 Github (r-lib/pkgbuild@6574561)  
 pkgconfig  2.0.1   2017-03-21 CRAN (R 3.4.0)   
 pkgload0.0.0.9000  2017-08-31 Github (r-pkgs/pkgload@80a6493)  
 praise 1.0.0   2015-08-11 CRAN (R 3.4.0)   
 processx   2.0.0.1 2017-07-30 CRAN (R 3.4.1)   
 R6 2.2.2   2017-06-17 CRAN (R 3.4.0)   
 rcmdcheck  1.2.1   2016-09-28 CRAN (R 3.4.0)   
 Rcpp   0.12.12 2017-07-15 CRAN (R 3.4.1)   
 remotes1.1.0   2017-07-09 CRAN (R 3.4.1)   
 rex1.1.1   2016-12-05 CRAN (R 3.4.0)   
 rlang  0.1.2.9000  2017-09-05 Github (tidyverse/rlang@fd64bce) 
 rprojroot  1.2 2017-01-16 CRAN (R 3.4.0)   
 rstudioapi 0.6.0.9000  2017-08-31 Github (rstudio/rstudioapi@e1e466b)  
 sessioninfo1.0.1   2017-08-31 Github (r-lib/sessioninfo@e813de4)   
 stringi1.1.5   2017-04-07 CRAN (R 3.4.0)   
 stringr1.2.0   2017-02-18 CRAN (R 3.4.0)   
 usethis0.0.0.9000  2017-08-31 Github (r-lib/usethis@12e6f95)   
 whoami 1.1.1   2015-07-13 CRAN (R 

Re: [R] rgdal error when trying to import raster

2017-09-06 Thread Ben Tupper
Hi,

The message "there is no package called 'rgdal'" means that you don't have 
rgdal installed.

https://cran.r-project.org/web/packages/rgdal/index.html

Also, you will get very good patial-centric help if you subscribed to r-sig-geo 
here

https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Cheers,
Ben



> On Sep 6, 2017, at 2:52 PM, john polo  wrote:
> 
> Dear useRs,
> 
> I am trying to import a raster with the line:
> 
> nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif")
> 
> And I keep getting an error like this:
> 
> "Warning message:
> In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return 
> = TRUE,  :
>   there is no package called 'rgdal'
> Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  :
>   Cannot create RasterLayer object from this file; perhaps you need to 
> install rgdal first
> Calls: raster -> raster -> .local -> .rasterObjectFromFile
> Execution halted"
> 
> This is the session info:
> 
> "R version 3.2.5 (2016-04-14)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: CentOS release 6.3 (Final)
> 
> locale:
> [1] C
> 
> attached base packages:
> [1] methods   stats graphics  grDevices utils datasets  base
> 
> other attached packages:
> [1] raster_2.5-8 sp_1.2-4 rgeos_0.3-23
> 
> loaded via a namespace (and not attached):
> [1] Rcpp_0.12.10grid_3.2.5  lattice_0.20-35 "
> 
> I know the R version is old, but this is a system that I can not update, I 
> have no control over it. Because the version of R is old, the admin told me 
> that they cannot install rgdal. I am not using library(rgdal) and none of the 
> other libraries that are loaded require rgdal. The package raster does 
> suggest it though. Is that causing the problem? Is there a way to avoid this? 
> Any help is welcome.
> 
> best,
> 
> John
> 
> 
> -- 
> "Ask a man to be quiet,
> and he'll be silent for a moment.
> Feed a man to a red dragon
> and he'll be silent for a lifetime."
> -Anne Isabella Thackeray Ritchie
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecocast Reports: http://seascapemodeling.org/ecocast.html
Tick Reports: https://report.bigelow.org/tick/
Jellyfish Reports: https://jellyfish.bigelow.org/jellyfish/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] rgdal error when trying to import raster

2017-09-06 Thread john polo

Dear useRs,

I am trying to import a raster with the line:

nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif")

And I keep getting an error like this:

"Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, 
logical.return = TRUE,  :

  there is no package called 'rgdal'
Error in .rasterObjectFromFile(x, band = band, objecttype = 
"RasterLayer",  :
  Cannot create RasterLayer object from this file; perhaps you need to 
install rgdal first

Calls: raster -> raster -> .local -> .rasterObjectFromFile
Execution halted"

This is the session info:

"R version 3.2.5 (2016-04-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.3 (Final)

locale:
[1] C

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

other attached packages:
[1] raster_2.5-8 sp_1.2-4 rgeos_0.3-23

loaded via a namespace (and not attached):
[1] Rcpp_0.12.10    grid_3.2.5  lattice_0.20-35 "

I know the R version is old, but this is a system that I can not update, 
I have no control over it. Because the version of R is old, the admin 
told me that they cannot install rgdal. I am not using library(rgdal) 
and none of the other libraries that are loaded require rgdal. The 
package raster does suggest it though. Is that causing the problem? Is 
there a way to avoid this? Any help is welcome.


best,

John


--
"Ask a man to be quiet,
and he'll be silent for a moment.
Feed a man to a red dragon
and he'll be silent for a lifetime."
-Anne Isabella Thackeray Ritchie

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Using quantmod to obtain current Dow Jones index

2017-09-06 Thread Dennis Fisher
R 3.4.1
OS X

Colleagues,

I am just learning to use the quantmod package and I have encountered something 
that I don’t understand.

This works:
getSymbols("^DJI") 

This does not work:
getQuote("^DJI”)
It returns only NAs:
Trade Time Last Change % Change Open High Low Volume 
^DJI  N/A N/A N/A N/A N/A N/A N/A 

Two questions:
1.  Is there some way to obtain the current DJI using quantmod?
2.  If not, can someone suggest alternatives?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Help

2017-09-06 Thread manoj oak via R-help
Hello,
I want to analysis of NIR spectra and develop prediction models using pls, 
mpls, pcr statics.  I used inspectr package, processed and modified the 
spectra, but how i do the prediction using packages pls and caret do not know. 
If some one is ready to do the help I will appreciate it. 
with best regardsManoj Oak  

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Interesting behavior of lm() with small, problematic data sets

2017-09-06 Thread JRG
Indeed (version-specific).

With R 3.4.1 on linux, I get coefficients and residuals that are
numerically exact, F-statistic = NaN, p-value = NA, R-squared = NaN, etc.

All of which is what ought to happen, given that the response variable
(y) is not actually variable.


---JRG
John R. Gleason


On 09/06/2017 09:10 AM, S Ellison wrote:
>> I think what you're seeing is
>> https://en.wikipedia.org/wiki/Loss_of_significance.
> 
> Almost. 
> All the results in the OP's summary are reflections of finite precision in 
> the analytically exact solution, leading to residuals smaller than the double 
> precision limit. The summary is correctly warning that it's all potentially 
> nonsense, and indeed the only things you can trust are the coefficient values 
> (to within .Machine$double.eps or thereabouts)
> 
> Interestingly, though, my current version of R (3.4.0) gives numerically 
> exact coefficients (c(1,0) and identically zero standard errors.
> 
> So this particular example is apparently version-specific.
> 
> S Ellison
> 
> 
> ***
> This email and any attachments are confidential. Any use...{{dropped:8}}
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Interesting behavior of lm() with small, problematic data sets

2017-09-06 Thread S Ellison
> I think what you're seeing is
> https://en.wikipedia.org/wiki/Loss_of_significance.

Almost. 
All the results in the OP's summary are reflections of finite precision in the 
analytically exact solution, leading to residuals smaller than the double 
precision limit. The summary is correctly warning that it's all potentially 
nonsense, and indeed the only things you can trust are the coefficient values 
(to within .Machine$double.eps or thereabouts)

Interestingly, though, my current version of R (3.4.0) gives numerically exact 
coefficients (c(1,0) and identically zero standard errors.

So this particular example is apparently version-specific.

S Ellison


***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] post_processor in rmarkdown not working

2017-09-06 Thread Thierry Onkelinx
Dear all,

I'm trying to write a post_processor() for a custom rmarkdown format. The
goal of the post_processor() is to modify the latex file before it is
compiled. For some reason the post_processor() is not run. The
post_processor() does work when I run it manually on the tex file.

Any suggestions on what I'm doing wrong? Below is the relevant snippet of
the code. The full code is available at
https://github.com/inbo/INBOmd/blob/post_processor/R/rsos_article.R
https://github.com/inbo/INBOmd/blob/post_processor/inst/rmarkdown/templates/rsos_article/skeleton/skeleton.Rmd
is an Rmd is a MWE that fails compile because the post_processor() is not
run.

Best regards,

Thierry

  post_processor <- function(
metadata, input_file, output_file, clean, verbose
  ) {
text <- readLines(output_file, warn = FALSE)

# set correct text in fmtext environment
end_first_page <- grep("EndFirstPage", text) #nolint
if (length(end_first_page) == 1) {
  maketitle <- grep("maketitle", text) #nolint
  text <- c(
text[1:(maketitle - 1)],
"\\begin{fmtext}",
text[(maketitle + 1):(end_first_page - 1)],
"\\end{fmtext}",
"\\maketitle",
text[(end_first_page + 1):length(text)]
  )
  writeLines(enc2utf8(text), output_file, useBytes = TRUE)
}
output_file
  }

  output_format(
knitr = knitr_options(
  opts_knit = list(
width = 60,
concordance = TRUE
  ),
  opts_chunk = opts_chunk,
  knit_hooks = knit_hooks
),
pandoc = pandoc_options(
  to = "latex",
  latex_engine = "xelatex",
  args = args,
  keep_tex = keep_tex
),
post_processor = post_processor,
clean_supporting = !keep_tex
  )



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.