Re: [R] NULL dev.lis()

2015-11-09 Thread Pascal Oettli via R-help
Martin,

Sorry, but what are you talking about ? Of course I know it is normal
to get this result. It is what I explained in my message!

Regards,
Pascal

On Mon, Nov 9, 2015 at 6:19 PM, Martin Maechler
<maech...@stat.math.ethz.ch> wrote:
>>>>>> Pascal Oettli via R-help <r-help@r-project.org>
>>>>>> on Mon, 9 Nov 2015 14:18:37 +0900 writes:
>
> > Dear Tom,
> > Running R 3.2.2 on Ubuntu 15.04, if I run dev.list(), I get NULL.
>
> Yes, indeed with all "regular" / "default" versions of R.
>
> I you don't get that, you must have set something user-specific,
> or possibly site-specific if you have a particularly customized site
> maintainer setup.
>
> Read
>?Startup
>?options
>
> etc.
>
> > And I guess it is the expected behavior, as per the help page, it 
> "returns
> > the numbers of all open devices, except device 1, the null device".
> > So, if I run
>
> > x11()
> > dev.list()
>
> > I get
>
> > X11cairo
> > 2
>
> > HTH,
> > Pascal
>
> > On Mon, Nov 9, 2015 at 1:03 PM, Thomas Adams <tea...@gmail.com> wrote:
> >> All,
> >>
> >> I have previous built R from source many times, generally, without
> >> problems. However on my new Ubuntu 15.04 Linux system with R 3.2.2 
> when I
> >> run the command dev.list() I get:
> >>
> >>> dev.list()
> >> NULL
> >>
> >> At the completion of running ./configure, I have
> >>
> >> R is now configured for x86_64-pc-linux-gnu
> >>
> >> Source directory:  .
> >> Installation directory:/usr/local
> >>
> >> C compiler:gcc -std=gnu99  -g -O2
> >> Fortran 77 compiler:   gfortran  -g -O2
> >>
> >> C++ compiler:  g++  -g -O2
> >> C++ 11 compiler:   g++  -std=c++11 -g -O2
> >> Fortran 90/95 compiler:gfortran -g -O2
> >> Obj-C compiler:
> >>
> >> Interfaces supported:  X11
> >> External libraries:readline, zlib, lzma, PCRE, curl
> >> Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
> >> Options enabled:   shared BLAS, R profiling
> >>
> >> Capabilities skipped:
> >> Options not enabled:   memory profiling
> >>
> >> Recommended packages:  yes
> >>
> >> This issue is causing me problems with spplot, which I have posted on
> >> r-sig-geo. R and the display of all other graphics seems to be fine,
> >> otherwise. My previous installations of R would yield:
> >>
> >>> dev.list()
>     >> X11cairo
> >> 2
> >>
> >> And I had no problems with spplot. Any thoughts?
> >>
> >> Regards,
> >> Tom
> >>
> >> [[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.
>
>
>
> > --
> > Pascal Oettli
> > Project Scientist
> > JAMSTEC
> > Yokohama, Japan
>
> > __
> > 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] NULL dev.lis()

2015-11-08 Thread Pascal Oettli via R-help
Dear Tom,

Running R 3.2.2 on Ubuntu 15.04, if I run dev.list(), I get NULL. And
I guess it is the expected behavior, as per the help page, it "returns
the numbers of all open devices, except device 1, the null device".
So, if I run

x11()
dev.list()

I get

X11cairo
   2

HTH,
Pascal

On Mon, Nov 9, 2015 at 1:03 PM, Thomas Adams <tea...@gmail.com> wrote:
> All,
>
> I have previous built R from source many times, generally, without
> problems. However on my new Ubuntu 15.04 Linux system with R 3.2.2 when I
> run the command dev.list() I get:
>
>> dev.list()
> NULL
>
> At the completion of running ./configure, I have
>
> R is now configured for x86_64-pc-linux-gnu
>
>   Source directory:  .
>   Installation directory:/usr/local
>
>   C compiler:gcc -std=gnu99  -g -O2
>   Fortran 77 compiler:   gfortran  -g -O2
>
>   C++ compiler:  g++  -g -O2
>   C++ 11 compiler:   g++  -std=c++11 -g -O2
>   Fortran 90/95 compiler:gfortran -g -O2
>   Obj-C compiler:
>
>   Interfaces supported:  X11
>   External libraries:readline, zlib, lzma, PCRE, curl
>   Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
>   Options enabled:   shared BLAS, R profiling
>
>   Capabilities skipped:
>   Options not enabled:   memory profiling
>
>   Recommended packages:  yes
>
> This issue is causing me problems with spplot, which I have posted on
> r-sig-geo. R and the display of all other graphics seems to be fine,
> otherwise. My previous installations of R would yield:
>
>> dev.list()
> X11cairo
>2
>
> And I had no problems with spplot. Any thoughts?
>
> Regards,
> Tom
>
> [[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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Changing text file to .r format

2015-11-06 Thread Pascal Oettli via R-help
For reference, also asked here:
http://stackoverflow.com/questions/33569737/unable-to-call-a-function-in-r


On Sat, Nov 7, 2015 at 4:22 AM, Chattopadhyay, Somsubhra
<sch...@g.uky.edu> wrote:
> Dear all,
>
> I am a beginner in R and want to ask a simple question. I have a code file
> in text format which I need to change to .r format only. For example now it
> is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I tried
> this
>
> sub("^([^.]*).*", "\\1", 'RHtestsV4.r.txt')
> [1] "RHtestsV4"
>
> But this didn't seem to work as again when I try to call the function using
> source("RHtestsV4.r")
> The error message is
>
> Error in file(filename, "r", encoding = encoding) :
>   cannot open the connection
> In addition: Warning message:
> In file(filename, "r", encoding = encoding) :
>   cannot open file 'RHtestsV4.r': No such file or directory
>
> I think it is due to the format of the file. Please help me to convert the
> file to .r format.
>
> Thanks
> Som
> --
> Somsubhra Chattopadhyay
> Graduate Research Assistant
> Biosystem and Agricultural Engineering Department
> University of Kentucky, Lexington, KY 40546
> Email: schatto...@uky.edu
> Cell: 9198026951
>
> [[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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Strange Bug in R

2015-10-06 Thread Pascal Oettli
Hello,

1) Please don't put rm(list=ls()) in a script you submit to this list.
This is considered as bad manner.

2) Please read 
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
and http://stackoverflow.com/a/9508558/3710546

Regards,
Pascal

On Tue, Oct 6, 2015 at 4:24 PM, Neverstop <nevers...@hotmail.it> wrote:
> Hi all.
> I don't understand why R works this way:
>> rm(list=ls())
>> require(foreign)
>> dataset <- read.dta("http://www.ats.ucla.edu/stat/data/ologit.dta;)
>> min(dataset$gpa)
> [1] 1.9
>> min(dataset$gpa)>=1.90
> [1] FALSE
>> min(dataset$gpa)>=1.9
> [1] FALSE
>> min(dataset$gpa)>1.89
> [1] TRUE
> Shouldn't I get 3 TRUEs?
> Am I missing something?
> Thank you.
>
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Strange-Bug-in-R-tp4713175.html
> Sent from the R help mailing list archive at Nabble.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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] FlexBayes installation from R-Forge Problem R 3.2.2

2015-09-28 Thread Pascal Oettli
You misspelled the web address. It is "R-project", not "R.project".
Thus, the command line should be:

install.packages("FlexBayes", repos="http://R-Forge.R-project.org;)

Regards,
Pascal

On Mon, Sep 28, 2015 at 9:17 AM, Davidwkatz <dk...@tibco.com> wrote:
> I tried to install FlexBayes like this:
>
> install.packages("FlexBayes", repos="http://R-Forge.R.project.org;) but got
> errors:
>
> Here's the transcript in R:
>
> R version 3.2.2 (2015-08-14) -- "Fire Safety"
> Copyright (C) 2015 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("FlexBayes", repos="http://R-Forge.R.project.org;)
> Installing package into ‘C:/Users/dkatz/R/win-library/3.2’
> (as ‘lib’ is unspecified)
> Error: Line starting '
>
> Any help will be much appreciated!
>
> Thanks,
>
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/FlexBayes-installation-from-R-Forge-Problem-R-3-2-2-tp4712861.html
> Sent from the R help mailing list archive at Nabble.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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Bug in raster projectRaster?

2015-06-02 Thread Pascal Oettli
Wrong list. This should have been posted here: r-sig-...@r-project.org

Regards,
Pascal

On Tue, Jun 2, 2015 at 7:56 AM, Mauricio Romero
mauricioromerolond...@gmail.com wrote:
 Hi,

 I'm sorry I cant post a reproducible example, but the data sets involve are
 too large. I'm currently trying to create a mosaic from 2 different Landsat
 7 scenes. One of them is in UTM 18 and the other in UTM 17. Before using
 the mosaic command, I'm doing

 LandsatTransform=projectRaster(from=LandsatUTM17, to=LandsatUTM18)

 but i get a raster that is full of NAs and the following warning message

 Warning message:
 In .rasterFromRasterFile(grdfile, band = band, objecttype, ...) :
   size of values file does not match the number of cells (given the data
 type)

 Not sure what to do. Any help is really appreciated.

 Thanks,

 Mauricio

 [[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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Simulating a time series with a given spectrum

2015-05-27 Thread Pascal Oettli
On Thu, May 28, 2015 at 12:54 AM, Roy Mendelssohn - NOAA Federal
roy.mendelss...@noaa.gov wrote:
 Hi All:

 Is there a routine in R that allows me to simulate a time series that has a 
 given spectrum?  I have looked at the R Time Series Task view, and have done 
 a web search also, including an article to appear in the handbook of 
 statistics on time series in R, but I don’t see anything offhand.  There are 
 some that will simulate state-space models or for given covariances matrices, 
 but for a variety of reasons I would prefer simulating series with a given 
 spectrum.


Not sure it will totally answer your question, but if you are
interested in simulating random time series having the same power
spectrum but random phases as an input time series, you can visit this
website 
(http://iri.columbia.edu/~vincent/matlab_function_version1/function_matlab.htm).
There is a Matlab function called ebisuzaki
(http://iri.columbia.edu/~vincent/matlab_function_version1/ebisuzaki.htm),
which performs this. Of course, this implies you already have a time
series of known spectrum. This function can easily be rewritten in R.


 Thanks for any help.

 -Roy


 **
 The contents of this message do not reflect any position of the U.S. 
 Government or NOAA.
 **
 Roy Mendelssohn
 Supervisory Operations Research Analyst
 NOAA/NMFS
 Environmental Research Division
 Southwest Fisheries Science Center
 ***Note new address and phone***
 110 Shaffer Road
 Santa Cruz, CA 95060
 Phone: (831)-420-3666
 Fax: (831) 420-3980
 e-mail: roy.mendelss...@noaa.gov www: http://www.pfeg.noaa.gov/

 Old age and treachery will overcome youth and skill.
 From those who have been given much, much will be expected
 the arc of the moral universe is long, but it bends toward justice -MLK Jr.

 __
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Variance-covariance matrix

2015-05-11 Thread Pascal Oettli
Hi Giorgio,

No need for a package. Please check function var (?var).

Regards,
Pascal


On Mon, May 11, 2015 at 3:17 PM, Giorgio Garziano
giorgio.garzi...@ericsson.com wrote:
 Hi Tsjerk,

 Yes, I understand your point. Thanks for drawing my attention on that aspect.

 Let me then rephrase my question.

 I would need some R package function able to compute the variance-covariance 
 matrix
 for multivariate series as defined at:

 http://stattrek.com/matrix-algebra/covariance-matrix.aspx


 About what outlined in the book reference I mentioned, I shall open a 
 separate thread
 in the case.

 Thanks.

 ---

 Giorgio

 Genoa, Italy

 From: Tsjerk Wassenaar [mailto:tsje...@gmail.com]
 Sent: domenica 10 maggio 2015 22:31
 To: Giorgio Garziano
 Cc: r-help@r-project.org
 Subject: Re: [R] Variance-covariance matrix

 Hi Giorgio,

 This is for a multivariate time series. x1 is variable 1 of the observation 
 vector x, x2, variable 2, etc. If you need x(i) and x(i+1), etc, then you're 
 looking for the autocovariance/autocorrelation matrix, which is a quite 
 different thing (and David showed the way). You can easily see that you don't 
 have N-1 degrees of freedom per entry, because you have fewer 'observations' 
 for larger lag times.

 Cheers,

 Tsjerk



 On Sun, May 10, 2015 at 10:25 PM, Giorgio Garziano 
 giorgio.garzi...@ericsson.commailto:giorgio.garzi...@ericsson.com wrote:
 Hi Tsjerk,

 Yes, seriously.

 Time series:

 X = [x1, x2, x3, ,xn]

 The variance-covariance matrix is V matrix:

 V=


 Σ x12 / (N-1)

 Σ x1 x2 / (N-1)

 . . .

 Σ x1 xn / (N-1)

 Σ x2 x1 / (N-1)

 Σ x22 / (N-1)

 . . .

 Σ x2 xn / (N-1)

 . . .

 . . .

 . . .

 . . .

 Σ xn x1 / (N-1)

 Σ xn x2 / (N-1)

 . . .

 Σ xn2 / (N-1)




 Reference: “Time series and its applications – with R examples”, Springer,
  $7.8 “Principal Components” pag. 468, 469

 Cheers,

 Giorgio


 From: Tsjerk Wassenaar [mailto:tsje...@gmail.commailto:tsje...@gmail.com]
 Sent: domenica 10 maggio 2015 22:11

 To: Giorgio Garziano
 Cc: r-help@r-project.orgmailto:r-help@r-project.org
 Subject: Re: [R] Variance-covariance matrix

 Hi Giorgio,

 For a univariate time series? Seriously?

 data - rnorm(10,2,1)
 as.matrix(var(data))

 Cheers,

 Tsjerk


 On Sun, May 10, 2015 at 9:54 PM, Giorgio Garziano 
 giorgio.garzi...@ericsson.commailto:giorgio.garzi...@ericsson.com wrote:
 Hi,

 Actually as variance-covariance matrix I mean:

 http://stattrek.com/matrix-algebra/covariance-matrix.aspx

 that I compute by:

 data - rnorm(10,2,1)
 n - length(data)
 data.center - scale(data, center=TRUE, scale=FALSE)
 var.cov.mat - (1/(n-1)) * data.center %*% t(data.center)

 --
 Giorgio Garziano


 -Original Message-
 From: David Winsemius 
 [mailto:dwinsem...@comcast.netmailto:dwinsem...@comcast.net]
 Sent: domenica 10 maggio 2015 21:27
 To: Giorgio Garziano
 Cc: r-help@r-project.orgmailto:r-help@r-project.org
 Subject: Re: [R] Variance-covariance matrix


 On May 10, 2015, at 4:27 AM, Giorgio Garziano wrote:

 Hi,

 I am looking for a R package providing with variance-covariance matrix 
 computation of univariate time series.

 Please, any suggestions ?

 If you mean the auto-correlation function, then the stats package (loaded by 
 default at startup) has facilities:

 ?acf
 # also same help page describes partial auto-correlation function
 #Auto- and Cross- Covariance and -Correlation Function Estimation

 --

 David Winsemius
 Alameda, CA, USA

 __
 R-help@r-project.orgmailto: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.



 --
 Tsjerk A. Wassenaar, Ph.D.



 --
 Tsjerk A. Wassenaar, Ph.D.

 [[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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Rstudio R-devel libR.so

2015-03-09 Thread Pascal Oettli
Hello,

There is a dedicated support to RStudio here: https://support.rstudio.com

Regards,
Pascal

On Mon, Mar 9, 2015 at 7:41 PM, Karim Mezhoud kmezh...@gmail.com wrote:
 Dear All,
 I am actually on R-devel using shell consol. When I run RStudio, it can't
 find libR.so in the new /lib folder where is libRblas.so  libRlapack.so.
 At first step I configure R-devel to share library with ./configure
 --enable-R-shlib.

 when I copied libR.so from  /usr/lib/R/lib/libR.so (stable version R 3.1)
 to /usr/local/R-devel/lib/libR.so (R-devel version), That doesn't work.

 please find the detail  at below.
 Karim mezhoud




 $which R
 /usr/bin/R
 $R
 R.Version()[13]
 $version.string
 [1] R version 3.1.2 (2014-10-31)

 Sys.getenv(R_HOME)
 [1] /usr/lib/R

 .Library
 [1] /usr/lib/R/library
 .libPaths()
 [1] /home/mezhoud/R/x86_64-pc-linux-gnu-library/3.1
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library
 


 $sudo apt-get build-dep r-base
 $sudo apt-get install subversion ccache
 $mkdir ~/svn/
 $cd ~/svn/
 $svn co https://svn.r-project.org/R/trunk r-devel/R

 $cd /svn/r-devel/R
 $./configure --enable-R-shlib
 $make
 $make check
 $sudo make install rhome=/usr/local/R-devel

 $which R
 /usr/local/bin/R

 $cd /usr/local/bin
 $R

R.Version()[13]
 $version.string
 [1] R Under development (unstable) (2015-03-07 r67951)

 .libPaths()
 [1] /usr/local/R-devel/library
 .Library
 [1] /usr/local/R-devel/library

 Sys.getenv(R_HOME)
 [1] /usr/local/R-devel

 $rstudio
 R shared library (/usr/local/R-devel/lib/libR.so) not found.
 If this is a custom build of R, was it built with the --enable-R-shlib
 option?

 $export RSTUDIO_WHICH_R=/usr/local/bin/R
 $rstudio
 R shared library (/usr/local/R-devel/lib/libR.so) not found.
 If this is a custom build of R, was it built with the --enable-R-shlib
 option?

 $export RSTUDIO_WHICH_R=/usr/local/R-devel/bin/R
 $rstudio
 R shared library (/usr/local/R-devel/lib/libR.so) not found.
 If this is a custom build of R, was it built with the --enable-R-shlib
 option?

 $sudo locate libR.so
 /usr/lib/libR.so
 /usr/lib/R/lib/libR.so

 [[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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] Parallel Computing in R

2015-02-05 Thread Pascal Oettli
Hi,

You already asked this here
(http://stackoverflow.com/questions/28357210/parallel-computing-in-r)
and got some comments.

Regards,
Pascal

On Fri, Feb 6, 2015 at 11:58 AM, Zhenchuan Wang zwan...@mtu.edu wrote:
 I usually need to compute P-values as following:
  1. generate one sample (usually it is a matrix)
  2. apply several methods (I already wrote a subfunction for each method,
 and they are independent) to the generated sample to get pvalues.
  3. compare the pvalues.
 Since each method mentioned above takes long time (always different length
 of time) to compute the pvalue, I am try to computing the pvalues parallel.
 I want to assign computation of each method to each cores (I have intel
 i7). Do you have any suggestion? I put the four subfunctions together as

 main.fun=function(i,x,y,numper)
 {
 if (i==1) z=cca1(y,x,numper)
 if (i==2) z=2
 if (i==3) z=2
 if (i==4) z=3
 z
 }

 Each i indicates ith subfunction.
 But I always get

  task 1 failed - Lapack routine dgesv: system is exactly singular:
 U[84,84] = 0

 But when I only run `cca1` function (not using `foreach`), there is no
 error.
 The `foreach` is like this

 pvalue=foreach(i=1:4,.combine=c,.packages=c(MASS,base)) %dopar%
 main.fun(i,x,y,500)

 The single computation is like this

 pvalue=cca1(y,x,500)

 I also put following in the top lines of my program

 library(foreach)
 library(doSNOW)
 library(MASS)
 cl=makeCluster(4,type=SOCK)
 registerDoSNOW(cl)

 **This looks like when I compute the `pvalue` separately not using
 `foreach`, there is no error. But when I combine the subfuntions togeter
 like `main.fun`, it has error.**

 [[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.

__
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] Rhive installation problem in Windows RStudio

2015-02-05 Thread Pascal Oettli
Hello,

This page says that RHive is not available as Windows binaries:
http://cran.r-project.org/web/packages/RHive/index.html

Regards,
Pascal

On Thu, Feb 5, 2015 at 3:35 PM, deepu praka...@hcl.com wrote:
 Hi,

 I am facing problem in RHive installation in Rstudio Version 0.98.1091 for R
 version 3.1.2 on Windows machine.

 Warning message :
 install.packages(RHive)
 Warning in install.packages :
   package ‘RHive’ is not available (for R version 3.1.2)

 Please help me its urgent

 Thanks
 Deepika



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Rhive-installation-problem-in-Windows-RStudio-tp4702825.html
 Sent from the R help mailing list archive at Nabble.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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] “Could not find function observeEvent” in shiny

2015-01-21 Thread Pascal Oettli
Cross-posted here:
http://stackoverflow.com/questions/28039426/could-not-find-function-observeevent-in-shiny

Cross-posting is considered to be impolite.

Regards,
Pascal

On Wed, Jan 21, 2015 at 1:20 PM, Ramkishore Swaminathan
ramkishor...@gmail.com wrote:
 Hi fellow R community users,

 I am using the shiny server to build a webapp and am connect R with mongodb
 to fetch results from database and display it dynamically.

 The app executes fine on my localhost.

 I have deployed the shiny server on a ubuntu 12.04 machine and when I run
 giving the IP address along with the application path in the browser it
 throws the error

 The application unexpectedly exited.Diagnostic information has been dumped
 to the JavaScript error console.

 I went and checked the mozilla browser console where it says

 Listening on http://127.0.0.1:35004 Error in (structure(function (input,
 output) : could not find function observeEvent  vload_controller:27

 Even if I execute from the R console on the remote machine, it says

 runApp()

 Listening on http://127.0.0.1:6757

 But a browser with the webapp does not open.

 The observeEvent function works fine on my localhost but not on the remote
 IP.

 Can somebody please help me? :)

 I have attached code and screenshot for the same.


 Thanks,

 Ramkishore

 __
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] plot.hclust point to older version

2014-11-26 Thread Pascal Oettli
 into their ~/.emacs
 {and I'd like to see a way to do this easily with RStudio...}


In RStudio:

Tools - Global Options - General - uncheck Restore .RData into
workspace at startup and choose Never for Save workspace to .RData
on exit


-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Dry Spell Problem.

2014-10-20 Thread Pascal Oettli
Hi,

Did you have a look at the dw.spell function from the RMRAINGEN
package? It might be a starting point for you.

Regards,
Pascal

On Mon, Oct 20, 2014 at 4:47 PM, Frederic Ntirenganya ntfr...@gmail.com wrote:
 Dear All,

 I want to solve the following problem on a climatic dataset. It contains
 Year, Day and Rain as Columns names.

 Ex:  head(Samaru56)
   Year Day Rain
 1 1928   10
 2 1928   20
 3 1928   30
 4 1928   40
 5 1928   50
 6 1928   60

 The first day from April 01 that gets more than 20 mm on a single day, or
 totalled
 over 2 consecutive days with the additional condition that there is no 10
 day (or longer) dry spell in the next 30 days.

 Any help is appreciated. Thanks!!!

 Regards,
 Frederic.
 --
 Frederic Ntirenganya
 Maseno University,
 Kenya.
 Mobile:(+254)718492836
 Email: fr...@aims.ac.za
 https://sites.google.com/a/aims.ac.za/fredo/

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] lag operator on a zoo object - code sharing

2014-10-15 Thread Pascal Oettli
Hi,

You probably missed the na.pad argument of the lag function (for
zoo objects).
?zoo:::lag.zoo

Regards,
Pascal

On Wed, Oct 15, 2014 at 6:00 PM, jpm miao miao...@gmail.com wrote:
 Hi,
I could not find a nice lag operator on zoo object. Perhaps there is,
 but I just couldn't find it. Basically I want the operator to return the
 lagged zoo object (with one or more variables ) with the original date. For
 example, if I write lag(x, -3), then I got the lagged series, but the first
 three observations are deleted. My code could work, but is not polished.
 Someone helps or comments?


 lagzoo-function(x, lag_n)
 {

   if(is.zoo(x)==FALSE)
   {
 stop(zoo objects for lagzoo, please)
   }
   if(ncol(x)==1)
   {
 y-x
   t-time(x)
   n-length(t)

   y[(lag_n+1):n]-x[1:(n-lag_n)]
   y[1:lag_n]-NA
   return(y)
   }
   else
   {
 y-x
 n-nrow(x)
 y[(lag_n+1):n,]-x[1:(n-lag_n),]
 y[1:lag_n,]-NA
 return(y)
   }
 }

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to Install R 3.1.0 on ubuntu 12.0.4

2014-10-14 Thread Pascal Oettli
Hi,

http://cran.r-project.org/bin/linux/ubuntu/
http://www.rstudio.com/products/rstudio/download/

Enjoy,
Pascal

On Tue, Oct 14, 2014 at 3:17 PM, madhvi madhvi.gu...@orkash.com wrote:
 Hi,
 Can anyone tell me the steps to install R 3.1.0 and rstudio on ubuntu
 12.0.4.

 Thanks
 Madhvi

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to Install R 3.1.0 on ubuntu 12.0.4

2014-10-14 Thread Pascal Oettli
Please reply to the list, not only to me.

RStudio is for Ubuntu 10.04+ (please note the +).

About R 3.1.0, you probably will have to compile from the source.

Regards,
Pascal


On Tue, Oct 14, 2014 at 3:31 PM, madhvi madhvi.gu...@orkash.com wrote:
 Hi,
 I have followed these links but it is giving R version 3.1.1 and R studio
 for ubuntu 10.04

 Madhvi

 On Tuesday 14 October 2014 11:58 AM, Pascal Oettli wrote:

 Hi,

 http://cran.r-project.org/bin/linux/ubuntu/
 http://www.rstudio.com/products/rstudio/download/

 Enjoy,
 Pascal

 On Tue, Oct 14, 2014 at 3:17 PM, madhvi madhvi.gu...@orkash.com wrote:

 Hi,
 Can anyone tell me the steps to install R 3.1.0 and rstudio on ubuntu
 12.0.4.

 Thanks
 Madhvi

 __
 R-help@r-project.org mailing list
 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.







-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to Install R 3.1.0 on ubuntu 12.0.4

2014-10-14 Thread Pascal Oettli
The support for RStudio is located here: https://support.rstudio.com

Regards,
Pascal

On Tue, Oct 14, 2014 at 4:08 PM, madhvi madhvi.gu...@orkash.com wrote:
 Hi,
 How to install RStudio after downloading debian  package

 Madhvi

 On Tuesday 14 October 2014 12:09 PM, Pascal Oettli wrote:

 Please reply to the list, not only to me.

 RStudio is for Ubuntu 10.04+ (please note the +).

 About R 3.1.0, you probably will have to compile from the source.

 Regards,
 Pascal


 On Tue, Oct 14, 2014 at 3:31 PM, madhvi madhvi.gu...@orkash.com wrote:

 Hi,
 I have followed these links but it is giving R version 3.1.1 and R studio
 for ubuntu 10.04

 Madhvi

 On Tuesday 14 October 2014 11:58 AM, Pascal Oettli wrote:

 Hi,

 http://cran.r-project.org/bin/linux/ubuntu/
 http://www.rstudio.com/products/rstudio/download/

 Enjoy,
 Pascal

 On Tue, Oct 14, 2014 at 3:17 PM, madhvi madhvi.gu...@orkash.com wrote:

 Hi,
 Can anyone tell me the steps to install R 3.1.0 and rstudio on ubuntu
 12.0.4.

 Thanks
 Madhvi

 __
 R-help@r-project.org mailing list
 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.









-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] evaluate NA to FALSE instead of NA?

2014-10-14 Thread Pascal Oettli
Hi Rainer,

As complete.cases() does?

p - c(1:10/100, NA, NaN)
complete.cases(p)
 [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE

Regards,
Pascal


On Tue, Oct 14, 2014 at 6:51 PM, Rainer M Krug rai...@krugs.de wrote:
 Hi

 I want to evaluate NA and NaN to FALSE (for indexing) so I would like to
 have the result as indicated here:

 ,
 |  p - c(1:10/100, NA, NaN)
 |  p
 |  [1] 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10   NA  NaN
 |  p[p=0.05]
 | [1] 0.01 0.02 0.03 0.04 0.05   NA   NA
 |  p[sapply(p=0.05, isTRUE)]
 | [1] 0.01 0.02 0.03 0.04 0.05  === I want this
 `

 Is there a way that I can do this more easily then in my example above?
 It works, but it strikes me that there is not a better way of doing
 this - am I missing a command or option?

 Thanks,

 Rainer

 --
 Rainer M. Krug
 email: Raineratkrugsdotde
 PGP: 0x0F52F982

 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Could someone recommend a package for time series?

2014-09-29 Thread Pascal Oettli
Hi Miao,

You certainly will find useful answers here :
http://cran.r-project.org/web/views/TimeSeries.html

Regards,
Pascal Oettli

On Mon, Sep 29, 2014 at 6:05 PM, jpm miao miao...@gmail.com wrote:
 Hi,

I've not used R for about one year and don't know well about the updates
 on the time series-related package.

   My primary job is to do economic/financial time series data analysis -
 annual, monthly, daily, etc. I usually read data by the package
 XLConnect, which can read xls or xlsx files directly. It's excellent.
 However I can't find a package to manipulate time series data. For example,
 I just want to do an easy manipulation , e.g, to label the dates of the
 data from , say, 1991M10 to 2014M07, and then extract part of the data,
 say, 2005M01 to 2010M12 and do analysis. Is there any package work well for
 my purpose?

   I sometimes need to aggregate monthly data to quarterly data and I find
 aggregate function helpful.

   In the past I used packages xts, zoo and don't find it really user
 friendly. Maybe I haven't mastered it; maybe there're some updates (which I
 don't know) now. Could someone recommend a package or provide an example
 (or just the document, I can read it) for my purpose?

Attached is an exemplary data set I talked about.

Thanks,

 Miao

 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] writeRaster dataType changes

2014-09-25 Thread Pascal Oettli
Hi Emma,

In writeRaster(), the argument is datatype, not dataType.

Hope this helps,
Pascal


On Fri, Sep 26, 2014 at 3:08 AM, White, Emma emma.wh...@sdstate.edu wrote:
 Hi,

 I am reading in some raster files and converting them to GeoTiff (using the
 raster package), I want them to be 8 bit unsigned integer (values in the
 case of this particular raster range from 0 to 55). However when writing the
 raster to GeoTiff R seems to assign it to dataType FLT4S despite
 specifying the dataType. See example code below:

 foo- raster(raster.files[1],datatype = INT1U)
 dataType(foo)
 [1] INT1U
 fool- writeRaster(foo,filename=paste(../test/,raster.files[1],sep=),
 format=GTiff,dataType = 'INT1U',overwrite=TRUE)
 dataType(fool)
 [1] FLT4S

 Any help/ insight would be appreciated. Thanks!


 Emma

 --
 Emma White
 PhD Candidate
 Geospatial Science Center of Excellence
 South Dakota State University
 Email: emma.wh...@sdstate.edu
 Web: http://globalmonitoring.sdstate.edu/people.php?view=3a=showid=86

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to get JRI package

2014-09-11 Thread Pascal Oettli
Hi,

As far as I know, there is any package JRI. You need to install rJava.

Regards,
Pascal

On Thu, Sep 11, 2014 at 6:08 PM, madhvi.gupta madhvi.gu...@orkash.com wrote:
 Hi,
 My R Studio version is 3.1.0 but JRI package is not getting installed on
 it.It is giving the following error.
 package ‘JRI’ is not available (for R version 3.1.0)
 Is there any another way to do this?

 Thanks

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to get JRI package

2014-09-11 Thread Pascal Oettli
Please check this link, particularly the red line: http://rforge.net/JRI/

Regards,
Pascal

On Thu, Sep 11, 2014 at 6:44 PM, madhvi.gupta madhvi.gu...@orkash.com wrote:
 I already have rjava.JRI package is for r java interface

 On 09/11/2014 02:44 PM, Pascal Oettli wrote:

 Hi,

 As far as I know, there is any package JRI. You need to install rJava.

 Regards,
 Pascal

 On Thu, Sep 11, 2014 at 6:08 PM, madhvi.gupta madhvi.gu...@orkash.com
 wrote:

 Hi,
 My R Studio version is 3.1.0 but JRI package is not getting installed on
 it.It is giving the following error.
 package ‘JRI’ is not available (for R version 3.1.0)
 Is there any another way to do this?

 Thanks

 __
 R-help@r-project.org mailing list
 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.







-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] multi-threading

2014-09-10 Thread Pascal Oettli
Hi Yuan,

You can start reading the following site:
http://cran.r-project.org/web/views/HighPerformanceComputing.html

Regards,
Pascal

On Wed, Sep 10, 2014 at 2:56 PM, Yuan Luo yuan.hypnos@gmail.com wrote:
 Hi,
 I am merging large data frames and it would be great if I can run merge in
 multi-threading/parallel mode. Can someone point me to the right way to do
 it?

 Best,
 Yuan

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Pascal Oettli
No I don't mean this. Did you at least try the small example I provided?

On Tue, Sep 9, 2014 at 3:25 PM, PO SU rhelpmaill...@163.com wrote:


 I don't understand what's your meaning, do you mean that i should do some 
 file processing,(like writing a script) ,so that i could add # in any line  i 
 wanted.
 I think it is not convenient.
 And, it does seems that there is no way to multi line comment in R. But when 
 i turn to using Rstudio, after lots trying, i find that ctrl+shift+C can do 
 the thing.
 Also i investgate roxygen, but it seems needing to learn the whole package ,  
 if some one happen to know how to do in roxygen, may you give me a quick 
 reference?






 --

 PO SU
 mail: desolato...@163.com
 Majored in Statistics from SJTU




 At 2014-09-09 11:51:21, Pascal Oettli kri...@ymail.com wrote:
A workaround is to escape the evaluation of the lines. For example:

tt - 0
while(tt  0){
  cat('rr\n')
}

Regards,
Pascal

On Tue, Sep 9, 2014 at 11:49 AM, PO SU rhelpmaill...@163.com wrote:

 Dear expeRts,
I find it's terrible  when  i want to comment multi paragraph (e.g.  a 
 30 lines function) , i have to comment each line with #,  is there any good 
 way to do that ?
I investgate it, but found no easy way, may you help me ?





 --

 PO SU
 mail: desolato...@163.com
 Majored in Statistics from SJTU
 __
 R-help@r-project.org mailing list
 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.



--
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to use multi paragraph comment like /* and */ in cpp?

2014-09-08 Thread Pascal Oettli
A workaround is to escape the evaluation of the lines. For example:

tt - 0
while(tt  0){
  cat('rr\n')
}

Regards,
Pascal

On Tue, Sep 9, 2014 at 11:49 AM, PO SU rhelpmaill...@163.com wrote:

 Dear expeRts,
I find it's terrible  when  i want to comment multi paragraph (e.g.  a 30 
 lines function) , i have to comment each line with #,  is there any good way 
 to do that ?
I investgate it, but found no easy way, may you help me ?





 --

 PO SU
 mail: desolato...@163.com
 Majored in Statistics from SJTU
 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] The newest version of Rstudio Desktop v0.98.1049 couldn't be installed

2014-09-04 Thread Pascal Oettli
Please ask your question to the dedicated forum: https://support.rstudio.com

Regards,
Pascal

On Thu, Sep 4, 2014 at 11:27 AM, PO SU rhelpmaill...@163.com wrote:

 Dear expeRts,
I find the newest Rstudio Desktop v0.98.1049  for windows is not newest, 
 after i installed, it was a old version.





 --

 PO SU
 mail: desolato...@163.com
 Majored in Statistics from SJTU
 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] RGEOS ERROR

2014-09-02 Thread Pascal Oettli
What is WorldMap? From where does it come?

Regards,
Pascal

On Tue, Sep 2, 2014 at 2:37 PM, Girija Kalyani smileismys...@gmail.com wrote:
 working configuration:
 R-3.1.1
 WIN-64
 goal: want to perfrom ploygon clipping, giving bounding box values of my
 study area and extract the area from world map.
  I followed:

 clip.extent - as(extent(76.3700, 31.7439, 78.6541, 33.2653), 
 SpatialPolygons)

 proj4string(clip.extent) - CRS(proj4string(WorldMap)) LSMap - 
 gIntersection(WorldMap, clip.extent, byid = TRUE)

 Error :

 In RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly,
 rgeos_intersection) :
   spgeom1 and spgeom2 have different proj4 strings


 Any help or assistance would be highly obliged

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] RGEOS ERROR

2014-09-02 Thread Pascal Oettli
Please keep your reply inside the thread. Anyway, it doesn't anwer the question.

Regards,
Pascal

On Tue, Sep 2, 2014 at 7:18 PM, Girija Kalyani smileismys...@gmail.com wrote:
 Sir,
 The worldmap i here refer to is , the shape file of the complete world map



 On Tue, Sep 2, 2014 at 12:09 PM, Pascal Oettli kri...@ymail.com wrote:

 What is WorldMap? From where does it come?

 Regards,
 Pascal

 On Tue, Sep 2, 2014 at 2:37 PM, Girija Kalyani smileismys...@gmail.com
 wrote:
  working configuration:
  R-3.1.1
  WIN-64
  goal: want to perfrom ploygon clipping, giving bounding box values of my
  study area and extract the area from world map.
   I followed:
 
  clip.extent - as(extent(76.3700, 31.7439, 78.6541, 33.2653),
  SpatialPolygons)
 
  proj4string(clip.extent) - CRS(proj4string(WorldMap)) LSMap -
  gIntersection(WorldMap, clip.extent, byid = TRUE)
 
  Error :
 
  In RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly,
  rgeos_intersection) :
spgeom1 and spgeom2 have different proj4 strings
 
 
  Any help or assistance would be highly obliged
 
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan




 --
 :) Smile is my Style :)



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Some hpc problems with doMPI and runmpi (I know there is R-SIG-HPC)

2014-08-08 Thread Pascal Oettli
Hello,

In your email, you speak about foreach()%dopar%, but in your script,
it is foreach()%do%.

Best,
Pascal

On Thu, Aug 7, 2014 at 7:19 PM, André Ziervogel
andre.ziervo...@psychol.uni-giessen.de wrote:
 Dear R people,

 I’ve been doing some hpc using R and openmpi. Unfortunately I’ve encoutred a 
 major problem and it’s nature is hard to pin down:

 Essentially I call mpirun Rscipt … as soon as the script reaches a 
 foreach()%dopar% it halts indefinitely. I’ve attached the qsub script:

 #!/bin/bash
 #$ -S /bin/bash
 #$ -N test_14
 #$ -cwd

 #$ -V
 #$ -o /fhgfs/g61570/Spectral Databases/log/test_14_$JOB_ID
 #$ -j y
 #$ -q regular
 #$ -pe openmpi 8
 #$ -l h_rt=00:15:00
 #$ -l h_vmem=1.9G
 #$ -m eas
 #$ -M andre.ziervo...@psychol.uni-giessen.de

 module add gcc
 module add openmpi/gcc/64/1.6.5
 module add R/gcc/3.0.1

 date   #log start time

 echo Number of slots  . $NSLOTS

 mpirun Rscript /fhgfs/g61570/Spectral\ Databases/test_10.r  
 /fhgfs/g61570/Spectral\ Databases/log/test_14.Rout

 date

 exit

 and the R file:

 suppressMessages(library('doMPI'))

 skylla.cluster - startMPIcluster()
 registerDoMPI(skylla.cluster)

 cat(paste(COMM SIZE: , mpi.comm.size(0),  cluster size: , 
 clusterSize(skylla.cluster), \n,sep = ))

 tmp.time - proc.time()
 sample - foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) 
 %do%
 {
 r - sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
 sin(r) / r
 }
 cat(paste(Processing seriell time: , \n, sep =   ))
 print(proc.time() - tmp.time)
 #print(sample)

 tmp.time - proc.time()
 sample - foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) 
 %dopar%
 {
 r - sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
 sin(r) / r
 }
 cat(paste(Processing parallel time: , \n, sep =   ))
 print(proc.time() - tmp.time)
 #print(sample)

 closeCluster(skylla.cluster)
 # mpi.close.Rslaves()
 # mpi.exit()
 mpi.quit(save='no‘)

 Any suggestions would be highly appreciated! Thanks!

 Best

 André

 --
 Dipl. Psych André Ziervogel
 andre.ziervo...@psychol.uni-giessen.de
 --


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] How to overlay contourplot of a dataset A and a levelplot of a dataset B?

2014-08-03 Thread Pascal Oettli
Hi Charles,

You don't need as.layer.

levelplot(z ~ x*y,grid2) + contourplot(z ~ x*y,grid1)

is enough.

Regards,
Pascal

On Sun, Aug 3, 2014 at 5:59 PM, Charles Novaes de Santana
charles.sant...@gmail.com wrote:
 Dear all,

 Just to inform that I have solved my problem in a very elegant way, thanks
 to the layer approach given by package latticeExtra.

 After loading my grids like before:

 x-1:10
 y-1:10
 grid1-expand.grid(x=x,y=y)
 grid2-expand.grid(x=x,y=y)
 z1-grid1$x^2 + grid1$y^2
 z2-2*grid2$x^2 - grid2$y^2
 grid1$z-z1
 grid2$z-z2

 I just need to do:

 levelplot(z ~ x*y,grid2) + as.layer(contourplot(z ~ x*y,grid1));

 The result is a beautiful plot with a contourplot over a levelplot. There
 are some examples of overlay of trellis plots in the manual of
 latticeExtra: http://latticeextra.r-forge.r-project.org/

 Thank you for your attention,

 Best,

 Charles


 On Sat, Aug 2, 2014 at 4:01 PM, Charles Novaes de Santana 
 charles.sant...@gmail.com wrote:

 Dear all,

 Does anyone know a way to overlay a contourplot and a levelplot of
 different datasets, both datasets with the same dimension?

 Let's say I have 2 10x10 grids, like those below:

 library(lattice)

 x-1:10
 y-1:10
 grid1-expand.grid(x=x,y=y)
 grid2-expand.grid(x=x,y=y)
 z1-grid1$x^2 + grid1$y^2
 z2-2*grid2$x^2 - grid2$y^2
 grid1$z-z1
 grid2$z-z2

 I would like to plot z1 and z2 in the same plot: z1 as a contourline and
 z2 as a levelplot. I tried to do this in two ways, without success:

 plot.new();
 contourplot(z ~ x*y,grid1)
 par(new=T)
 levelplot(z ~ x*y,grid2)

 and

 levelplot(z ~ x*y,grid1,region=FALSE,contour=TRUE)
 par(new=T)
 levelplot(z ~ x*y,grid2,region=TRUE,contour=FALSE)

 Any clue?

  Thank you very much for your time and any help!

 Charles

 --
 Um axé! :)

 --
 Charles Novaes de Santana, PhD
 http://www.imedea.uib-csic.es/~charles




 --
 Um axé! :)

 --
 Charles Novaes de Santana, PhD
 http://www.imedea.uib-csic.es/~charles

 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Problem in compiling a function

2014-07-03 Thread Pascal Oettli
Hi,

At the 3rd line, a bracket is missing, to close the if statement.

HTH
Pascal

On Thu, Jul 3, 2014 at 3:29 PM, Abhinaba Roy abhinabaro...@gmail.com wrote:
 Hi R-helpers,

 Can someone help me with this function

 prepArr - function(CA) {
   if(CA$CD_ACCRUAL_FLAG == 'AY' ){
 if(!is.na(CA_AMT_PAYBACK ){
 CA$IND_COLLECTION[(CA$TOT_PAID=CA$TOT_ARREAR_BEG|
 CA$TOT_PAID=CA_AMT_PAYBACK)] - 1L
 CA$IND_COLLECTION[CA$TOT_PAIDCA_AMT_PAYBACK] - 2L
 CA$IND_COLLECTION[CA$TOT_PAID==0] - 5L}
 else{
  CA$IND_COLLECTION[(CA$TOT_PAID=CA$TOT_ARREAR_BEG|
 CA$TOT_PAID=CA$ARR_SAT)] - 1L
 CA$IND_COLLECTION[CA$TOT_PAIDCA$ARR_SAT] - 4L
 CA$IND_COLLECTION[CA$TOT_PAID==0] - 5L
 }

 }
   if(CA$ACC_PREV == 'AY'){
 if(!is.na(CA_PAYBACK_PREV)){
 CA$IND_PREV[(CA$PAID_PREV=ARR_PREV|
 CA$PAID_PREV=CA_PAYBACK_PREV)] - 1L
 CA$IND_PREV[CA$PAID_PREVCA_PAYBACK_PREV] - 2L
 CA$IND_PREV[CA$PAID_PREV==0] - 5L}
 else{
 CA$IND_PREV[(CA$PAID_PREV=ARR_PREV|
 CA$PAID_PREV=CA$ARR_SAT_PREV)] - 1L
 CA$IND_PREV[CA$PAID_PREVCA$ARR_SAT_PREV] - 4L
 CA$IND_PREV[CA$PAID_PREV==0] - 5L
 }

 }

 return(CA)
 }

 When I run this function in R, it throws me a lot of errors.

 --
 Regards,
 Abhinaba Roy

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Problem in compiling a function

2014-07-03 Thread Pascal Oettli
3rd line:

if(!is.na(CA_AMT_PAYBACK ){
 ^^  ^

Two brackets opened, only one closed. You must close the second one.

HTH
Pascal


On Thu, Jul 3, 2014 at 4:03 PM, Abhinaba Roy abhinabaro...@gmail.com wrote:
 Hi,

 The 'if' statement closes
 CA$IND_COLLECTION[CA$TOT_PAID=
 =0] - 5L}



 On Thu, Jul 3, 2014 at 12:12 PM, Pascal Oettli kri...@ymail.com wrote:

 Hi,

 At the 3rd line, a bracket is missing, to close the if statement.

 HTH
 Pascal

 On Thu, Jul 3, 2014 at 3:29 PM, Abhinaba Roy abhinabaro...@gmail.com
 wrote:
  Hi R-helpers,
 
  Can someone help me with this function
 
  prepArr - function(CA) {
if(CA$CD_ACCRUAL_FLAG == 'AY' ){
  if(!is.na(CA_AMT_PAYBACK ){
  CA$IND_COLLECTION[(CA$TOT_PAID=CA$TOT_ARREAR_BEG|
  CA$TOT_PAID=CA_AMT_PAYBACK)] - 1L
  CA$IND_COLLECTION[CA$TOT_PAIDCA_AMT_PAYBACK] - 2L
  CA$IND_COLLECTION[CA$TOT_PAID==0] - 5L}
  else{
   CA$IND_COLLECTION[(CA$TOT_PAID=CA$TOT_ARREAR_BEG|
  CA$TOT_PAID=CA$ARR_SAT)] - 1L
  CA$IND_COLLECTION[CA$TOT_PAIDCA$ARR_SAT] - 4L
  CA$IND_COLLECTION[CA$TOT_PAID==0] - 5L
  }
 
  }
if(CA$ACC_PREV == 'AY'){
  if(!is.na(CA_PAYBACK_PREV)){
  CA$IND_PREV[(CA$PAID_PREV=ARR_PREV|
  CA$PAID_PREV=CA_PAYBACK_PREV)] - 1L
  CA$IND_PREV[CA$PAID_PREVCA_PAYBACK_PREV] - 2L
  CA$IND_PREV[CA$PAID_PREV==0] - 5L}
  else{
  CA$IND_PREV[(CA$PAID_PREV=ARR_PREV|
  CA$PAID_PREV=CA$ARR_SAT_PREV)] -
  1L
  CA$IND_PREV[CA$PAID_PREVCA$ARR_SAT_PREV] - 4L
  CA$IND_PREV[CA$PAID_PREV==0] - 5L
  }
 
  }
 
  return(CA)
  }
 
  When I run this function in R, it throws me a lot of errors.
 
  --
  Regards,
  Abhinaba Roy
 
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan




 --
 Regards,
 Abhinaba Roy





-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] sort() depends on locale

2014-06-15 Thread Pascal Oettli
Hello,

Please provide your sessionInfo(). I don't see this issue with R 3.1.0
Patched on Linux.

Regards,
Pascal

On Sun, Jun 15, 2014 at 2:15 PM, Marius Hofert
marius.hof...@math.ethz.ch wrote:
 Hi,

 If I use invisible(Sys.setlocale(LC_COLLATE, C)) in ~/.Rprofile, then

 sort(c(L.Y, Lu, L.Q))
 [1] L.Q L.Y Lu

 whereas using invisible(Sys.setlocale(LC_COLLATE, en_US.UTF-8)) results in

 sort(c(L.Y, Lu, L.Q))
 [1] L.Q Lu  L.Y

 I know this issue has appeared already
 (https://stat.ethz.ch/pipermail/r-help//2012-February/304089.html), I
 just don't see a reason for the second output: either '.' comes before
 letters, then the result should be
 L.Q L.Y Lu or it comes afterwards, then it should be Lu L.Q
 L.Y -- the above result thus seems inconsistent to any useful notion
 of 'sort' (?)

 Cheers,

 Marius

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] barp {plotrix} Start bars at 0 with a vector of positive values

2014-06-14 Thread Pascal Oettli
Hi Jim,

Yes, it seems to work. Thanks.

Regards,
Pascal

On Sat, Jun 14, 2014 at 2:03 PM, Jim Lemon j...@bitwrit.com.au wrote:
 On Sat, 14 Jun 2014 12:57:12 PM you wrote:
 Hi Jim,

 I tried your fix.

 This one works:
 barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

 This one fails:
 barp(c(2,3,4,5,6,7,8))

 Regards,
 Pascal

 Hi Pascal,
 Right again. This seems to work for both and I think handles the problem
 correctly:

  if(is.null(ylim)) {
   negy-any(height0,na.rm=TRUE)
   if(negy) miny-min(height,na.rm=TRUE)*1.05
   else miny-ifelse(ylog,min(height)/10,0)
   ylim-c(miny,max(height,na.rm=TRUE)*1.05)
  }
  else {
   miny-ylim[1]
   negy-miny0
  }

 Remove the line:

 negy-any(height0,na.rm=TRUE)

 and modify the succeeding conditional clause as above. This will appear
 in version 3.5-8.

 Jim




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] barp {plotrix} Start bars at 0 with a vector of positive values

2014-06-13 Thread Pascal Oettli
Dear list,

Please consider the following example:

library(plotrix)
barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

How to force the bars to start at 0? I could not find the way to do it.

Regards,
Pascal

__
R-help@r-project.org mailing list
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] barp {plotrix} Start bars at 0 with a vector of positive values

2014-06-13 Thread Pascal Oettli
Hi Jim,

Thank you for the suggestion. I will try it.

Pascal

On Fri, Jun 13, 2014 at 7:09 PM, Jim Lemon j...@bitwrit.com.au wrote:
 On Fri, 13 Jun 2014 06:50:59 PM Pascal Oettli wrote:
 Dear list,

 Please consider the following example:

 library(plotrix)
 barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

 How to force the bars to start at 0? I could not find the way to do it.

 Hi Pascal,
 You are right, I had not considered the idea of setting a negative y limit
 when there were no negative values. I think you can fix this by changing:

  negy-any(height0,na.rm=TRUE)

  to

 negy-any(height0,na.rm=TRUE) || ylim[1]  0

 I'll check this later (I'm just going out) and if it doesn't work, I'll send
 another email with something that does.

 Jim




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] barp {plotrix} Start bars at 0 with a vector of positive values

2014-06-13 Thread Pascal Oettli
Hi Jorge,

It is in order to have different barplots with the same range of
limits, to keep them easily comparable. Some have negative values,
some others no.

Pascal

On Fri, Jun 13, 2014 at 7:11 PM, Jorge I Velez jorgeivanve...@gmail.com wrote:
 Hi Pascal,

 Perhaps I am missing something, but what about changing passing ylim = c(0,
 10) to barp()?

 Best,
 Jorge.-


 On Fri, Jun 13, 2014 at 7:50 PM, Pascal Oettli kri...@ymail.com wrote:

 Dear list,

 Please consider the following example:

 library(plotrix)
 barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

 How to force the bars to start at 0? I could not find the way to do it.

 Regards,
 Pascal

 __
 R-help@r-project.org mailing list
 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.





-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] barp {plotrix} Start bars at 0 with a vector of positive values

2014-06-13 Thread Pascal Oettli
Hi Jim,

I tried your fix.

This one works:
barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

This one fails:
barp(c(2,3,4,5,6,7,8))

Regards,
Pascal

On Fri, Jun 13, 2014 at 7:09 PM, Jim Lemon j...@bitwrit.com.au wrote:
 On Fri, 13 Jun 2014 06:50:59 PM Pascal Oettli wrote:
 Dear list,

 Please consider the following example:

 library(plotrix)
 barp(c(2,3,4,5,6,7,8), ylim=c(-10,10))

 How to force the bars to start at 0? I could not find the way to do it.

 Hi Pascal,
 You are right, I had not considered the idea of setting a negative y limit
 when there were no negative values. I think you can fix this by changing:

  negy-any(height0,na.rm=TRUE)

  to

 negy-any(height0,na.rm=TRUE) || ylim[1]  0

 I'll check this later (I'm just going out) and if it doesn't work, I'll send
 another email with something that does.

 Jim




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Question about setdiff()

2014-06-02 Thread Pascal Oettli
Hello,

From the help page: Performs *set* union, intersection, (asymmetric!)
difference, equality and membership on two vectors.

Hope this helps,
Pascal


On Mon, Jun 2, 2014 at 3:57 PM, Raphael Päbst raphael.pae...@gmail.com wrote:
 Hello everyone, I have a question which is probably rooted in my lack
 of understanding when it comes to math.

 I just did the following:

 v - c(1:20)
 w - c(11:30)
 setdiff(v, w)

 and got:
 1 2 3 4 5 6 7 8 9 10

 Then I did the following:
 setdiff(w, v)
 and got, not surprisingly:
 21 22 23 24 25 26 27 28 29 30

 Now I was originally expecting to get bot with the first call of
 setdiff(v, w) and couldn't find any reason not to expect this from
 ?setdiff()

 Am I missing somethin vital here or does setdiff() always give me the
 elements of the first set that are not in the second one and not those
 which are exclusive to either one, just dropping the ones in the
 intersection of both sets?

 Many Thanks in advance

 Raphael

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Problem with rbind.fill

2014-06-01 Thread Pascal Oettli
Hello,

Yes, but... rbind.fill is a function of the plyr package.

HTH,
Pascal

On Mon, Jun 2, 2014 at 2:49 AM, Bill Bentley valuetr...@gmail.com wrote:
 The following works as it should...

 both-rbind(females,males)

 both

   workshop gender q1 q2 q3 q4

 11  f  1  1  5  1

 22  f  2  1  4  1

 31  f  2  2  4  3

 51  m  4  5  2  4

 62  m  5  4  5  5

 82  m  4  5  5  5



 Next I changed the objects males and females so they had different numbers
 of variables and used rbind again and got an error which I expected.



 both - rbind(females, males)

 Error in rbind(deparse.level, ...) :

   numbers of columns of arguments do not match



 Next I attached the 'reshape' library and tried to use rbind.fill but as the
 code below shows, it does NOT work.   The library seems to load ok (no error
 message) and appears in the list when I use the library() command.



 library(reshape)

 both - rbind.fill(females, males)

 Error: could not find function rbind.fill



 The book I'm following does this the same way and it works for them.   I've
 re-downloaded and installed the reshape package but to no avail.  Not sure
 what to do.  Can't find an answer in help.  I'm a brand new R user.   Any
 suggestions what I'm doing wrong?   Thanks!












 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] density in hist does not come as 1

2014-05-20 Thread Pascal Oettli
Hello,

What you are doing wrong? Correctly read the help page.

From the help page: if FALSE, probability densities, component
density, are plotted (so that the histogram has a *total area of
one*)

 sum(check$density * diff(check$breaks))
[1] 1

HTH,
Pascal

On Tue, May 20, 2014 at 3:06 PM, vikram ranga babuaw...@gmail.com wrote:
 Dear List,

 I am trying to make a histogram with following data:

 dput(a)
 c(1, 0, 1.5, 1, 0, 0, 0, 1, 1.5, 0, 0, 1, 0, 0, 0, 1, 1, 2, 1,
 0, 0, 0, 1, 1, 1, 0, 1, 0.5, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0,
 0, 0, 0, 0, 1, 1, 1, 0, 0, 1.5, 0, 0, 0, 0, 1, 0, 0, 0.5, 0,
 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 0,
 0, 0, 1.5)

 So, I did

 hist(a, freq = FALSE, breaks = 5)
 but the first bar height is going above 1!
 I did some checking

 check - hist(a, freq = FALSE, breaks = 5)
 check$density

 #[1] 1.146341 0.707317 0.097561 0.048780

 first bar went above 1, however, the values should be
 check$counts/length(a)
 #[1] 0.57317 0.35366 0.04878 0.02439
 sum(check$counts/length(a))
 #[1] 1


 What am I going wrong here?

 Thank you for your time!

 Regards,

 Vikram.

 sessionInfo()

 R version 3.1.0 (2014-04-10)
 Platform: i386-w64-mingw32/i386 (32-bit)

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

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Piecewise Aggregate Approximation in r

2014-05-15 Thread Pascal Oettli
Hello,

library(sos)
findFn(Piecewise Aggregate Approximation)

or

RSiteSearch('Piecewise Aggregate Approximation')

Hope this helps,
Pascal

On Thu, May 15, 2014 at 6:13 PM, Babak Bastan babak...@gmail.com wrote:
 Hi experts

 Is there any package or function in r to use PAA (Piecewise Aggregate
 Approximation). Could you please inform me if is there any?

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Why are integers coded as e.g. 2L in R functions?

2014-05-15 Thread Pascal Oettli
Hello,

Probably you will get more complete answer, but you can compare
class(1) with class(1L).

Regards,
Pascal

On Thu, May 15, 2014 at 7:54 PM, Alexander Engelhardt
a...@chaotic-neutral.de wrote:
 Hello R-help,

 I keep noticing R functions that don't compare integers like
   if(x == 2)
 but instead
   if(x == 2L)

 Is this a long integer? Also, when do the two notations have a different
 effect on the code?

 Thanks in advance,
  Alex

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Contour plots in R Studio

2014-05-12 Thread Pascal Oettli
Hi Lydia,

Your question match more the topics of the r-sig-geo list.

Please have a look at the raster package, as well as the rasterVis
package to read and work with NetCDF format.

Regards,
Pascal

On Tue, May 13, 2014 at 6:27 AM, Lydia Keppler lydiakepp...@gmail.com wrote:
 Hi all,

 I am using Windows 7 and R Studio version 3.0.2 (2013-09-25).
 I am relatively new to R and am trying to make a contour plot from a 3D
 data grid.

 I my data file has the following specifics:

 [1] file Data.nc has 3 dimensions:
 [1] time   Size: 96
 [1] lat   Size: 21
 [1] lon   Size: 61
 [1] 
 [1] file Data.nc has 2 variables:
 [1] double U[time,lat,lon]  Longname:U Missval:1e+30
 [1] double V[time,lat,lon]  Longname:V Missval:1e+30

 lat and lon includes latitude and longitude values from a certain region in
 a 1°grid
 time includes different months over 8 years

 I would like to draw
 1) a contourplot of the mean U (mean U of all times), at the different
 locations (x=lon, y=lat)
 2) a contourplot of U at the different locations (x=lon, y=lat) at
 different times.

 I have only made contourplots with 2D data (i.e. contour (lat,lon, z) and
 am struggling a bit to find help.

 Any suggestions are very much appreciated.
 Cheers,

 Lydia

 --
º

 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Fwd: Difficulty in finding some R functions

2014-05-02 Thread Pascal Oettli
Hello,

Maybe from here ?
http://www.ie.boun.edu.tr/~hormannw/BounQuantitiveFinance/Thesis/SilaHALULU.pdf

HTH
Pascal

On Fri, May 2, 2014 at 11:11 AM, prachi jain
preciousprachi...@gmail.com wrote:
 Hey, I am trying to find some of the following functions in R packages:

 MLEt

 pt3

 cormatrix2vector

 ParameterEst

 tCopula

 riskBT

 I have checked every package from this link:
 http://cran.r-project.org/web/packages/available_packages_by_name.html but
 is unable to find the above functions. These functions belong to a code for
 calculating Value-at-risk and expected shortfall using copula function and
 backtesting the model.

 Could you please help me find these functions by naming the packages they
 belong to. Its really urgent for me so please reply asap.

 If required i can send the entire code for better understanding.

 If this is not the right place to mail a query, please do let me know where
 can I send my query, its really urgent for me.

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] substring if a record has a \

2014-05-02 Thread Pascal Oettli
Hello,

Something like that?

x - c('Marius Muller -\nIT Services','Rockwood\nBrockhues','Microlog
Services\nMarcos','Firefox Services')
x - sapply(strsplit(x, '\n'), '[', 1)
x
[1] Marius Muller -   Rockwood  Microlog Services
[4] Firefox Services

Regards,
Pascal

On Fri, May 2, 2014 at 4:17 PM, Mat matthias.we...@fnt.de wrote:
 Hello togehter,

 i have a litte problem. I have a data.frame with a view entries like this
 one:
   1
 A   Marius Muller -\nIT Services
 B   Rockwood\nBrockhues
 C   Microlog Services\nMarcos
 D   Firefox Services

 I now want only the first description in the column until the \n. How can
 i do this?

 The solution look like this one:

   1
 A   Marius Muller -
 B   Rockwood
 C   Microlog Services
 D   Firefox Services

 Thank you.

 Best regards. Mat.



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/substring-if-a-record-has-a-tp4689857.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] multiple plots on same sheet in R

2014-04-16 Thread Pascal Oettli
Hi,

Did you have a look at the rasterVis package?

Regards,
Pascal

On Wed, Apr 16, 2014 at 9:33 PM, eliza botto eliza_bo...@hotmail.com wrote:
   Dear useRs,
 I drew 12 separate raster maps. I want to combine them in such a way the they 
 appear on the same sheet in R, which will later on be saved. Each row should 
 contain three raster maps, so in total we should have 4 rows with each row 
 containing 3 rasters. I know that mfrow() can do it but I don't exactly know 
 how?

 Eliza
 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Variable names in plotCI

2014-04-11 Thread Pascal Oettli
Hello,

When posting, you are asked to provide a reproducible code (including
packages you are using) and to not post in HTML.

The following might help:

library(plotrix)
y-runif(10)
err-runif(10)
plotCI(1:10,y,err,main=Basic plotCI,xaxt='n',xlab='')
axis(1,1:10,LETTERS[1:10])

Regards,
Pascal

On Fri, Apr 11, 2014 at 6:59 PM, Mª Teresa Martinez Soriano
teresama...@hotmail.com wrote:

 Hello to everyone,
 I would like to put the variable names in the x-axis of this plot instead of 
 number 1:63:

 plotCI(1:num_col_comp,med,2.06*des/sqrt(n),lwd=1,col=red,scol=seashell4,main=Intervalo
  de confianza,xlab=Variables clínicas,ylab=Intervalo de 
 confianza)abline(h=0, col=yellowgreen,lwd=1.8)

 I don't find the way to do it, I tried with xlab option but it doesn't work 
 and I tried as well creatting a data.frame with the rownames of the variables 
 and the values 1:63
 Any idea will be very appreciated
 Thanks a lot
 An example of the data set could be:y-runif(10)
  err-runif(10)
  plotCI(1:10,y,err,main=Basic plotCI)
  plotCI(1:10,y,err,2*err,lwd=2,col=red,scol=blue,
   main=Add colors to the points and error bars)

 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Issues with fa() function in psych

2014-04-08 Thread Pascal Oettli
Hello,

And what about submitting your suggestions directly to the package
author/maintainer?

And please don't post in HTML.

Regards,
Pascal

On Tue, Apr 8, 2014 at 3:13 PM, sagnik chakravarty
sagnik.st...@gmail.com wrote:
 Hi Team,

 I was using your psych package for factor analysis and was also comparing
 the results with SAS results. I have some suggestions and/or confusions
 regarding the fa() function in the package:

- The fa() function *doesn't account for Heywood cases* (communality
greater than 1) and never ever throws out any error related to that which
other softwares do. This is a serious and common issue in iterative factor
analysis and hence should have been accounted for.


- The fa() function doesn't provide equamax rotation in its rotation
list and still if you specify *rotation=equamax*, it will run without
throwing out any error and even mentioning in the result that equamax has
been applied. But I have thoroughly compared results from 
*rotation=none* and *rotation=equamax* options and they are exactly
same. *That means fa() is not doing the rotation at all and yet telling
that it is doing that!!* I have even mentioned *rotation=crap* option
just to check and surprisingly it ran(without any error) with the result
showing:

*Factor Analysis using method =  gls*
 *   Call: fa(r = cor_mat, nfactors = 4, n.obs = 69576, rotate =
 crap, fm = gls)*

 I hope you understand the severity of this bug and hence
 request you to correct this.

- To my sense, there might be some problem with fm=ml and fm=pa
options since the convergence issue should be with MLE method and not PA
method but while running factor analysis with PA, I am getting the
following warning:

 *maximum iteration exceeded*
 *The estimated weights for the factor scores are probably
 incorrect.  Try a different factor extraction method.*

  If I compare the results of R and SAS,* I am getting
 convergence error for MLE in SAS whereas I am getting the same error for PA
 in R *!! I am not being able to understand this mismatch.

- If I call the *loading matrix like efa_pa$loadings, the matrix shown
has many blank cells whereas the final result showing the loadings doesn't
have so* !!

 *Loadings:*
 * PA1PA2PA3PA4   *
 *Var10.401   -0.243*
 *Var20.336 -0.1040.710*
 *Var30.624  0.123 0.170  *


- Could you please explain* what the com column means* in the output:?


 *   PA1   PA3   PA2   PA4 h2  u2  com*
 *Var1  0.44  0.14 -0.03  -0.10 0.22665  0.773  1.3*
 *Var2  0.08  0.11  0.02   0.78  0.62951  0.370  1.1*
 *Var3  0.62  0.12  0.15   0.14  0.43578  0.564  1.3*

- Request you to add option for *equamax rotation* also if possible.


 I have come across the above issues until now. Please do correct me if I am
 wrong.

 Awaiting your revert which would clear out my confusions,

 Thanks for your valuable time,

 Sagnik

 --
 Regards,

 *SAGNIK CHAKRAVARTY*

 *Mob:*  +919972865435
 *Email:* sagnik.st...@gmail.com
sagnik@gmail.com

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Any solution to have RnetCDF, ncdf or ncdf4 in R 3.1 ?

2014-04-06 Thread Pascal Oettli
Hello,

Do you have NetCDF library correctly installed (with headers)?

Regards,
Pascal

On Sun, Apr 6, 2014 at 11:26 PM, Marc Girondot marc_...@yahoo.fr wrote:
 I just have installed the last RC of R 3.1. All is ok except for 3 packages
 that I was not able to compile and they do not exist as precompiled package
 for MacOSX (Marverick):

 These packages are RnetCDF, ncdf or ncdf4. For all, I get error when I try
 to install them:
 install.packages(RNetCDF, type=source)
 
 checking for nc_create in -lnetcdf... no
 configure: error: netcdf library not found
 ERROR: configuration failed for package ‘RNetCDF’
 * removing
 ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RNetCDF’

 install.packages(ncdf, type=source)
 
 configure: error: netcdf header netcdf.h not found
 ERROR: configuration failed for package ‘ncdf’
 * removing
 ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ncdf’
 Warning in install.packages :
 installation of package ‘ncdf’ had non-zero exit status

 install.packages(ncdf4, type=source)
 
 ERROR: configuration failed for package ‘ncdf4’
 * removing
 ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ncdf4’
 Warning in install.packages :
 installation of package ‘ncdf4’ had non-zero exit status

 Sincerely,

 Marc Girondot

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] unzip error with odfWeave and OpenOffice

2014-04-03 Thread Pascal Oettli
Hello,

Probably a path problem:
https://stat.ethz.ch/pipermail/r-help/2010-March/232135.html

Regards,
Pascal

On Fri, Apr 4, 2014 at 11:30 AM, Bob Kelly vk2...@optusnet.com.au wrote:
 Hello r-help mailing list readers,

 I am trying to create a report with OpenOffice (ver 4.0.1) using the
 odfWeave (ver 0.8.4) package.
 This is completely new to me so I am using part of an example from the book
 R in Action.
 I have used 7-zip on the file and this opens it correctly, am I doing
 something wrong in setting up the process.

 input to R (3.0.2)

 infile - example1.odt
 outfile - example-out.odt
 odfWeave(infile, outfile)


 output from R

 odfWeave(infile, outfile)

   Creating
 C:\Users\RFMOBI~1.INS\AppData\Local\Temp\Rtmp48EjRV/odfWeave04123430182
   Copying  example1.odt
   Setting wd to
 C:\Users\rfmobile.INSTRUMENTS\AppData\Local\Temp\Rtmp48EjRV\odfWeave04123430182
   Unzipping ODF file using unzip -o example1.odt
 Error in odfWeave(infile, outfile) : Error unzipping file

 below is the file I am trying to open

 My Sample Report

 Robert I. Kabacoff, Ph.D.

 echo=true, results=hide=
 library(multcomp)
 library(xtable)
 attach(cholesterol)
 @

 1 Results



 regards

 Bob Kelly

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Time series

2014-04-02 Thread Pascal Oettli
Hello Keith,

Your example is clearly not reproducible and wrong (Chum and chum).
Please use dput() to attach sample dataset.
At first glance, you work with hourly data. Package such as xts
might be more useful.

Regards,
Pascal

On Wed, Apr 2, 2014 at 3:16 PM, Marlin Keith Cox marlink...@gmail.com wrote:
 A simplified ask is:  when I use the time series plot function, R treats
 each time on 9/19/13 as an individual day, when clearly it isn't.

 Thank you ahead of time.  Keith

 ts(chum)
 with(chum,plot.ts(Time,PA))

 Chum-

   Time PA  9/18/13 18:29 16  9/19/13 13:29 14  9/19/13 16:29 13.2  9/19/13
 17:29 13.1  9/19/13 18:29 13  9/20/13 18:29 12  9/21/13 18:29 10  9/22/13
 18:29 9  9/23/13 18:29 7  9/24/13 18:29 5  9/25/13 18:29 3  9/26/13
 18:29 2  9/27/13
 18:29 1


 M. Keith Cox, Ph.D.
 Principal
 MKConsulting
 17105 Glacier Hwy
 Juneau, AK 99801
 U.S. 907.957.4606

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] 'rms' package error

2014-04-02 Thread Pascal Oettli
Hello Lucy,

If you carefully read, it is is not an error message, but a warning
message. It tells you that for the moment, if I am not mistaken,
pphsm does not return the correct covariance matrix, for any
fitting.

Regards,
Pascal

On Thu, Apr 3, 2014 at 11:29 AM, Lucy Leigh lucy.le...@newcastle.edu.au wrote:
 Hi everyone,
 I am attempting to use the R package 'rms'
 http://biostat.mc.vanderbilt.edu/wiki/Main/Rrms
 to implement a PH weibull model, using the pphsm() function.

 However, I get the following error,
 f.ph - pphsm(f)
 Warning message:
 In pphsm(f) :
   at present, pphsm does not return the correct covariance matrix

 I tried simply running the example on page 117 of the manual, i.e.
 set.seed(1)
 S - Surv(runif(100))
 x - runif(100)
 dd - datadist(x); options(datadist='dd')
 f - psm(S ~ x, dist=exponential)
 summary(f) # effects on log(T) scale
 f.ph - pphsm(f)
 ## Not run: summary(f.ph)

 But I still got the above error message.
 I have looked through the R help archives, and it appears that this question 
 has been asked before in 2011, but
 there were no replies.
 http://r.789695.n4.nabble.com/HELP-td3494640.html

 Does anyone know how to get this function to work? Or if there is an 
 alternative package that can implement
 a Weibull PH model?
 Cheers,
 Lucy

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Centered difference operation on matrix with R

2014-04-01 Thread Pascal Oettli
Dear list members,

The answer is in package pracma, function gradient.

Regards,
Pascal Oettli

On Fri, Mar 28, 2014 at 2:51 PM, Pascal Oettli kri...@ymail.com wrote:
 Dear list members,

 I am wondering whether there is any more efficient way to calculate
 centered difference on matrix in R? Please see herewith an example:

 lon - matrix(rep(seq(0,2,length.out=1e3), 1e3), 1e3, 1e3)
 lat - matrix(rep(seq(0,2,length.out=1e3), each=1e3), 1e3, 1e3)
 x - matrix(rep(seq(0.01,2,length.out=1e3), 1e3), 1e3, 1e3)
 y - matrix(rep(seq(0.01,2,length.out=1e3), each=1e3), 1e3, 1e3)
 u - y * cos(x)
 v - y * sin(x)

 to.rad - pi/180
 dx - diff(lon,2); dx - rbind(NA,dx,NA); dx - dx*to.rad
 dy - t(diff(t(lat),2)); dy - cbind(NA,dy,NA); dy - dy*to.rad

 du - t(diff(t(u * cos(lat*to.rad)),2)); du - cbind(NA,du,NA)
 dv - diff(v,2); dv - rbind(NA,dv,NA)

 Best Regards,
 Pascal Oettli



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] labelling a plot in binom library function call

2014-04-01 Thread Pascal Oettli
Hello,

The binom package is using ggplot2 to plot the density. Thus, you
have to follow the ggplot2 syntax:

R  binom.bayes.densityplot(hpdc) + ggtitle(my plot)

HTH
Pascal

On Tue, Apr 1, 2014 at 7:41 AM, Chris chris.bar...@barkerstats.com wrote:
 Hi, I'm using  a function in the binom library. I'd like to add a title(s) to 
 the plot generated by binom.bayes.densityplot.

 I get an error message when trying to use the title function
 The error message is: Error in title(main = my plot) : plot.new has not 
 been called yet occurs after running the title command.

 Example code:

 hpdc - binom.bayes(
 x = 0:10, n = 10, type = central, conf.level = 0.8, tol = 1e-9)
 print(hpdc)
 binom.bayes.densityplot(hpdc)
 title(main=my plot)


 I was also unsuccessful in passing a plot title to the function call.

 And issuing a plot.new() before the title command clears the plot.

 Thanks in advance for suggestions.



 Chris Barker, Ph.D.
 Adjunct Associate Professor of Biostatistics - UIC-SPH
 and
 President and Owner
 Statistical Planning and Analysis Services, Inc.
 www.barkerstats.com
 415 609 7473415 609 7473
 skype: barkerstats


 Call
 Send SMS
 Add to Skype
 You'll need Skype CreditFree via Skype
 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] accessing members of a list

2014-03-28 Thread Pascal Oettli
Hello,

You are right, the which option avoid the selection in my example.

Also, I think ?[[ might be helpful for you.

Regards.
Pascal

On Fri, Mar 28, 2014 at 3:02 PM, Bill william...@gmail.com wrote:
 Hi. I found that this works:
 tt=readHTMLTable(url,header=TRUE, as.data.frame=TRUE,which=c(3))
 tt[1,]
 I thought I tried what you suggested but it was not working but I guess not.
 So all my errors revolved around the fact that
 mylist[] will return a slice of a list and hence still a list but
 mylist[[]] returns the data structure of that particular element?

 Thanks.



 On Fri, Mar 28, 2014 at 2:49 PM, Pascal Oettli kri...@ymail.com wrote:

 Hello,

 Your example leads to error. Anyway:

 library(XML)
 oneurl=http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm;
 temp.tables=readHTMLTable(oneurl, header=TRUE)

 temp.tables - temp.tables[[3]]
 temp.tables - temp.tables[1:30,]

 HTH,
 Pascal


 On Fri, Mar 28, 2014 at 2:42 PM, Bill william...@gmail.com wrote:
  Hi. I ran some code and I am trying to access the table with the data in
  it. I want in particular to delete the 31st row for example
  Monthly means and totals: NA NA NA   NA NA  NA NA NA
  NA
  NA NA NA NA
  or remove the names of the columns (or change them). DayT   TM   Tm
   SLPHPP   VVV   VM   VG   RA   SN   TS
 
  I tried all sorts of things but they don't give me access:
 
  library(XML)
  oneurl=http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm;
  allFuku=data.frame() #need to initialize it with column names
  temp.tables=readHTMLTable(url)
 
  temp.tables[3][2]
  temp.tables[3]
  temp.tables[3][3]
  temp.tables[3][2,]
  str(temp.tables[3])
  temp.tables[3][2,2]
  dim(temp.tables[3])
  temp.tables[3]$SN
  temp.tables[3][1]
  temp.tables[3][1][2,]
  str(temp.tables[3][1])
  temp.tables[3][1]$SN
   temp.tables[3][1][1][2,]
 
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan





-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Selecting numbers not divisible by 3

2014-03-27 Thread Pascal Oettli
Hello,

Something like that?

R X - 1:100
R Y - X %% 3
R Y - ifelse(Y==0, TRUE, FALSE)
R X[Y]
 [1]  3  6  9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75
[26] 78 81 84 87 90 93 96 99

HTH,
Pascal

On Thu, Mar 27, 2014 at 6:23 PM, Prabhakar Ghorpade
dr.prabhaka...@gmail.com wrote:
 Hi,
 here's my code

 X - 1:100

 I want to select number divisible by 3 out of them how can I select it?

 ( I tried following
 X - 1:100
 DIV - Y -  X/3

 But I am getting whole number and number with fractions. WHole intgers are
 my number of interest from original X. How can I traceback to number
 divisbile by 3. ?)

 Thanks

 Kind Regards,
 Prabhakar



 --
 Dr.Ghorpade Prabhakar B.
 Ph.D. Scholar ( Animal Biochemistry)
 Indian Veterinary Research Institute.
 India



 --
 Dr.Ghorpade Prabhakar B.
 Ph.D. Scholar ( Animal Biochemistry)
 Indian Veterinary Research Institute.
 India

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] reading dataset

2014-03-27 Thread Pascal Oettli
Hi,

Maybe I wasn't clear enough.

Day 01   precip  map of 180x140
Day 01   rstn map of 180x140
Day 01   flag  map of 180x140
Day 02   precip  map of 180x140

And so on

HTH
Pascal

On Thu, Mar 27, 2014 at 10:14 PM, Frede Aakmann Tøgersen
fr...@vestas.com wrote:
 No you're not right as far as I can tell from the read_v1100r2.f90 fortran 
 code you can find in the download folder.

 For day 1 in 1961 I think that prcp = ccc[1:25200], rstn = ccc[25201:50400], 
 and rsnw = ccc[50401:75600] and the same rule applies to the following days 
 with appropriate indices.

 Have a look at this (I think -99.9 is value for missing values so set these 
 to NA):

 ccc -readBin(APHRO_MA_050deg_V1101R2.1961, numeric(), n=1e8, size=4, 
 signed=TRUE, endian='little')

 n - 180
 m - 140
 recl - n*m # = 25200

 ## calculate some indices for day 1 and 2
 for (i in 1:6){
 strt - (i - 1)*recl + 1
 stp - strt + recl - 1
 print(c(strt, stp))
 }

 ## for day 1 in 1961
 prcp - ccc[1:25200]
 prcp[prcp  -90] - NA
 dim(prcp) - c(n, m)
 image(prcp)

 rstn - ccc[25201:50400]
 rstn[rstn  -90] - NA
 dim(rstn) - c(n, m)
 image(rstn)

 rsnw - ccc[50401:75600]
 rsnw[rsnw  -90] - NA
 dim(rsnw) - c(n, m)
 image(rsnw)



 I will leave it to you to interpret rstn and rsnw in regards to prcp.




 Yours sincerely / Med venlig hilsen


 Frede Aakmann Tøgersen
 Specialist, M.Sc., Ph.D.
 Plant Performance  Modeling

 Technology  Service Solutions
 T +45 9730 5135
 M +45 2547 6050
 fr...@vestas.com
 http://www.vestas.com

 Company reg. name: Vestas Wind Systems A/S
 This e-mail is subject to our e-mail disclaimer statement.
 Please refer to www.vestas.com/legal/notice
 If you have received this e-mail in error please contact the sender.


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of eliza botto
 Sent: 27. marts 2014 13:26
 To: Pascal Oettli
 Cc: r-help@r-project.org
 Subject: Re: [R] reading dataset

 Dear Pascal,
 Thanks for your reply. From your answer I perceived that if followings are
 first three elements of a file
  dput(ccc[1:3])
 c(0.15912090241909, 0.167244642972946, 0.192471280694008)
 then 0.15912090241909 is precipitation magnitude , 0.167244642972946 is
 RSTN and 0.192471280694008 is flag value.Did i get it right?
 Eliza



  From: kri...@ymail.com
  Date: Thu, 27 Mar 2014 12:39:30 +0900
  Subject: Re: [R] reading dataset
  To: eliza_bo...@hotmail.com
  CC: r-help@r-project.org
 
  Hello,
 
  Some hints:
 - for the year 1961, the total number of values is 27594000,
 - there are 180 longitudes and 140 latitudes,
 - there are 365 days,
 - there are 3 variables,
 
  Compare the total number of values and the result of (180 x 140 x 365 x 3).
 
  The order is precip, rstn, flag, precip, rstn, flag,
  precip, rstn, flag...
 
  Hope this helps,
  Pascal
 
  On Thu, Mar 27, 2014 at 9:45 AM, eliza botto eliza_bo...@hotmail.com
 wrote:
   Dear useRs,
   A similar question has previously been asked by another user
 (https://stat.ethz.ch/pipermail/r-sig-geo/2011-September/012791.html) but
 i'll try to discuss it from another angle. Its about data reading. I am 
 trying to
 read to read a data-set APHRO_MA_050deg_V1101R2.1961.gz from
 http://www.chikyu.ac.jp/precip/cgi-
 bin/aphrodite/script/aphrodite_cgi.cgi/download?file=%2FV1101R2%2FAPH
 RO_MA%2F050deg.
   I copied the command from previous post which is
   ccc -readBin(APHRO_MA_050deg_V1101R2.1961, numeric(), n=1e8,
 size=4, signed=TRUE, endian='little')
   Followings are what I know about the structure of data set. The file
 contains daily fields for 365 days. These daily fields are arranged 
 according to
 the Julian calendar.  Daily
   fields (data arrays) contain information on the precipitation amount and
   ratio of 0.05-degree cells containing a rain gauge.  In the case the 
   given
 file which is a
   0.5-degree grid file, each field consists of a data array with longitude
   by latitude dimensions of  180 x 140 elements for APHRO_MA.
The first element is a cell at the southwest corner centered at [60.25E,
 14.75S], the second
   is a cell at [60.75E, 14.75S], ..., the 180th is a cell at [149.75E,
   14.75S], and the 181st is a cell at [60.25E, 14.25S]. The data files are
 written in PLAIN DIRECT ACCESS BINARY.  In each daily field, the array for
 precipitation comes first, followed by
   information on the rain gauge. Each element (both precipitation and
   rain gauge information) is written as a 4-byte floating-point number
   in little endian byte order.  Users should swap the byte order to
   big endian if necessary.  There are no 'space', 'end of record', or
   'end of file' marks in between.  As it says that precipitation data is 
   in the
 form of array which comes first, followed by the information on rain gauge,
 how do I know which element is precipitation data and which is the
 information of the rain gauge?Thankyou very  much in advance
  
   Eliza

Re: [R] accessing members of a list

2014-03-27 Thread Pascal Oettli
Hello,

Your example leads to error. Anyway:

library(XML)
oneurl=http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm;
temp.tables=readHTMLTable(oneurl, header=TRUE)

temp.tables - temp.tables[[3]]
temp.tables - temp.tables[1:30,]

HTH,
Pascal


On Fri, Mar 28, 2014 at 2:42 PM, Bill william...@gmail.com wrote:
 Hi. I ran some code and I am trying to access the table with the data in
 it. I want in particular to delete the 31st row for example
 Monthly means and totals: NA NA NA   NA NA  NA NA NA NA
 NA NA NA NA
 or remove the names of the columns (or change them). DayT   TM   Tm
  SLPHPP   VVV   VM   VG   RA   SN   TS

 I tried all sorts of things but they don't give me access:

 library(XML)
 oneurl=http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm;
 allFuku=data.frame() #need to initialize it with column names
 temp.tables=readHTMLTable(url)

 temp.tables[3][2]
 temp.tables[3]
 temp.tables[3][3]
 temp.tables[3][2,]
 str(temp.tables[3])
 temp.tables[3][2,2]
 dim(temp.tables[3])
 temp.tables[3]$SN
 temp.tables[3][1]
 temp.tables[3][1][2,]
 str(temp.tables[3][1])
 temp.tables[3][1]$SN
  temp.tables[3][1][1][2,]

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Centered difference operation on matrix with R

2014-03-27 Thread Pascal Oettli
Dear list members,

I am wondering whether there is any more efficient way to calculate
centered difference on matrix in R? Please see herewith an example:

lon - matrix(rep(seq(0,2,length.out=1e3), 1e3), 1e3, 1e3)
lat - matrix(rep(seq(0,2,length.out=1e3), each=1e3), 1e3, 1e3)
x - matrix(rep(seq(0.01,2,length.out=1e3), 1e3), 1e3, 1e3)
y - matrix(rep(seq(0.01,2,length.out=1e3), each=1e3), 1e3, 1e3)
u - y * cos(x)
v - y * sin(x)

to.rad - pi/180
dx - diff(lon,2); dx - rbind(NA,dx,NA); dx - dx*to.rad
dy - t(diff(t(lat),2)); dy - cbind(NA,dy,NA); dy - dy*to.rad

du - t(diff(t(u * cos(lat*to.rad)),2)); du - cbind(NA,du,NA)
dv - diff(v,2); dv - rbind(NA,dv,NA)

Best Regards,
Pascal Oettli

__
R-help@r-project.org mailing list
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] Question about c.trellis (latticeExtra)

2014-03-26 Thread Pascal Oettli
Dear r-help mailing list readers,

I am facing a problem using the c.trellis function from the
latticeExtra package, to merge 2 trellis objects (1 levelplot and 1
xyplot).

Using the following example, it works well without customizing the
y-axis of levObj1. But when the y-axis is customized (levObj2), it
fails. The y-axis of xyObj becomes similar to levObj2. Is there
any solution to this?

Best Regards,
Pascal Oettli


library(lattice)
library(latticeExtra)

set.seed(123)
grid1 - expand.grid(x=1:10, y=1:9)
grid1$z - rnorm(10*9, mean=4, sd=1)

grid2 - data.frame(x=1:10, y=rnorm(10, sd=10))

# let levelplot determine the y-axis
levObj1 - levelplot(z ~ x+y, grid1, colorkey=list(space='bottom'))

# now, let's customize the y-axis
levObj2 - levelplot(z ~ x+y, grid1, colorkey=list(space='bottom'),
scales=list(y=list(at=1:9, labels=2^(1:9

xyObj - xyplot(y ~ x, grid2, t='l')

# correct labelling for both objects
x11()
cObj1 - c(levObj1, xyObj, layout=1:2)
update(cObj1, ylab=c(Correct y-axis, Correct y-axis))

# correct labelling for levelplot, not for xyplot
x11()
cObj2 - c(levObj2, xyObj, layout=1:2)
update(cObj2, ylab=c(Correct customized y-axis, Incorrect y-axis))

__
R-help@r-project.org mailing list
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] reading dataset

2014-03-26 Thread Pascal Oettli
Hello,

Some hints:
   - for the year 1961, the total number of values is 27594000,
   - there are 180 longitudes and 140 latitudes,
   - there are 365 days,
   - there are 3 variables,

Compare the total number of values and the result of (180 x 140 x 365 x 3).

The order is precip, rstn, flag, precip, rstn, flag,
precip, rstn, flag...

Hope this helps,
Pascal

On Thu, Mar 27, 2014 at 9:45 AM, eliza botto eliza_bo...@hotmail.com wrote:
 Dear useRs,
 A similar question has previously been asked by another user 
 (https://stat.ethz.ch/pipermail/r-sig-geo/2011-September/012791.html) but 
 i'll try to discuss it from another angle. Its about data reading. I am 
 trying to read to read a data-set APHRO_MA_050deg_V1101R2.1961.gz from 
 http://www.chikyu.ac.jp/precip/cgi-bin/aphrodite/script/aphrodite_cgi.cgi/download?file=%2FV1101R2%2FAPHRO_MA%2F050deg.
 I copied the command from previous post which is
 ccc -readBin(APHRO_MA_050deg_V1101R2.1961, numeric(), n=1e8, size=4, 
 signed=TRUE, endian='little')
 Followings are what I know about the structure of data set. The file contains 
 daily fields for 365 days. These daily fields are arranged according to the 
 Julian calendar.  Daily
 fields (data arrays) contain information on the precipitation amount and
 ratio of 0.05-degree cells containing a rain gauge.  In the case the given 
 file which is a
 0.5-degree grid file, each field consists of a data array with longitude
 by latitude dimensions of  180 x 140 elements for APHRO_MA.
  The first element is a cell at the southwest corner centered at [60.25E, 
 14.75S], the second
 is a cell at [60.75E, 14.75S], ..., the 180th is a cell at [149.75E,
 14.75S], and the 181st is a cell at [60.25E, 14.25S]. The data files are 
 written in PLAIN DIRECT ACCESS BINARY.  In each daily field, the array for 
 precipitation comes first, followed by
 information on the rain gauge. Each element (both precipitation and
 rain gauge information) is written as a 4-byte floating-point number
 in little endian byte order.  Users should swap the byte order to
 big endian if necessary.  There are no 'space', 'end of record', or
 'end of file' marks in between.  As it says that precipitation data is in the 
 form of array which comes first, followed by the information on rain gauge, 
 how do I know which element is precipitation data and which is the 
 information of the rain gauge?Thankyou very  much in advance

 Eliza
 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] how to check capabilities of an graphics device?

2014-03-24 Thread Pascal Oettli
Hello,

You can check the output of:

R capabilities(what = NULL)

Regards,
Pascal

On Mon, Mar 24, 2014 at 8:57 PM, Witold E Wolski wewol...@gmail.com wrote:
 Before plotting to an device, I would like check which
 capabilities/properties it has to avoid
 warnings such as:

 In plot.xy(xy, type, ...) :
   semi-transparency is not supported on this device: reported only once per 
 page




 --
 Witold Eryk Wolski

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Error: cannot allocate vector of size 5.2 Gb

2014-03-20 Thread Pascal Oettli
Hello,

It is not the right way to read a NetCDF file  (according to the
extension) in R. Please have a look at the ncdf4 package. The
raster package is also able to read this kind of files.

Regards,
Pascal

On Fri, Mar 21, 2014 at 1:25 AM, eliza botto eliza_bo...@hotmail.com wrote:
 Dear R family,
 I am trying to read a real large dataset in R (~ 2Gb). Its in binary format. 
 When i tried to read it by using following command
 readBin(DAT.dat.nc, numeric(), n=9e8, size=4, signed=TRUE, endian='little')
 I got the following error
 Error: cannot allocate vector of size 5.2 Gb
 I have a Ram of 4Gb. I even tried to allocate more space to it by 
 memory.limit(size=9) but to no use.
 What do i do? Buy a new ram or act smart?
 Thankyou very much in advance
 Eliza
 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] 2013-06-28 coverts to 15884?

2014-03-19 Thread Pascal Oettli
Hello,

It works for me:

R MaxUpdated_row - NULL
R MaxUpdated_val - 2013-06-28
R
R
R rbind(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d))
  [,1]
[1,] 15884
R c(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d))
[1] 15884
R c(MaxUpdated_row, MaxUpdated_val)
[1] 2013-06-28
R

Regards,
Pascal

On Thu, Mar 20, 2014 at 6:46 AM, Jason Rupert jasonkrup...@yahoo.com wrote:
 MaxUpdated_row-NULL
 MaxUpdated_val- 2013-06-28


 rbind(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d))
   [,1]
 [1,] 15884

 c(MaxUpdated_row, as.Date(MaxUpdated_val, %Y-%m-%d))
[1] 15884
 c(MaxUpdated_row, MaxUpdated_val)
[1] 15884

 Evidently, I'm again missing something simple, as I would prefer to be able 
 to see the actual date to be shown.

 I found a work around, but I don't like it, as I have to convert back to date 
 later:
 c(MaxUpdated_row, as.character(MaxUpdated_val))

 Any alternatives suggestions are much appreciated.
 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] open unknown file format in R

2014-03-18 Thread Pascal Oettli
Hello,

It is not around the world. It is only for Japan (AphroJP,
123°E-146°E, 24°N-46°N,  resolution 0.05x0.05 i.e. 440 rows x 460
columns). You can store in a Raster* object then extract the grid
points you need, with the coordinates.

HTH
Pascal



On Tue, Mar 18, 2014 at 9:21 PM, eliza botto eliza_bo...@hotmail.com wrote:
 Hi Pascal,

 Your code worked out perfectly but I have one question though. You wrote
 that you did not use stations. What if I want to read stations as i am only

 interest in a part of data. I need it because the file has data for 202400
 stations around the globe and I am only interest in data of 22 stations.

 Thankyou very much in advance,

 Eliza


 From: kri...@ymail.com
 Date: Tue, 18 Mar 2014 08:51:01 +0900
 Subject: Re: [R] open unknown file format in R
 To: eliza_bo...@hotmail.com
 CC: r-help@r-project.org

 Hello,

 It is in binary format. I didn't use stations. But to read the gridded
 format, I used:

  readBin(fid, numeric(), n=1e8, size=4, signed=TRUE, endian='little')

 where file is the connection created with file()

 Hope this helps,
 Pascal




 On Tue, Mar 18, 2014 at 4:06 AM, eliza botto eliza_bo...@hotmail.com
 wrote:
  Dear R-Family,
  I have just downloaded a massive data file from internet
  (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with .gz.
  When I uncompressed
  it, the file was saved in the name (AphroJP_62STN_V1005.1900) of unknown
  format. How can I open it in R?
  thankyou very much indeed in advance,
  Eliza
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] open unknown file format in R

2014-03-18 Thread Pascal Oettli
Hello,

http://www.chikyu.ac.jp/precip/products/index.html

HTH,
Pascal


On Tue, Mar 18, 2014 at 10:09 PM, eliza botto eliza_bo...@hotmail.com wrote:
 Thankyou very much indeed.My limited knowledge of R is forcing me to ask you
 that how did you know the following information (AphroJP, 123°E-146°E,
 24°N-46°N, resolution 0.05x0.05 i.e. 440 rows x 460columns)?

 Thanks,

 Eliza


 From: kri...@ymail.com
 Date: Tue, 18 Mar 2014 21:39:58 +0900

 Subject: Re: [R] open unknown file format in R
 To: eliza_bo...@hotmail.com
 CC: r-help@r-project.org

 Hello,

 It is not around the world. It is only for Japan (AphroJP,
 123°E-146°E, 24°N-46°N, resolution 0.05x0.05 i.e. 440 rows x 460
 columns). You can store in a Raster* object then extract the grid
 points you need, with the coordinates.

 HTH
 Pascal



 On Tue, Mar 18, 2014 at 9:21 PM, eliza botto eliza_bo...@hotmail.com
 wrote:
  Hi Pascal,
 
  Your code worked out perfectly but I have one question though. You wrote
  that you did not use stations. What if I want to read stations as i am
  only
 
  interest in a part of data. I need it because the file has data for
  202400
  stations around the globe and I am only interest in data of 22 stations.
 
  Thankyou very much in advance,
 
  Eliza
 
 
  From: kri...@ymail.com
  Date: Tue, 18 Mar 2014 08:51:01 +0900
  Subject: Re: [R] open unknown file format in R
  To: eliza_bo...@hotmail.com
  CC: r-help@r-project.org
 
  Hello,
 
  It is in binary format. I didn't use stations. But to read the gridded
  format, I used:
 
   readBin(fid, numeric(), n=1e8, size=4, signed=TRUE, endian='little')
 
  where file is the connection created with file()
 
  Hope this helps,
  Pascal
 
 
 
 
  On Tue, Mar 18, 2014 at 4:06 AM, eliza botto eliza_bo...@hotmail.com
  wrote:
   Dear R-Family,
   I have just downloaded a massive data file from internet
   (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed
   with .gz.
   When I uncompressed
   it, the file was saved in the name (AphroJP_62STN_V1005.1900) of
   unknown
   format. How can I open it in R?
   thankyou very much indeed in advance,
   Eliza
   [[alternative HTML version deleted]]
  
   __
   R-help@r-project.org mailing list
   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.
 
 
 
  --
  Pascal Oettli
  Project Scientist
  JAMSTEC
  Yokohama, Japan



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Help with finding mean at 1 second interval

2014-03-18 Thread Pascal Oettli
Hello,

Please have a look at the xts package.

Please don't post in HTML.

Regards,
Pascal

On Wed, Mar 19, 2014 at 12:26 AM, Satish Anupindi Rao
satish.anupindi@ericsson.com wrote:
 Hi,
 I have a zoo object with the first column as index. The columns have not been 
 named yet... but that I can change. It looks like this :
   V2 V3 V4 V5 V6
 2014-03-14 22:41:46.988804  10   2   8   3  14
 2014-03-14 22:41:46.991126  13   4   9   5  15
 2014-03-14 22:41:46.993506  12   4   8   3  14
 2014-03-14 22:41:46.993755  19   4  15   5  22
 2014-03-14 22:41:46.997780  21   5  16   7  24
 2014-03-14 22:41:47.000154  18   5  13   3  21
 2014-03-14 22:41:47.002376  21   5  16   6  23
 2014-03-14 22:41:47.011106  12   4   8   3  14
 2014-03-14 22:41:47.012691  12   4   8   3  16
 2014-03-14 22:41:47.017579  11   2   9   3  12
 2014-03-14 22:41:47.019463  12   5   7   3  15
 2014-03-14 22:41:47.020247  14   6   8   3  17

 I would like to find the mean of the V2 to V6 columns on a per second 
 interval. Would anyone please be able to help me with a function and 
 implementation for that please?

 Thanks so much!


 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Unable to install Rhipe package for R version 3.0.2 in ubuntu-12.04

2014-03-18 Thread Pascal Oettli
Hello,

There is no package called Rhipe on R CRAN

Any web search engine is your friend: https://www.datadr.org/install.html

Regards,
Pascal

On Wed, Mar 19, 2014 at 12:34 AM, karthik kapil.gandr...@nuevora.com wrote:
 Hello,

   I have ubuntu 12.04 OS with R 3.0.2 version. My problem is I am getting
 message like Rhipe packages is not available for R version 3.0.2.

 Please let me know in case you have a workaround or any solution for
 installing Rhipe in R 3.0.2 (for Ubuntu).


 Regards,
 Karthik



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Unable-to-install-Rhipe-package-for-R-version-3-0-2-in-ubuntu-12-04-tp4687052.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] open unknown file format in R

2014-03-17 Thread Pascal Oettli
Hello,

It is in binary format. I didn't use stations. But to read the gridded
format, I used:

 readBin(fid, numeric(), n=1e8, size=4, signed=TRUE, endian='little')

where file is the connection created with file()

Hope this helps,
Pascal




On Tue, Mar 18, 2014 at 4:06 AM, eliza botto eliza_bo...@hotmail.com wrote:
 Dear R-Family,
 I have just downloaded a massive data file from internet 
 (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with .gz. 
 When I uncompressed
 it, the file was saved in the name (AphroJP_62STN_V1005.1900) of unknown 
 format. How can I open it in R?
 thankyou very much indeed in advance,
 Eliza
 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Access column after hp filter

2014-03-16 Thread Pascal Oettli
Dear Sabina,

If you carefully read the help page (always a good idea), examples
show you that it is object$cycle, not object$Cycle. Also, you can
use names, i.e. names(e.hp$).

HTH,
Pascal

On Sun, Mar 16, 2014 at 12:56 AM, Liana-Sabina Luncasu
lianasabinalunc...@gmail.com wrote:
 Dear all,

 I am working with some time series data and I applied an HP filter to it
 using the following code:

 e.hp = hpfilter(empl)

 Now I am trying to access the last column (Cycle), that is, to save it in a
 separate vector. I tried with both e.hp$Cycle and e.hp[ , 3] but none of
 them works. I get the following:

 e.hp$Cycle
 NULL
 e.hp[,3]
 Error in e.hp[, 3] : incorrect number of dimensions


 Does anyone have any solution?

 Thank you in advance.

 Sabina

 P.S. Below I provide the result of the hpfilter

 e.hp

 Title:
  Hodrick-Prescott Filter

 Call:
  hpfilter(x = empl)

 Method:
  hpfilter

 Filter Type:
  lambda

 Series:
  empl

  empl Trend Cycle
 1980 Q1 929.6 929.9 -0.294800
 1980 Q2 929.8 930.1 -0.255385
 1980 Q3 930.3 930.2  0.105146
 1980 Q4 931.4 930.4  1.061102
 1981 Q1 932.7 930.5  2.142883
 1981 Q2 933.6 930.7  2.879701

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Access column after hp filter

2014-03-16 Thread Pascal Oettli
Sorry, typo. It should be names(e.hp)

Pascal

On Sun, Mar 16, 2014 at 3:42 PM, Pascal Oettli kri...@ymail.com wrote:
 Dear Sabina,

 If you carefully read the help page (always a good idea), examples
 show you that it is object$cycle, not object$Cycle. Also, you can
 use names, i.e. names(e.hp$).

 HTH,
 Pascal

 On Sun, Mar 16, 2014 at 12:56 AM, Liana-Sabina Luncasu
 lianasabinalunc...@gmail.com wrote:
 Dear all,

 I am working with some time series data and I applied an HP filter to it
 using the following code:

 e.hp = hpfilter(empl)

 Now I am trying to access the last column (Cycle), that is, to save it in a
 separate vector. I tried with both e.hp$Cycle and e.hp[ , 3] but none of
 them works. I get the following:

 e.hp$Cycle
 NULL
 e.hp[,3]
 Error in e.hp[, 3] : incorrect number of dimensions


 Does anyone have any solution?

 Thank you in advance.

 Sabina

 P.S. Below I provide the result of the hpfilter

 e.hp

 Title:
  Hodrick-Prescott Filter

 Call:
  hpfilter(x = empl)

 Method:
  hpfilter

 Filter Type:
  lambda

 Series:
  empl

  empl Trend Cycle
 1980 Q1 929.6 929.9 -0.294800
 1980 Q2 929.8 930.1 -0.255385
 1980 Q3 930.3 930.2  0.105146
 1980 Q4 931.4 930.4  1.061102
 1981 Q1 932.7 930.5  2.142883
 1981 Q2 933.6 930.7  2.879701

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Colorspace: bug in HLS conversion?

2014-03-13 Thread Pascal Oettli
Hi,

I cannot reproduce your result:

R as(as(RGB(0, 0, 0), HLS), RGB)
 R G B
[1,] 0 0 0

You probably should provide the output of sessionInfo().

Regards,
Pascal



On Thu, Mar 13, 2014 at 7:41 AM, Michael Gauland mikely...@amuri.net wrote:
 I just started using the colorspace package, and converting between RGB and
 HLS is not working as I expect.  In particular, converting RGB(0,0,0) to HLS
 then back to RGB seems broken:

 # as(as(RGB(0, 0, 0), HLS), RGB)
  R G B
 [1,] 1 1 0

 That is, converting black to HLS then back again produces yellow!

 Other values I've tried work as expected (i.e., I get the same RGB value out
 as I put in).

 Is this a bug in the code, or in my understanding of colour conversions?

 Kind Regards,
 Mike

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] replace duplicates with 0

2014-03-13 Thread Pascal Oettli
Hello,

Dis you at least search?

?duplicated

Regards,
Pascal

On Thu, Mar 13, 2014 at 9:35 PM, catalin roibu catalinro...@gmail.com wrote:
 Dear all!

 Is there a possibility to replace all duplicates values in data frame with
 0?

 Thank you very much!



 --
 ---
 Catalin-Constantin ROIBU
 Lecturer PhD, Forestry engineer
 Forestry Faculty of Suceava
 Str. Universitatii no. 13, Suceava, 720229, Romania
 office phone +4 0230 52 29 78, ext. 531
 mobile phone   +4 0745 53 18 01
+4 0766 71 76 58
 FAX:+4 0230 52 16 64
 silvic.usv.ro

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Assign numbers in R

2014-03-12 Thread Pascal Oettli
Hello,

For your example, the following will work:

R d - c(8,7,5,5,3,3,2,1,1,1)
R idx - 1:length(unique(d))
R rep(idx, rle(d)$length)
 [1] 1 2 3 3 4 4 5 6 6 6

HTH,
Pascal

On Wed, Mar 12, 2014 at 6:13 PM, T Bal studentt...@gmail.com wrote:
 Hi,
 I have the following numbers:

 d - c(8,7,5,5,3,3,2,1,1,1)

 I want to convert these into the following numbers:

 r:
 1,2,3,3,4,4,5,6,6,6

 So if two numbers are different increment it if they are same then assign
 the same number:

 r - NULL

 for (i in 1:length(d)) {

  if (d[i] != d[i+1]) {
   r[i] =i+1;
  }
  else {
   r[i] = i;
  }
  }

 But this is not correct. How can I solve this problem? or how can I solve
 it in a different way? Thanks a lot!

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] grab values in R

2014-03-11 Thread Pascal Oettli
Hello,

To me, and maybe for others, it is beyond understanding. Please clarify.

Regards,
Pascal

On Tue, Mar 11, 2014 at 7:02 PM, catalin roibu catalinro...@gmail.com wrote:
 Hello all!

 I have a problem with R. How can I do this assemble the ELM PRP for each ua.
 My data is like this:

 ua ELM PRP  122C MO 5  122C BR 3  122C FA 1  122C MO 1  122D BR 7  122D MO 2
 122D BR 1

 and I want to obtain something like this:

  ua ELM PRP  122C MO 6  122C BR 3  122C FA 1  122D BR 8  122D MO 2

 Thank you very much!


 --


 ---
 Catalin-Constantin ROIBU
 Lecturer PhD, Forestry engineer
 Forestry Faculty of Suceava
 Str. Universitatii no. 13, Suceava, 720229, Romania
 office phone +4 0230 52 29 78, ext. 531
 mobile phone   +4 0745 53 18 01
+4 0766 71 76 58
 FAX:+4 0230 52 16 64
 silvic.usv.ro

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] ts instead of xts object

2014-03-11 Thread Pascal Oettli
Hello,

On Tue, Mar 11, 2014 at 8:45 PM, Joshua Ulrich josh.m.ulr...@gmail.com wrote:
 On Tue, Mar 11, 2014 at 12:14 AM, Bill william...@gmail.com wrote:

 Hello. I have a dataframe that has a date column. The intervals between
 dates vary. I want to convert this to a ts object. I was able to convert it
 to an xts object but the package I want to analyse this data with (called
 'changepoint') does not seem to want to deal with xts. In the example they
 give they use the following:

 data(discoveries)
 dis.pelt=cpt.meanvar(discoveries,test.stat='Poisson',method='PELT')
 plot(dis.pelt,cpt.width=3)
 cpts.ts(dis.pelt)

 and if I check:
 str(discoveries)
  Time-Series [1:100] from 1860 to 1959: 5 3 0 2 0 3 2 3 6 1 ...

 If I try with my data
 str(testTSRad)
 An 'xts' object on 2011-07-16 07:08:02/2013-09-20 01:25:48 containing:
   Data: num [1:501, 1] 76 77 79 86 79 79 85 86 89 88 ...
   Indexed by objects of class: [POSIXct,POSIXt] TZ:
   xts Attributes:
  NULL

 where I used this:

 testTSRad=xts(radSampPerRegion[[2]][
 ,2],order.by=as.POSIXct(radSampPerRegion[[2]][
 ,1]))

 I get this:

 testt=cpt.mean(testTSRad)
 Error in single.mean.norm(data, penalty, pen.value, class, param.estimates)
 :
   Data must have atleast 2 observations to fit a changepoint model.

 This is because of what ?cpt.mean says about the data argument:
 data: A vector, ts object or matrix containing the data within
   which you wish to find a changepoint.  If data is a matrix,
   each row is considered a separate dataset.

 An xts object is a matrix (with an index attribute), so each row is
 considered a separate data set.  Your object only has one column,
 hence only one observation per data set.  Things will work if you drop
 the dimensions of your single-column xts object:
 testt - cpt.mean(drop(testTSRad))

 My data is below. Is there a way to convert it to ts?

 Yes, as is generally the case, use the as method:
 as.ts(testTSRad)


But in this case, the time serie will have a frequency of 1, which is
inconsistent with irregular sampling. This probably will lead to
inaccurate results

 Best,
 --
 Joshua Ulrich  |  about.me/joshuaulrich
 FOSS Trading  |  www.fosstrading.com

 __
 R-help@r-project.org mailing list
 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.

Regards,
Pascal

-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Read text file

2014-03-11 Thread Pascal Oettli
Hello,

See the fill option of the read.csv function. But be careful, it
might lead to erroneous results, as explained in the help page...

And there is neither $GPGLL nor $GPGLA in your example.

Regards,
Pascal

On Tue, Mar 11, 2014 at 9:00 PM, Alaios ala...@yahoo.com wrote:
 Hi all
 I am trying to read some text files with the following format:

 1377262633.948000
 $GPRMC,125708.00,A,5047.66107,N,00603.65528,E,0.203,247.36,230813,,,A*60
 1377262633.958000$GPVTG,247.36,T,,M,0.203,N,0.377,K,A*3B
 1377262633.968000
 $GPGGA,125708.00,5047.66107,N,00603.65528,E,1,09,0.85,169.3,M,46.5,M,,*52
 1377262633.978000
 $GPGSA,A,3,29,21,31,25,16,05,06,13,271.78,0.85,1.57*0C
 1377262633.998000
 $GPGSV,3,1,12,03,01,266,,05,16,043,39,06,21,263,43,13,07,330,43*70
 1377262634.008000
 $GPGSV,3,2,12,16,37,302,45,18,03,149,,21,59,166,33,23,04,304,16*75
 1377262634.028000
 $GPGSV,3,3,12,25,18,129,21,27,11,260,39,29,45,071,47,31,35,211,47*7C

 but this returns me the following:

 read.csv(sensor_0.log,sep=,)
 Error in read.table(file = file, header = header, sep = sep, quote = quote,  :
   more columns than column names

 I guess the problem is that the columns are not consistent on a per row basis.
 What  I am trying to do though is to read only the lines that contain the 
 $GPGLL or the $GPGLA entries (in the example they corresponds to 3rd and 4th 
 line).
 How can I do this in R?

 Regards
 A
 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] R Help

2014-03-10 Thread Pascal Oettli
Hello,

And what are you expecting the command setwd to do?

Regards,
Pascal

On Mon, Mar 10, 2014 at 5:59 PM, Jon Nash jon.n...@hvhs.school.nz wrote:
 I have just installed R 3.0.3 on Windows 7.

 I open up the GUI and type setwd(c:/users/jon) and press return. Nothing
 happens, Ive tried manuals, forums etc ...

 An ex-student needs help using this program.  I spent 7 years as an IT
 consultant before becoming a maths teacher so Im better than average with
 IT and I cant get it to do anything at all.  What's up?  Any help greatly
 appreciated.

 Jon

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] package opVar

2014-03-08 Thread Pascal Oettli
Hello,

There is no package opVar in the available CRAN packages list.

Regards,
Pascal

On Sat, Mar 8, 2014 at 6:06 PM, Charles Thuo tcmui...@gmail.com wrote:
 Hello,

 I was attempting to install the package opVAr and got the following message

 Warning message:
 package 'opVar' is not available (for R version 3.0.2)


 Is this package available at all.

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Error with glmulti

2014-03-07 Thread Pascal Oettli
Hello,

Your message is incomplete. And please don't post in HTML.

Regards.

On Fri, Mar 7, 2014 at 5:16 AM, Alicia Ellis alicia.m.el...@gmail.com wrote:
 I am analyzing some data that came from demographic health surveys.  The
 data contain information for individuals within households, that are
 located within clusters, that are located within survey years, that are
 located within countries.  We are trying to find the best model from a
 subset of predictors, and all models must contain the random variable of
 household within cluster within year within country.

 We are running models on a server with 64GB memory and 6 CPU cores

 Data are available at:

 First, we tested a linear mixed model using the lmer package:

 ## Install Packages ##

 library(lme4)
 library(glmulti)

 ## Clear all memory/objects ##
  rm(list=ls())
  ## Read in Data ##

 mydata = read.csv(kr.and.GIS.cleaned.Residents.only.csv)

  ###
 ## Try lmer model NO Interactions ##
 ###
 ptm - proc.time()

 lmer.model = lmer(stunt.dhs ~
dis_ed_des+
 tc_pa+
 avg_clu_tc+
  dist_road+
 pden_lscan+
 URBAN_RURA+
 time.water+
  wealth.index +
 (1|country.code.short/year/cluster/household),
 mydata,
 REML = F)
 print(lmer.model)

 proc.time() - ptm


 This works fine and gives the following output
 --
 Alicia Ellis
 Postdoc
 Gund Institute for Ecological Economics
 University of Vermont
 617 Main Street
 Burlington, VT  05405
 (802) 656-1046
 http://www.wcs-heal.org
 http://www.uvm.edu/~aellis5
  http://entomology.ucdavis.edu/faculty/scott/aellis/

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Extracting slope coefficients for each team

2014-03-03 Thread Pascal Oettli
Hello Amanuel,

The help page is made for. Please read it and you will get the answer
to your question.

Regards,
Pascal


On Tue, Mar 4, 2014 at 1:33 AM, Amanuel Tekleab agtekl...@gmail.com wrote:
 Dear R-ers,

 I am analyzing longitudinal data using R.  My objective is to test a
 relationship between a change in a variable (say X) and a change in another
 variable (say y).  I have collected data at three time periods on both
 variables.  I was able to run whether there was slope variability among the
 teams on each of the two variables.  Thus, I ran (for each variable):

 model.time.x-lme(x ~ Time, random=1|GroupID,data=NA)
 model.time.x.1 - lme(x ~ Time, random=Time|GroupID,data=NA)
 anova (model.time.x,model.time.x.1)

 and

 model.time.y-lme(y ~ Time, random=1|GroupID,data=NA)
 model.time.y.1 - lme(y ~ Time, random=Time|GroupID,data=NA)
 anova (model.time.y,model.time.y.1)

 The results from the ANOVA functions above showed that the random models
 were superior to the fixed models, supporting slope variability among the
 teams.

 In order to test the relationship between the CHANGE in these two
 variables, I wanted to extract the slope coefficients for each team from
 model.time.x.1 and corresponding model.time.y.1, and use these
 coefficients in SPSS to run a simple regression.

 My question is: what is the function and/or the procedure to extract the
 coefficients from these models?

 I thank you for your help!

 Amanuel

 --
 Amanuel G. Tekleab, Ph.D.
 *Board of Visitors' Fellow*
 Associate Professor of Organizational Behavior
 School of Business Administration
 Wayne State University
 304 Prentis Bldg.
 Detroit, MI 48202
 Phone: 313-577-9211
 Fax: 313-577-5486

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] time series analysis

2014-02-27 Thread Pascal Oettli
Hello,

Maybe functions xts, endpoints and period.apply of the xts
package might help you.

Regards,
Pascal


On Fri, Feb 28, 2014 at 1:32 AM, Yang Yang simonyangy...@gmail.com wrote:
 Hi

 Currently I am working on a river discharge data analysis. I have the daily
 discharge record from 1935 to now. I want to extract the annual maximum
 discharge for each hydrolocial year (*start from 01/11 to next year 31/10*).
 However, I found that the hydroTSM package can only deal with the natural
 year. I tried to use the zoo package, but I found it's difficult to
 compute, as each year have different days. Does anyone have some idea?
 Thanks.

 the data looks like:

 01-11-1935 66302-11-1935 59603-11-1935 45004-11-1935 38105-11-1935
 35406-11-1935 312

 my code:

 mydata-read.table(discharge)
 colnames(mydata) - c(date,discharge)

 library(zoo)
 z-zooreg(mydata[,2],start=as.Date(1935-11-1))

 mydta$date - as.POSIXct(dat$date)

 q.month-daily2monthly(z,FUN=max,na.rm = TRUE,date.fmt =
 %Y-%m-%d,out.fmt=numeric)
 q.month.plain=coredata(q.month)

 z.month-zooreg(q.month.plain,start=1,frequency=12)

 Thanks very much.

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello,

Could you provide an example of unproperly formatted entry?

Regards,
Pascal


On 27 February 2014 15:03, Bill william...@gmail.com wrote:
 I have a dataframe that looks like the below. I want to convert the
 Captured.Time  field to a date object. but some of the entries are not
 properly formated and I get a message saying
 Error in as.POSIXlt.character(as.character(x), ...) :
   character string is not in a standard unambiguous format.

 So I want to write a function that will convert or delete. I could not
 figure out how to do that and so I tried to write a function that would
 convert or replace with text like noDateHere but that did not work either.
 Can anyone tell me how to accomplish this?
 Here is what I tried:

 convertOrOmit=function(dt){tryCatch(as.POSIXct(dt),error=print(noDateHere))}

   X   Captured.Time Latitude Longitude Value Unit Location.Name
 1 12696963 2012-08-07 11:00:51 39.16094  140.488345  cpm
 2  2056198 2013-11-10 03:14:19 32.84428 -117.224047  cpm
 3   727957 2014-01-28 04:47:54 35.80605  139.378928  cpm
 4  2864220 2013-10-22 19:41:53 35.07816 -106.612350  cpm
 5  5787688 2013-06-13 04:13:57 35.83174  136.202735  cpm
 6  6191345 2013-05-28 06:48:34 34.78944  137.949632  cpm
   Device.ID   MD5Sum Height Surface Radiation
 1NA b0465019b46289b82450c39ce1397b98 NANA
 2NA 8fa14a1227d23e6cf286785e8843cc39 NANA
 3NA c72cd7f9cedd59cf6e6892049dfbf9a0 NANA
 4NA aca82e39ff9098e45eea04f661f68dc7 NANA
 5NA cc9394e6dceb91f0e0de97cc2db57e19 NANA
 6NA f18d194a41e1448c7776dbeba8b351af NANA
Uploaded.Time Loader.ID
 1  2012-08-13 19:16:10.18555 10832
 2 2013-12-05 01:47:24.154971 13958
 3 2014-01-29 22:55:39.138043 14451
 4 2013-10-26 13:50:17.629869 13743
 5 2013-06-16 16:17:21.148239 12930
 6 2013-06-04 23:31:55.455323 12841

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello,

Did you tried the strptime function?

Regards,
Pascal

On 27 February 2014 15:24, Bill william...@gmail.com wrote:
 Hi. Thanks. Actually I don't know which ones are causing problems. I cannot
 search through it because it is quite large (15 million records)


 On Thu, Feb 27, 2014 at 7:22 PM, Pascal Oettli kri...@ymail.com wrote:

 Hello,

 Could you provide an example of unproperly formatted entry?

 Regards,
 Pascal


 On 27 February 2014 15:03, Bill william...@gmail.com wrote:
  I have a dataframe that looks like the below. I want to convert the
  Captured.Time  field to a date object. but some of the entries are not
  properly formated and I get a message saying
  Error in as.POSIXlt.character(as.character(x), ...) :
character string is not in a standard unambiguous format.
 
  So I want to write a function that will convert or delete. I could not
  figure out how to do that and so I tried to write a function that would
  convert or replace with text like noDateHere but that did not work
  either.
  Can anyone tell me how to accomplish this?
  Here is what I tried:
 
 
  convertOrOmit=function(dt){tryCatch(as.POSIXct(dt),error=print(noDateHere))}
 
X   Captured.Time Latitude Longitude Value Unit Location.Name
  1 12696963 2012-08-07 11:00:51 39.16094  140.488345  cpm
  2  2056198 2013-11-10 03:14:19 32.84428 -117.224047  cpm
  3   727957 2014-01-28 04:47:54 35.80605  139.378928  cpm
  4  2864220 2013-10-22 19:41:53 35.07816 -106.612350  cpm
  5  5787688 2013-06-13 04:13:57 35.83174  136.202735  cpm
  6  6191345 2013-05-28 06:48:34 34.78944  137.949632  cpm
Device.ID   MD5Sum Height Surface Radiation
  1NA b0465019b46289b82450c39ce1397b98 NANA
  2NA 8fa14a1227d23e6cf286785e8843cc39 NANA
  3NA c72cd7f9cedd59cf6e6892049dfbf9a0 NANA
  4NA aca82e39ff9098e45eea04f661f68dc7 NANA
  5NA cc9394e6dceb91f0e0de97cc2db57e19 NANA
  6NA f18d194a41e1448c7776dbeba8b351af NANA
 Uploaded.Time Loader.ID
  1  2012-08-13 19:16:10.18555 10832
  2 2013-12-05 01:47:24.154971 13958
  3 2014-01-29 22:55:39.138043 14451
  4 2013-10-26 13:50:17.629869 13743
  5 2013-06-16 16:17:21.148239 12930
  6 2013-06-04 23:31:55.455323 12841
 
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  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.



 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan





-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello,

I think this should be

z - strptime(radSampTrim$Captured.Time[1:30], %F %T)

Regards,
Pascal

On 27 February 2014 15:58, Bill william...@gmail.com wrote:
 I just tried this:

  z - strptime(radSampTrim$Captured.Time[1:30], %d%b%Y)
 z[1:3]
 [1] NA NA NA

 On Thu, Feb 27, 2014 at 7:39 PM, Pascal Oettli kri...@ymail.com wrote:

 strptime






-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello,

Maybe one possiblity is to search complete cases, such as
complete.cases(z), and subset according to the output.

It might also be interesting to check why you sometimes get NA.

Regards,
Pascal

On 27 February 2014 16:11, Bill william...@gmail.com wrote:
 Yes! that worked.
 By the way, still puzzled about how to write the function that would delete
 ones where there was an error in the function I used. Any idea on that?

 On Thu, Feb 27, 2014 at 8:06 PM, Pascal Oettli kri...@ymail.com wrote:

 z - strptime(radSampTrim$Captured.Time[1:30], %F %T)






-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] one last date object question please

2014-02-17 Thread Pascal Oettli
Hi Erin,

In the xts package, functions endpoints and period.apply are
quite flexible. It might helps you to achieve what you are trying to
do.

Regards,
Pascal

On 18 February 2014 12:01, Erin Hodgess erinm.hodg...@gmail.com wrote:
 Hello again!

 Using as.yearmon or as.yearqtr will produce an xts object.  Is there
 something for annual objects that works in the same way please?

 thanks,
 Erin

 --
 Erin Hodgess
 Associate Professor
 Department of Computer and Mathematical Sciences
 University of Houston - Downtown
 mailto: erinm.hodg...@gmail.com

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Inquiry

2014-02-12 Thread Pascal Oettli
Hi Kei,

Welcome.

I think you can first read an Introduction to R
(http://cran.r-project.org/doc/manuals/R-intro.pdf)

Then read the posting guide
http://www.R-project.org/posting-guide.html and provide commented,
minimal, self-contained, reproducible code, as requested when you ask
a question to the R-help mailing list.

Also, some specific questions have to be asked to specific mailing
list: http://www.r-project.org/mail.html

Hope this helps,
Pascal

On 13 February 2014 11:01, Kei_Takeuchi kt...@jari.or.jp wrote:
 Dear R users,

 Hello, this is Kei Takeuchi in Japan.

 I have started to use R(windows, version3.0.2) and have a problem. I
 think it is not difficlut but since I am beginner of R, I have no way to
 solve it.

 Where can I post my question?

 Thank you in advance.

 Kei Takeuchi

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] lattice question: removing strips

2014-02-10 Thread Pascal Oettli
Hello,

Please provide a commented, minimal, self-contained, reproducible
code, as requested.

Regards,
Pascal

On 10 February 2014 19:48, Martin Ivanov tra...@abv.bg wrote:
  Dear lattice users,

 I am trying to produce a lattice graph with two conditioning variables.
 My problem is that I only want to show the strips for the levels of the 
 second conditioning variable.
 I want to remove the strips for the levels of the first conditioning variable.
 I tried with the strip function, but if I tell it to return FALSE or NULL 
 whenever which.given == 1, I just get empty space below the strips for the 
 second conditioning variable. And I want to remove that space altogether. Is 
 it somehow achievable in lattice?

 I also tried setting layout.heights$strip to 0 when which.given == 1, but it 
 seems to only work globally, so either
 the strips for both conditioning variables vanish, or both are present.

 Any suggestions will be appreciated.


 Best regards,

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Conditional recoding for purpose of imputing

2014-02-09 Thread Pascal Oettli
Hello Ana,

The syntax is:
y - ifelse(x==1, 'YES', 'NO')

Hope this helps,
Pascal

On 10 February 2014 13:03, Ana Genkova ani.genk...@gmail.com wrote:
 Hello,

 I am trying the ifelse command for imputing a variable based on a
 conditional statement, but the NAs do not transform.  The code I am trying
 is:

 ifelse (x==1, y==NO, y==YES).  However, the number of NAs remains the
 same after the attempt.   I would like to turn all Y (NAs included) into a
 YES or a NO.

 Thanks in advance,

 Ana
 --
 Ana Genkova

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] correlog function in pgirmess package

2014-02-06 Thread Pascal Oettli
Hello,

I might be wrong, but I think it is in degree. Let's consider the
length of a degree of longitude at 38N in kilometers: ~88 km

Thus, 40d * 88km = 3520km

Hope this helps,
Pascal


On 5 February 2014 00:43, Alicia alicia.dalongevi...@cirad.fr wrote:
 Dear R-help,

 I used the correlog function of pgirmess package to create a spatial
 correlogram for Moran's I.
 The function gives Moran's coefficient with a p value for each distance
 class. My question is what is the unit for the distance classes?
 Here is the outcome of the function:

 Moran I statistic
   dist.class  coefp.valuen
  [1,]   1.283804 -0.0127393244 0.62182018 3288
  [2,]   3.851412 -0.0070005170 0.53767024 5642
  [3,]   6.419020 -0.0020360457 0.41371395 6546
  [4,]   8.986627  0.0173943620 0.07212314 5814
  [5,]  11.554235 -0.0225794695 0.84271228 4918
  [6,]  14.121842 -0.0050324772 0.49452160 3372
  [7,]  16.689450 -0.0007194256 0.42712852 2232
  [8,]  19.257058 -0.0162570231 0.60272799 1242
  [9,]  21.824665 -0.0330641732 0.74239660 1208
 [10,]  24.392273  0.0602675483 0.09440368  508
 [11,]  26.959881 -0.0007420201 0.43708138  270
 [12,]  29.527488  0.0765320993 0.10876925  190
 [13,]  32.095096 -0.0046161786 0.44659399  142
 [14,]  34.662703 -0.0797066199 0.61910376   58
 [15,]  37.230311 -0.7840212074 0.99986700   28
 [16,]  39.797919 -0.7770962373 0.99839965   18

 I first thought the distance unit was kilometers but the dist.class are only
 going until 40 and my data are taken from all around the Mediterranean sea
 (about 3700km long) so it cannot be right.

 In the correlog help it is said that Distances are in the same unit as the
 spatial coordinates but I don't get what that means. I gave spatial
 coordinates in decimal degree.

 It must be very simple but I was not able to find the answer anywhere.

 Thanks for your help,
 Cheers,

 Alicia



 --
 View this message in context: 
 http://r.789695.n4.nabble.com/correlog-function-in-pgirmess-package-tp4684706.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Removing cell borders from svg or eps in levelplot

2014-02-05 Thread Pascal Oettli
Hello,

Please try including panel=panel.levelplot.raster as an option of levelplot:

 svg(SVG.svg)
 levelplot(prt, main=SVG, xlab=NULL, ylab=NULL, 
 col.regions=rgb.palette(800), cuts=100, at=seq(0,1.0,0.01), 
 panel=panel.levelplot.raster)
 dev.off()

It may help you.

Regards,
Pascal

On 6 February 2014 01:02, Soumyadeep Nandi s.na...@molbiol.umu.se wrote:
 Hi,

 I am using function svg to save a lattice::levelplot, and ending up in some 
 kind of line or border around each cells of the plot. However, if I save the 
 plot in png, I dont get the border. But I need the plot to be saved in svg or 
 pdf. In both svg and pdf I get the same result.

 I am saving in the following way:

 library(lattice)
 rgb.palette - colorRampPalette(c(black, yellow, red), space = rgb)

 svg(SVG.svg)
 levelplot(prt, main=SVG, xlab=NULL, ylab=NULL, 
 col.regions=rgb.palette(800), cuts=100, at=seq(0,1.0,0.01) )
 dev.off()

 png(PNG.png)
 levelplot(prt, main=PNG, xlab=NULL, ylab=NULL, 
 col.regions=rgb.palette(800), cuts=100, at=seq(0,1.0,0.01) )
 dev.off()

 Is there a way to get rid of these lines from the plot in svg. I went through 
 the thread Remove gray grid from levelplot 
 [https://stat.ethz.ch/pipermail/r-help/2006-March/100683.html], but that 
 didnt help me much.
 I am attaching a screenshot to show the difference.

 Please advice me if I am wrong some where, or if there is a way to get rid of 
 these borders.

 Thanks.
 __
 R-help@r-project.org mailing list
 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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] replacing zeros with above/below numbers ?

2014-02-05 Thread Pascal Oettli
Hello,

If you mean replacing 0 by the average of non-zero values, I guess one way is:

 a[a==0] - mean(a[a!=0])

Maybe some senior user might correct it.

Regards,
Pascal



On 6 February 2014 12:05, ce zadi...@excite.com wrote:

 Dear all,

  My data is :

 a - 
 c(0.9721,0.9722,0.9730,0.9723,0.0,0.0,0.0,0.9706,0.9698,0.0,0.9710,0.9699)

 I want to replace zeros with  average of before and after values of them.  
 But sometimes there is one zero sometimes more than one. What is the most 
 elegant way to do this ?
 Thanks a lot

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Trying to install package for LMER, getting a ton of errors

2014-02-03 Thread Pascal Oettli
Hello,

I am wondering why you are trying to install from source on your
Windows machine. Is there any reason for you to not use Windows
binaries?

Regards,
Pascal



On 4 February 2014 15:12, David Kremelberg david.kremelb...@gmail.com wrote:
 Hi all, trying to run a linear mixed-effects model in R. Getting a ton of
 errors when trying to install the lme4 package (see below). I thought it
 was because my version of R was old, I just updated it, same exact problem,
 plus tried the install on the 32 and 64 bit versions. Any help appreciated.



 install.packages(type=source)
 --- Please select a CRAN mirror for use in this session ---
 also installing the dependencies 'Matrix', 'minqa', 'Rcpp', 'RcppEigen'

 trying URL 'http://cran.at.r-project.org/src/contrib/Matrix_1.1-2.tar.gz'
 Content type 'application/x-gzip' length 1635852 bytes (1.6 Mb)
 opened URL
 downloaded 1.6 Mb

 trying URL 'http://cran.at.r-project.org/src/contrib/minqa_1.2.2.tar.gz'
 Content type 'application/x-gzip' length 53162 bytes (51 Kb)
 opened URL
 downloaded 51 Kb

 trying URL 'http://cran.at.r-project.org/src/contrib/Rcpp_0.11.0.tar.gz'
 Content type 'application/x-gzip' length 1998844 bytes (1.9 Mb)
 opened URL
 downloaded 1.9 Mb

 trying URL '
 http://cran.at.r-project.org/src/contrib/RcppEigen_0.3.2.0.2.tar.gz'
 Content type 'application/x-gzip' length 1251504 bytes (1.2 Mb)
 opened URL
 downloaded 1.2 Mb

 trying URL 'http://cran.at.r-project.org/src/contrib/lme4_1.0-6.tar.gz'
 Content type 'application/x-gzip' length 2706277 bytes (2.6 Mb)
 opened URL
 downloaded 2.6 Mb

 * installing *source* package 'Matrix' ...
 ** package 'Matrix' successfully unpacked and MD5 sums checked
 ** libs

 *** arch - i386
 ERROR: compilation failed for package 'Matrix'
 * removing 'C:/Program Files/R/R-3.0.2/library/Matrix'
 * restoring previous 'C:/Program Files/R/R-3.0.2/library/Matrix'
 * installing *source* package 'Rcpp' ...
 ** package 'Rcpp' successfully unpacked and MD5 sums checked
 ** libs

 *** arch - i386
 ERROR: compilation failed for package 'Rcpp'
 * removing 'C:/Program Files/R/R-3.0.2/library/Rcpp'
 * restoring previous 'C:/Program Files/R/R-3.0.2/library/Rcpp'
 * installing *source* package 'minqa' ...
 ** package 'minqa' successfully unpacked and MD5 sums checked
 ** libs

 *** arch - i386
 ERROR: compilation failed for package 'minqa'
 * removing 'C:/Program Files/R/R-3.0.2/library/minqa'
 * installing *source* package 'RcppEigen' ...
 ** package 'RcppEigen' successfully unpacked and MD5 sums checked
 ** libs

 *** arch - i386
 ERROR: compilation failed for package 'RcppEigen'
 * removing 'C:/Program Files/R/R-3.0.2/library/RcppEigen'
 ERROR: dependencies 'minqa', 'RcppEigen' are not available for package
 'lme4'
 * removing 'C:/Program Files/R/R-3.0.2/library/lme4'

 The downloaded source packages are in
 'C:\Users\Master\AppData\Local\Temp\RtmpyChM99\downloaded_packages'
 Warning messages:
 1: running command 'C:/PROGRA~1/R/R-30~1.2/bin/i386/R CMD INSTALL -l
 C:\Program Files\R\R-3.0.2\library
 C:\Users\Master\AppData\Local\Temp\RtmpyChM99/downloaded_packages/Matrix_1.1-2.tar.gz'
 had status 1
 2: In install.packages(type = source) :
   installation of package 'Matrix' had non-zero exit status
 3: running command 'C:/PROGRA~1/R/R-30~1.2/bin/i386/R CMD INSTALL -l
 C:\Program Files\R\R-3.0.2\library
 C:\Users\Master\AppData\Local\Temp\RtmpyChM99/downloaded_packages/Rcpp_0.11.0.tar.gz'
 had status 1
 4: In install.packages(type = source) :
   installation of package 'Rcpp' had non-zero exit status
 5: running command 'C:/PROGRA~1/R/R-30~1.2/bin/i386/R CMD INSTALL -l
 C:\Program Files\R\R-3.0.2\library
 C:\Users\Master\AppData\Local\Temp\RtmpyChM99/downloaded_packages/minqa_1.2.2.tar.gz'
 had status 1
 6: In install.packages(type = source) :
   installation of package 'minqa' had non-zero exit status
 7: running command 'C:/PROGRA~1/R/R-30~1.2/bin/i386/R CMD INSTALL -l
 C:\Program Files\R\R-3.0.2\library
 C:\Users\Master\AppData\Local\Temp\RtmpyChM99/downloaded_packages/RcppEigen_0.3.2.0.2.tar.gz'
 had status 1
 8: In install.packages(type = source) :
   installation of package 'RcppEigen' had non-zero exit status
 9: running command 'C:/PROGRA~1/R/R-30~1.2/bin/i386/R CMD INSTALL -l
 C:\Program Files\R\R-3.0.2\library
 C:\Users\Master\AppData\Local\Temp\RtmpyChM99/downloaded_packages/lme4_1.0-6.tar.gz'
 had status 1
 10: In install.packages(type = source) :
   installation of package 'lme4' had non-zero exit status

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] clusterCrit package produces Nan

2014-01-29 Thread Pascal Oettli
Hello,

Your example is difficult to reproduce.

Please
1. use dput() to attach data
2. indicate the package(s) you used. There are at least 3 packages
with a som function. It seems you used RSNNS.

And when I run your code, there is no unit.classif in datissimi

 datissimi$unit.classif
NULL

Regards,
Pascal


On 30 January 2014 01:39, Paola Tellaroli paola.tellar...@gmail.com wrote:
 I'm trying to compute the Silhouette value of a clustering partition done 
 with SOM method using the function intCriteria of the clusterCrit package but 
 it returns me a Nan value: somebody knows why?

 To simplify my case, here there is an example:

  test
   [,1] [,2] [,3] [,4] [,5] [,6]
  [1,] 37.28577 8.902218 17.93830 38.80381 6.825286 18.44061
  [2,] 37.25598 8.693962 18.09256 38.81784 7.005092 18.17899
  [3,] 37.54612 8.262074 18.07639 38.87837 6.592799 18.31604
  [4,] 37.56661 8.651182 17.98653 38.76980 6.596529 18.46937
  [5,] 37.59454 8.546921 17.93558 39.00177 6.508707 18.40102
  [6,] 37.62195 8.422909 18.03132 38.86634 7.024104 18.30201
  [7,] 37.19365 8.662608 18.01295 38.37456 7.173594 18.24273
  [8,] 37.63161 8.495688 18.05909 38.92736 6.884675 18.44871
  [9,] 37.30077 8.488438 18.02636 38.60844 7.004214 18.45600
 [10,] 37.52518 8.610817 18.00498 38.57547 6.877532 18.36552

  datissimi = som(test, grid=somgrid(xdim=2, ydim=4,
  topo='rectangular'), rlen=500, 
 keep.data=T)

 somissimo = datissimi$unit.classif

 intCriteria(test, somissimo, Silhouette)
 $silhouette
 [1] NaN

 Thanks,

 Paola
 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] clusterCrit package produces Nan

2014-01-29 Thread Pascal Oettli
Hello,

Please also reply to the list.

I am not really familiar with this calculation, but it is maybe due to
the fact you defined 8 nodes for your SOM, but your original data are
only classified within 3 nodes.

 datissimi = som(test, grid=somgrid(xdim=2, ydim=4, topo='rectangular'), 
 rlen=500, keep.data=TRUE)
 somissimo = datissimi$unit.classif
 unique(somissimo)
[1] 2 4 8

 intCriteria(test, somissimo, silhouette)
$silhouette
[1] NaN

If I modify the shape of the Kohonen map:

 datissimi = som(test, grid=somgrid(xdim=3, ydim=1, topo='rectangular'), 
 rlen=500, keep.data=TRUE)
 somissimo = datissimi$unit.classif
 unique(somissimo)
[1] 1 2 3

 intCriteria(test, somissimo, silhouette)
$silhouette
[1] 0.6478154

Hope this helps,
Pascal


On 30 January 2014 10:58, Paola Tellaroli paola.tellar...@gmail.com wrote:
 Hello Pascal,

 you're right, sorry.

 The package I used for the som function is kohonen, while data are:

 dput(test)
 structure(c(37.28577, 8.902218, 17.9383, 38.80381, 6.825286,
 18.44061, 37.25598, 8.693962, 18.09256, 38.81784, 7.005092, 18.17899,
 37.54612, 8.262074, 18.07639, 38.87837, 6.592799, 18.31604, 37.56661,
 8.651182, 17.98653, 38.7698, 6.596529, 18.46937, 37.59454, 8.546921,
 17.93558, 39.00177, 6.508707, 18.40102, 37.62195, 8.422909, 18.03132,
 38.86634, 7.024104, 18.30201, 37.19365, 8.662608, 18.01295, 38.37456,
 7.173594, 18.24273, 37.63161, 8.495688, 18.05909, 38.92736, 6.884675,
 18.44871, 37.30077, 8.488438, 18.02636, 38.60844, 7.004214, 18.456,
 37.52518, 8.610817, 18.00498, 38.57547, 6.877532, 18.36552), .Dim = c(10L,
 6L))

 Thank you,

 Paola


 On 29/gen/2014, at 20:25, Pascal Oettli wrote:





 --
 Pascal Oettli
 Project Scientist
 JAMSTEC
 Yokohama, Japan




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Error in loading package

2013-12-28 Thread Pascal Oettli
Hello,

My suggestion: read the error message.

Regards,
Pascal

On 29 December 2013 00:15, agrima srivastava
agrimasrivasta...@gmail.com wrote:
 Hi
 I am trying to install a packaage qgraph
 I am using
 install.packages(qgraph, dependencies=TRUE) for the same.
 After that when I type library('qgraph') I am getting this error

 Error in loadNamespace(i[[1L]], c(lib.loc, .libPaths())) :
 there is no package called 'ReadImages'
 Error: package/namespace load failed for 'qgraph'

 Please suggest a way to resolve this issue.

 Thanks in advance.

 --
 Thanks and Regards
 Agrima Srivastava
 ---
 Research Scholar
 Computer Science  Information Systems Department
 BITS Pilani Hyderabad Campus

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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] Significance of spectral peaks

2013-12-23 Thread Pascal Oettli
Hello,

See ?redfit from dplR, for example.

HTH,
Pascal

On 23 December 2013 18:46, nuncio m nunci...@gmail.com wrote:
 Dear useRs,

 I have a time series of length approcimately 55. Is it possible to find the
 significance of fft spectral peaks with R?

 thank you

 --
 Nuncio.M
 Scientist
 National Center for Antarctic and Ocean research
 Head land Sada
 Vasco da Gamma
 Goa-403804
 ph off 91 832 2525636
 ph: cell 91 9890357423

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 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.



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@r-project.org mailing list
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.


  1   2   3   4   5   >