Re: [R] unexpected behaviour of an extended time series (using packages spuRs and xts)

2016-01-25 Thread Olivier ETERRADOSSI
Thank you Joshua for your valuable help,
It just works fine now !
Regards, O.

Olivier ETERRADOSSI
Maître-Assistant HDR
Ingénierie de l’aspect visuel et tactile
C2MA – Pôle R.I.M.E. (site de Pau)
Ecole des mines d’Alès
Technopole Hélioparc
2 av. P. Angot
64053 PAU Cedex 9
France


-Message d'origine-
De : Joshua Ulrich [mailto:josh.m.ulr...@gmail.com]
Envoyé : vendredi 22 janvier 2016 18:23
À : Olivier ETERRADOSSI
Cc : R-Help
Objet : Re: [R] unexpected behaviour of an extended time series (using 
packages spuRs and xts)

Try using the latest xts on GitHub:
https://github.com/joshuaulrich/xts

On Thu, Jan 14, 2016 at 9:05 AM, Olivier ETERRADOSSI 
<olivier.eterrado...@mines-ales.fr> wrote:
> Hi list,
>
>
>
> I thought I knew how to use extended time series (package xts), but I
> was wrong  J  …
>
>
>
> While preparing a toy example for something else, using data provided
> in R, I run into an unexpected problem and can’t figure by myself what
> is happening below, can anyone of you tell ? I searched the archives
> but didn’t locate any answer. Probably it’s trivial, so please forgive  :
>
>
>
> I’m using :
>
> R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" / Platform:
> x86_64-w64-mingw32/x64 (64-bit)
>
> Packages are updated weekly, sometimes daily.
>
>
>
> I take some data from package spuRs :
>
>> library(spuRs)
>
>> data(kew)
>
>
>
> I turn the dataframe into time series (by combining each kew[,2:13]
> one after each other into a vector, and turning the vector into time 
> series).
>
>
>
> One is ts :
>
>
>
>>
> kew.ts<-ts(data=stock,start=kew$year[1],end=kew$year[length(kew$year)]
> ,fre
> quency=12)
>
>
>
> And the other is xts, it looks fine at first :
>
>
>
>> kew.xts<-as.xts(kew.ts)
>
>> periodicity(kew.xts)
>
> Monthly periodicity from janv. 1697 to janv. 1999  # OK
>
>> hist(kew.xts) # OK
>
>> summary(kew.xts)
>
>  Index kew.xts
>
>  Min.   :1697   Min.   :  0.00
>
>  1st Qu.:1772   1st Qu.: 29.70
>
>  Median :1848   Median : 47.00
>
>  Mean   :1848   Mean   : 51.14
>
>  3rd Qu.:1924   3rd Qu.: 67.60
>
>  Max.   :1999   Max.   :189.00  # OK
>
>
>
>> gdata::is.what(kew.xts)
>
> [1] "is.array""is.atomic"   "is.double"
> "is.index.unique"
>
> [5] "is.matrix"   "is.numeric"  "is.object"   "is.regular"
>
>
>  [9] "is.time.unique"  "is.unsorted" "is.xts"  "is.zoo"
> # seems OK
>
>
>
>
>
> # But now, first try :
>
>> plot(kew.xts)
>
> Error in if (on == "years") { :
>
>   valeur manquante là où TRUE / FALSE est requis # french for «
> missing value where TRUE/FALSE is required »
>
>
>
> # h, let’s try something else :
>
>> plot(kew.xts['1697-01/1979/']) # OK
>
>
>
>> plot(kew.xts['1697-01/1980/'])
>
> Error in if (on == "years") { :
>
>   valeur manquante là où TRUE / FALSE est requis
>
>
>
>> plot(kew.xts['1697-01/1979-12/']) # OK
>
>
>
>> plot(kew.xts['1697-01/1980-01/'])
>
> Error in if (on == "years") { :
>
>   valeur manquante là où TRUE / FALSE est requis
>
>
>
> # but…!  :
>
>
>
>> plot(kew.xts['1979-01/1980/']) # OK !
>
>
>
> And so are :
>
>> plot (kew.xts['1978/1980/'])
>
>> plot(kew.xts['1977/1982/'])
>
>> plot(kew.xts['1977-01/1982-12'])  # and so on…
>
>
>
> I’m puzzled ! I have probably missed a trivial point… Can someone tell ?
>
>
>
> Thanks a lot list, regards, Olivier
>
>
>
> --
>
> Olivier ETERRADOSSI
>
> Maître-Assistant, HDR
>
> Ecole des Mines d’Alès (C2MA, site de Pau)
>
> Ingénierie de l'aspect visuel et tactile des matériaux
>
> Pôle « Recherche sur les Interactions des Matériaux avec leur
> Environnement » (RIME)
>
> Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
>
> Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)
>
> Fax : 05 59 30 63 68
>
>  <http://www.mines-ales.fr/> http://www.mines-ales.fr
>
>  <http://www.mines-telecom.fr/> http://www.mines-telecom.fr
>
>
>
>
>
>
>
>
> [[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.



--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2016 | www.rinfinance.com

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

[R] unexpected behaviour of an extended time series (using packages spuRs and xts)

2016-01-14 Thread Olivier ETERRADOSSI
Hi list,



I thought I knew how to use extended time series (package xts), but I was
wrong  J  �



While preparing a toy example for something else, using data provided in
R, I run into an unexpected problem and can�t figure by myself what is
happening below, can anyone of you tell ? I searched the archives but
didn�t locate any answer. Probably it�s trivial, so please forgive  :



I�m using :

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" / Platform:
x86_64-w64-mingw32/x64 (64-bit)

Packages are updated weekly, sometimes daily.



I take some data from package spuRs :

> library(spuRs)

> data(kew)



I turn the dataframe into time series (by combining each kew[,2:13] one
after each other into a vector, and turning the vector into time series).



One is ts :



>
kew.ts<-ts(data=stock,start=kew$year[1],end=kew$year[length(kew$year)],fre
quency=12)



And the other is xts, it looks fine at first :



> kew.xts<-as.xts(kew.ts)

> periodicity(kew.xts)

Monthly periodicity from janv. 1697 to janv. 1999  # OK

> hist(kew.xts) # OK

> summary(kew.xts)

 Index kew.xts

 Min.   :1697   Min.   :  0.00

 1st Qu.:1772   1st Qu.: 29.70

 Median :1848   Median : 47.00

 Mean   :1848   Mean   : 51.14

 3rd Qu.:1924   3rd Qu.: 67.60

 Max.   :1999   Max.   :189.00  # OK



> gdata::is.what(kew.xts)

[1] "is.array""is.atomic"   "is.double"
"is.index.unique"

[5] "is.matrix"   "is.numeric"  "is.object"   "is.regular"


 [9] "is.time.unique"  "is.unsorted" "is.xts"  "is.zoo"
# seems OK





# But now, first try :

> plot(kew.xts)

Error in if (on == "years") { :

  valeur manquante l� o� TRUE / FALSE est requis # french for �
missing value where TRUE/FALSE is required �



# h, let�s try something else :

> plot(kew.xts['1697-01/1979/']) # OK



> plot(kew.xts['1697-01/1980/'])

Error in if (on == "years") { :

  valeur manquante l� o� TRUE / FALSE est requis



> plot(kew.xts['1697-01/1979-12/']) # OK



> plot(kew.xts['1697-01/1980-01/'])

Error in if (on == "years") { :

  valeur manquante l� o� TRUE / FALSE est requis



# but�!  :



> plot(kew.xts['1979-01/1980/']) # OK !



And so are :

> plot (kew.xts['1978/1980/'])

> plot(kew.xts['1977/1982/'])

> plot(kew.xts['1977-01/1982-12'])  # and so on�



I�m puzzled ! I have probably missed a trivial point� Can someone tell ?



Thanks a lot list, regards, Olivier



--

Olivier ETERRADOSSI

Ma�tre-Assistant, HDR

Ecole des Mines d�Al�s (C2MA, site de Pau)

Ing�nierie de l'aspect visuel et tactile des mat�riaux

P�le � Recherche sur les Interactions des Mat�riaux avec leur
Environnement � (RIME)

H�lioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9

Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)

Fax : 05 59 30 63 68

 <http://www.mines-ales.fr/> http://www.mines-ales.fr

 <http://www.mines-telecom.fr/> http://www.mines-telecom.fr








[[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] behaviour of rows and colomns suppression in a matrix

2014-03-13 Thread Olivier ETERRADOSSI
Hi  List,
while running a script on a set of matrices I came into a case I would not
have guessed to arrive.
Below is  a small toy example to illustrate the case.
Of course there is a simple workaround (using a simple test), but why does
this occur, and shouldn’t it be corrected ?

More probably I miss a point, but which one ? Is this behavior obtained on
purpose and why ?
Sorry if it’s a FAQ… I didn’t find my way to it.
(And sorry for multiple posting if any : I got a warning from r-bounce but
did not understand it).
Thanks, Olivier


#
# toy example 1 (no problem with this one)

toy.matrix.1-matrix(c(1,0,1,1,0,1,0,0,0),3,3)
# getting the marginal sums
margin.Rows- apply(toy.matrix.1,MARGIN=1,FUN=sum)
margin.Cols- apply(toy.matrix.1,MARGIN=2,FUN=sum)
#giving a threshold for lines and columns suppression
thresh-0
# finding the items to remove
unused.rows-which(margin.Rows=thresh)    # unused.rows == 2
unused.cols-which(margin.Cols=thresh)    # unused.cols == 3
TM1-toy.matrix.1
TM1-TM1[-unused.rows,]
TM1-TM1[,-unused.cols]
TM1
# [,1] [,2]
#[1,]    1    1
#[2,]    1    1         # OK
##

# toy example 2 (oops, no rows to suppress…)

toy.matrix.2-matrix(c(1,1,1,1,1,1,0,0,0),3,3)
# getting the marginal sums
margin.Rows- apply(toy.matrix.2,MARGIN=1,FUN=sum)
margin.Cols- apply(toy.matrix.2,MARGIN=2,FUN=sum)
#giving a threshold for lines and columns suppression
thresh-0
unused.rows-which(margin.Rows=thresh) # unused.rows ==
integer(0)
unused.cols-which(margin.Cols=thresh)  # unused.cols == 3
TM2-toy.matrix.2
TM2-TM2[-unused.rows,]
TM2-TM2[,-unused.cols]
TM2
#  [,1] [,2]    # empty...
###
# I was expecting :
# [,1] [,2]
#[1,]    1    1
#[2,]    1    1
#[3,]    1    1

# which of course is obtained using :
TM2-toy.matrix.2
if(length(unused.rows) !=0) {TM2-TM2[-unused.rows,]}
if(length(unused.rows) !=0 ){TM2-TM2[,-unused.cols]}
TM2

__
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] behaviour of rows and colomns suppression in a matrix

2014-03-13 Thread Olivier ETERRADOSSI
Thank you Sarah,

But no, I was not expecting this. For me integer(0) is not 0.
That's why I finally tested length(unused.rows), which is 0 when
unused.rows is integer(0).

Olivier


-Message d'origine-
De : Sarah Goslee [mailto:sarah.gos...@gmail.com]
Envoyé : jeudi 13 mars 2014 16:12
À : Olivier ETERRADOSSI
Cc : r-help
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix

Hi,

Your basic problem seems to be that you expect R to take

TM2[0, ]

as meaning not to subset anything, rather than to take only row 0, which
doesn't exist:

R TM2[0,]
 [,1] [,2] [,3]

There's a hint in

?[

which says:

  An index value of 'NULL' is treated as if it were
  'integer(0)'.


Here are two alternative formulations of your task:
# safer method 1

used.rows-which(margin.Rows  thresh)
used.cols-which(margin.Cols  thresh)
TM2[used.rows, used.cols]

# safer method 2

unused.rows- margin.Rows=thresh
unused.cols- margin.Cols=thresh
TM2[!unused.rows, !unused.cols]

Sarah

On Thu, Mar 13, 2014 at 10:02 AM, Olivier ETERRADOSSI
olivier.eterrado...@mines-ales.fr wrote:
 Hi  List,
 while running a script on a set of matrices I came into a case I would
 not have guessed to arrive.
 Below is  a small toy example to illustrate the case.
 Of course there is a simple workaround (using a simple test), but why
 does this occur, and shouldn't it be corrected ?

 More probably I miss a point, but which one ? Is this behavior
 obtained on purpose and why ?
 Sorry if it's a FAQ... I didn't find my way to it.
 (And sorry for multiple posting if any : I got a warning from r-bounce
 but did not understand it).
 Thanks, Olivier


 #
 # toy example 1 (no problem with this one)

 toy.matrix.1-matrix(c(1,0,1,1,0,1,0,0,0),3,3)
 # getting the marginal sums
 margin.Rows- apply(toy.matrix.1,MARGIN=1,FUN=sum)
 margin.Cols- apply(toy.matrix.1,MARGIN=2,FUN=sum)
 #giving a threshold for lines and columns suppression
 thresh-0
 # finding the items to remove
 unused.rows-which(margin.Rows=thresh)# unused.rows == 2
 unused.cols-which(margin.Cols=thresh)# unused.cols == 3
 TM1-toy.matrix.1
 TM1-TM1[-unused.rows,]
 TM1-TM1[,-unused.cols]
 TM1
 # [,1] [,2]
 #[1,]11
 #[2,]11 # OK
 ##

 # toy example 2 (oops, no rows to suppress...)

 toy.matrix.2-matrix(c(1,1,1,1,1,1,0,0,0),3,3)
 # getting the marginal sums
 margin.Rows- apply(toy.matrix.2,MARGIN=1,FUN=sum)
 margin.Cols- apply(toy.matrix.2,MARGIN=2,FUN=sum)
 #giving a threshold for lines and columns suppression
 thresh-0
 unused.rows-which(margin.Rows=thresh) # unused.rows ==
 integer(0)
 unused.cols-which(margin.Cols=thresh)  # unused.cols == 3
 TM2-toy.matrix.2
 TM2-TM2[-unused.rows,]
 TM2-TM2[,-unused.cols]
 TM2
 #  [,1] [,2]# empty...
 ###
 # I was expecting :
 # [,1] [,2]
 #[1,]11
 #[2,]11
 #[3,]11

 # which of course is obtained using :
 TM2-toy.matrix.2
 if(length(unused.rows) !=0) {TM2-TM2[-unused.rows,]}
 if(length(unused.rows) !=0 ){TM2-TM2[,-unused.cols]}
 TM2

--
Sarah Goslee
http://www.functionaldiversity.org

__
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] behaviour of rows and colomns suppression in a matrix

2014-03-13 Thread Olivier ETERRADOSSI
Thank you, Arun and Sarah

I was not trying to take row 0 that does not exist, rather  trying not to 
take (I wrote TM[- unused.rows,]) something that does not exist.

So what I understand from Arun's answer is that I was badly using MINUS with 
a vector instead of NOT with a logical.

Olivier

-Message d'origine-
De : arun [mailto:smartpink...@yahoo.com]
Envoyé : jeudi 13 mars 2014 16:13
À : r-help@r-project.org
Cc : Olivier ETERRADOSSI
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix

Hi,
You could use:
 TM2[!margin.Rows =thresh,!margin.Cols =thresh] # [,1] [,2] #[1,]1 
1 #[2,]11 #[3,]11


#For the first case:
TM1[!margin.Rows =thresh,!margin.Cols =thresh] # [,1] [,2] #[1,]1 
1 #[2,]11



A.K.





On Thursday, March 13, 2014 10:02 AM, Olivier ETERRADOSSI 
olivier.eterrado...@mines-ales.fr wrote:
Hi  List,
while running a script on a set of matrices I came into a case I would not 
have guessed to arrive.
Below is  a small toy example to illustrate the case.
Of course there is a simple workaround (using a simple test), but why does 
this occur, and shouldn’t it be corrected ?

More probably I miss a point, but which one ? Is this behavior obtained on 
purpose and why ?
Sorry if it’s a FAQ… I didn’t find my way to it.
(And sorry for multiple posting if any : I got a warning from r-bounce but 
did not understand it).
Thanks, Olivier


#
# toy example 1 (no problem with this one)

toy.matrix.1-matrix(c(1,0,1,1,0,1,0,0,0),3,3)
# getting the marginal sums
margin.Rows- apply(toy.matrix.1,MARGIN=1,FUN=sum)
margin.Cols- apply(toy.matrix.1,MARGIN=2,FUN=sum)
#giving a threshold for lines and columns suppression
thresh-0
# finding the items to remove
unused.rows-which(margin.Rows=thresh)# unused.rows == 2
unused.cols-which(margin.Cols=thresh)# unused.cols == 3
TM1-toy.matrix.1
TM1-TM1[-unused.rows,]
TM1-TM1[,-unused.cols]
TM1
# [,1] [,2]
#[1,]11
#[2,]11 # OK 
##

# toy example 2 (oops, no rows to suppress…)

toy.matrix.2-matrix(c(1,1,1,1,1,1,0,0,0),3,3)
# getting the marginal sums
margin.Rows- apply(toy.matrix.2,MARGIN=1,FUN=sum)
margin.Cols- apply(toy.matrix.2,MARGIN=2,FUN=sum)
#giving a threshold for lines and columns suppression
thresh-0
unused.rows-which(margin.Rows=thresh) # unused.rows ==
integer(0)
unused.cols-which(margin.Cols=thresh)  # unused.cols == 3
TM2-toy.matrix.2
TM2-TM2[-unused.rows,]
TM2-TM2[,-unused.cols]
TM2
#  [,1] [,2]# empty...
###
# I was expecting :
# [,1] [,2]
#[1,]11
#[2,]11
#[3,]11

# which of course is obtained using :
TM2-toy.matrix.2
if(length(unused.rows) !=0) {TM2-TM2[-unused.rows,]}
if(length(unused.rows) !=0 ){TM2-TM2[,-unused.cols]}
TM2

__
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-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] behaviour of rows and colomns suppression in a matrix

2014-03-13 Thread Olivier ETERRADOSSI
Yes, that's usually what I'm doing...
Here I didn't guess that the answer was in [ !
I already noticed that it's sometimes easier to locate something very
technical or statistically smart than obvious things (because we think we
know, or think we have already read 10 times the basics...)  ;-)
O.

-Message d'origine-
De : Sarah Goslee [mailto:sarah.gos...@gmail.com]
Envoyé : jeudi 13 mars 2014 16:59
À : Olivier ETERRADOSSI
Cc : r-help
Objet : Re: [R] behaviour of rows and colomns suppression in a matrix

On Thu, Mar 13, 2014 at 11:51 AM, Olivier ETERRADOSSI
olivier.eterrado...@mines-ales.fr wrote:
 Thank you Sarah,

 But no, I was not expecting this. For me integer(0) is not 0.
 That's why I finally tested length(unused.rows), which is 0 when
 unused.rows is integer(0).

Also from

?[

i, j, ...: indices specifying elements to extract or replace.  Indices
  are 'numeric' or 'character' vectors or empty (missing) or
  'NULL'.  Numeric values are coerced to integer as by
  'as.integer' (and hence truncated towards zero).  Character
  vectors will be matched to the 'names' of the object (or for
  matrices/arrays, the 'dimnames'): see 'Character indices'
  below for further details.

So yes, in this case 0 is treated as integer(0).

When you have problems that seem odd to you, carefully reading the
relevant help is always a good place to start.

Sarah

__
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] problem with ecdf : missing C_R_approxfun message

2013-10-24 Thread Olivier Eterradossi
Hi list,

In June 2013, using R.2.15.1 (i386) on Windows 7, I calculated a set of ecdf 
which I stored in lists of records having a size.ecdf field, with following 
structure :

[skip previous structure...]
$ size.ecdf   :function (v)
  ..- attr(*, class)= chr [1:3] ecdf stepfun function
  ..- attr(*, call)=length 2 ecdf(test.moms[, m.pxs])
  .. ..- attr(*, srcref)=Class 'srcref'  atomic [1:8] 12 1 12 36 1 36 12 12
  .. .. .. ..- attr(*, srcfile)=Classes 'srcfilecopy', 'srcfile' 
environment: 0x07d7b3b0
[skip following structure...]

In September I upgraded to R.3.0.1 under the same OS

I need to use my previously recorded ecdfs again, and try to plot one  as in :

 plot(first.list[[1]]$size.ecdf,col=couleurs[1],main=first ecdf)
Which returns :
Erreur dans x(0.5 * (ti.l + ti.r)) : objet 'C_R_approxfun' introuvable
Sorry it's in French  ;-)  , it translates to error in x(0.5 * (ti.l + ti.r)) 
: missing object 'C_R_approxfun' 

The same message prints when trying to use other ecdf methods, or other records 
in my lists.

I first searched the help and archives without success, here are four questions 
I cannot answer :

What is this C_R_approxfun object and what is it intended to do ?
What may have caused it is missing now (and was not in June) ?
Does this mean that I should have recorded other useful parameters in June 
(such as environment parameters) ?
Or anything else I cannot guess ?

Thanks for helping, I'm stuck and I would prefer not to calculate all my old 
ecdfs again !

Regards, Olivier

--
Olivier ETERRADOSSI
Maître-Assistant, HDR
Ecole des Mines d'Alès (C2MA, site de Pau)
Ingénierie de l'aspect visuel et tactile des matériaux
Pôle « Recherche sur les Interactions des Matériaux avec leur Environnement » 
(RIME)
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)
Fax : 05 59 30 63 68
http://www.mines-ales.frhttp://www.mines-ales.fr/
http://www.mines-telecom.frhttp://www.mines-telecom.fr/










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


[R] TR: problem with ecdf : missing C_R_approxfun message

2013-10-24 Thread Olivier Eterradossi
Hi again, this is a follow-up of my previous post :

I've noticed that
 attr(first.list[[1]]$size.ecdf,call)  gives ecdf(test.moms[, m.pxs]) and 
 that there is no test.moms field in my records (a local variable named 
 test.moms was used inside a function, but it was stored under another name in 
 the list, outside the function)

May this be the answer (and I've been stupid not to see this before !) ?

Anyway, trying to change test.moms to the real name of the corresponding 
record field, i.e. :
 attr(first.list[[1]]$size.ecdf,call)-ecdf(first.list[[1]]$true.varname[,m.pxs])

Does not fix the problem.

Is changing the call attribute the thing to do, but done in a wrong way ?
If yes, what is the good way ?
If not, what can be done ?

Thanks again, Olivier


De : Olivier Eterradossi
Envoyé : jeudi 24 octobre 2013 08:54
À : 'r-help@r-project.org'
Objet : problem with ecdf : missing C_R_approxfun message

Hi list,

In June 2013, using R.2.15.1 (i386) on Windows 7, I calculated a set of ecdf 
which I stored in lists of records having a size.ecdf field, with following 
structure :

[skip previous structure...]
$ size.ecdf   :function (v)
  ..- attr(*, class)= chr [1:3] ecdf stepfun function
  ..- attr(*, call)=length 2 ecdf(test.moms[, m.pxs])
  .. ..- attr(*, srcref)=Class 'srcref'  atomic [1:8] 12 1 12 36 1 36 12 12
  .. .. .. ..- attr(*, srcfile)=Classes 'srcfilecopy', 'srcfile' 
environment: 0x07d7b3b0
[skip following structure...]

In September I upgraded to R.3.0.1 under the same OS

I need to use my previously recorded ecdfs again, and try to plot one  as in :

 plot(first.list[[1]]$size.ecdf,col=couleurs[1],main=first ecdf)
Which returns :
Erreur dans x(0.5 * (ti.l + ti.r)) : objet 'C_R_approxfun' introuvable
Sorry it's in French  ;-)  , it translates to error in x(0.5 * (ti.l + ti.r)) 
: missing object 'C_R_approxfun' 

The same message prints when trying to use other ecdf methods, or other records 
in my lists.

I first searched the help and archives without success, here are four questions 
I cannot answer :

What is this C_R_approxfun object and what is it intended to do ?
What may have caused it is missing now (and was not in June) ?
Does this mean that I should have recorded other useful parameters in June 
(such as environment parameters) ?
Or anything else I cannot guess ?

Thanks for helping, I'm stuck and I would prefer not to calculate all my old 
ecdfs again !

Regards, Olivier

--
Olivier ETERRADOSSI
Maître-Assistant, HDR
Ecole des Mines d'Alès (C2MA, site de Pau)
Ingénierie de l'aspect visuel et tactile des matériaux
Pôle « Recherche sur les Interactions des Matériaux avec leur Environnement » 
(RIME)
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)
Fax : 05 59 30 63 68
http://www.mines-ales.frhttp://www.mines-ales.fr/
http://www.mines-telecom.frhttp://www.mines-telecom.fr/










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


[R] behaviour of read.xls (gdata package) when worksheet usesuser-defined cells formats

2013-10-11 Thread Olivier Eterradossi
(I'm afraid this post didn't reach the list on last Wednesday, here it is again 
)

hi R-list,

And sorry for my frenglish !

I am running R  Good Sport  release ( i386-w64-mingw32/i386 (32-bit) ) ) 
under Windows 7 Professional, Service Pack 1.
My perl executable is ActivePerl build 817 [257965] (i.e. version 5.8.8.817). 
Usually it is working fine.

Using the gdata ::read.xls function I am used to, I am now facing a stupid, 
probably trivial problem I never encountered before... and can't fix it by 
myself.

I have received Excel files (saved as Excel 97-2003 files)  in which the values 
(say 11.6185410334347) are displayed in a user-defined format in the cells 
(here the format is defined as 0.00, giving a displayed value of 0.12) but 
fully and correctly displayed in the formula bar.
In these files, the cells in the 4 first lines are used for header information 
(strings).

I read any of the files using :

foo.data- 
read.xls(xls=my.path.to.xls.file,sheet=sheet.number,perl=my.perl.path,as.is=TRUE,pattern=[0123456789],head=FALSE)

The value I get in the resulting foo.data$the.variable is the displayed value 
(0.12), not the true, underlying value of 11.6185.. and it is neither a 
factor, nor a string :

 is.what(foo.data$the.variable)
[1] is.atomic   is.double   is.numeric  is.standard is.unsorted 
is.vector

 foo.data$the.variable [2]*1e10
[1] 1.2e+09

Is this normal behavior ? Is this related to how I chose the read.xls arguments 
? How should I specify the arguments to recover the full, true values 
directly from the files (without changing the format manually to standard, of 
course !) ? Or is this related to my perl executable ?

... Or do I miss a point ?

Thanks for helping, all the best , Olivier


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


Re: [R] time zones from longitude, latitude, and date

2013-09-23 Thread Olivier Eterradossi
carlisle thacker carlisle.thacker at gmail.com writes:



 

 I have data that provide longitude, latitude, and local date and time but

 no information about the corresponding time zone.  How to identify the 
time

 zone so they can be converted to a common date/time?

 

 Thanks,

 

 Carlisle

 

   [[alternative HTML version deleted]]

 

 



Hi list,



maybe I didn't read the post carefully enough, but what about using the 
GNtimezone in Barry Rowlinson's geonames package ?



Olivier

__
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] differents behaviour of packages depending on rJava under 32 and 64 bit versions of R 2.14.2

2012-04-17 Thread Olivier Eterradossi
Hi listeRs,

 

Maybe I have missed something, but I am facing a problem I don't understand
even after reading archives and manuals (…maybe not carefully enough !) :

 

On my PC (64-bit OS, Intel Xeon CPU , two L5506@2.13 GHz processors, 12 Go
RAM) under Windows 7 SP1,

 

I run both 32-bit (i386-pc-mingw32/i386) and 64-bit (x86_64-pc-mingw32/x64)
version 2.14.2 (2012-02-29) of R, packages being updated daily.

 

Loading package lsa gives no problem under the 32-bit version :

--

 library(lsa)

Le chargement a nécessité le package : Snowball

Le chargement a nécessité le package : RWeka

 

--

But does not work under the 64-bit version :

---

 library(lsa)

Le chargement a nécessité le package : Snowball

Error : .onLoad a échoué dans loadNamespace() pour 'Snowball', détails :

  appel : NULL

  erreur : .onLoad a échoué dans loadNamespace() pour 'rJava', détails :

  appel : fun(libname, pkgname)

  erreur : JAVA_HOME cannot be determined from the Registry

Erreur : le package ‘Snowball’ ne peut être chargé

 





Because of the JAVA_HOME and Registry problem I suppose this is not strictly
related to R but rather to the R - Java communication, but I can't figure
what is happening, as it is working under the 32-bit configuration. Can
someone here help ?



Thanks by advance, all the best, Olivier



--

Olivier ETERRADOSSI

Maître-Assistant, HDR

Ecole des Mines d’Alès (CMGD, site de Pau)

Pôle Matériaux Polymères Avancés (MPA)

Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9

Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)

Fax : 05 59 30 63 68




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


Re: [R] differents behaviour of packages depending on rJava under32 and 64 bit versions of R 2.14.2

2012-04-17 Thread Olivier Eterradossi
Thank you Prof.,
As always, simple things need to thing carefully  :-(
I have missed that point, and also the existence of rJava forums.
ATB, Olivier

-Message d'origine-
De : Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] 
Envoyé : mardi 17 avril 2012 15:32
À : Olivier Eterradossi
Cc : r-help@r-project.org
Objet : Re: [R] differents behaviour of packages depending on rJava under32
and 64 bit versions of R 2.14.2

On 17/04/2012 14:00, Olivier Eterradossi wrote:
 Hi listeRs,



 Maybe I have missed something, but I am facing a problem I don't 
 understand even after reading archives and manuals (…maybe not carefully
enough !) :

64-bit rJava needs 64-bit Java: 32-bit rJava needs 32-bit Java.  You can
install both on the same machine, and there are different registries
presented to 32- and 64-bit programs, so only the correct one will be seen
(if they are installed correctly).

In any case, rJava has its own help forums, so it you need further help, ask
there (and the maintainer does not read R-help routinely).




 On my PC (64-bit OS, Intel Xeon CPU , two L5506@2.13 GHz processors, 
 12 Go
 RAM) under Windows 7 SP1,



 I run both 32-bit (i386-pc-mingw32/i386) and 64-bit 
 (x86_64-pc-mingw32/x64) version 2.14.2 (2012-02-29) of R, packages being
updated daily.



 Loading package lsa gives no problem under the 32-bit version :

 --

 library(lsa)

 Le chargement a nécessité le package : Snowball

 Le chargement a nécessité le package : RWeka



 --

 But does not work under the 64-bit version :

 ---

 library(lsa)

 Le chargement a nécessité le package : Snowball

 Error : .onLoad a échoué dans loadNamespace() pour 'Snowball', détails :

appel : NULL

erreur : .onLoad a échoué dans loadNamespace() pour 'rJava', détails :

appel : fun(libname, pkgname)

erreur : JAVA_HOME cannot be determined from the Registry

 Erreur : le package ‘Snowball’ ne peut être chargé



 



 Because of the JAVA_HOME and Registry problem I suppose this is not 
 strictly related to R but rather to the R-  Java communication, but 
 I can't figure what is happening, as it is working under the 32-bit 
 configuration. Can someone here help ?



 Thanks by advance, all the best, Olivier



 --

 Olivier ETERRADOSSI

 Maître-Assistant, HDR

 Ecole des Mines d’Alès (CMGD, site de Pau)

 Pôle Matériaux Polymères Avancés (MPA)

 Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9

 Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)

 Fax : 05 59 30 63 68




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


-- 
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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] plot method for rasters and layout

2012-03-19 Thread Olivier Eterradossi
Hi list,

I thought I was used to layouts, but today I am facing a problem I cannot
overcome  :

 

On my R installation (Windows 7 Pro, SP1, R version 2.13.0, daily update of
packages), I am not able to put raster plots in user defined layouts :

 

 layout.matrix-matrix(c(1,2,3,4,5,5),2,3)

 layout(mat=layout.matrix)

 layout.show(5)

 

works fine, I get the correct frames in the correct place. But, using 5
graphs (that all plot OK if plotted alone) :

 

 plot(raster1)

 plot(raster2)

 plot(raster3)

 plot(raster4)

 plot(any.other.graph.meant.to.be.in.frame.5)

 

Plots giving the same layout  as :

 

 par(mfrow=c(2,3))

 plot(raster1)

 plot(raster2)

 plot(raster3)

 plot(raster4)

 plot(any.other.graph.supposed.to.fall.in.frame.5)

 

i.e. 3 rasterplots on the first row followed by the fourth raster and the
fifth graph, all of same size, the [2,3] frame being empty.

 

I suppose this is due to a conflict between layout and the bigplot/smallplot
approach used by the imageplot() function, from which the plot method for
rasters is said to be inspired. But I am not sure and I cannot work it out.

 

Do I miss something, and can anybody help ?

 

All the best to all of you, thanks as always for all the work done here !
Olivier

 

--

Olivier ETERRADOSSI

Maître-Assistant, HDR

Ecole des Mines d’Alès (CMGD, site de Pau)

Pôle Matériaux Polymères Avancés (MPA)

Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9

Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)

Fax : 05 59 30 63 68

 


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


Re: [R] plot method for rasters and layout

2012-03-19 Thread Olivier Eterradossi
Mike,
It is with SDI in Windows.

Here is reproducible code (by the way, I just add the opening of any raster and 
plot it four times).

 library (raster)
  b- brick(system.file(external/rlogo.grd, package=raster))
 layout.matrix-matrix(c(1,2,3,4,5,5),2,3,byrow=TRUE)
 layout(mat=layout.matrix)
 layout.show(5)
 plot(b[[1]])
 plot(b[[1]])
 plot(b[[1]])
 plot(b[[1]])

Running this I get the four R logos in quadrants [,1:3] and [2,1], not in 
[1:2,1:2]

I've read the thread you suggest, I'm afraid I don't fully understand it.
Last tiume I updated R December 2011 from CRAN, so it seems that it is 
posterior to the fix.
 I'll update to 2.14 asap.

Thank you. Olivier

-Message d'origine-
De : Michael Sumner [mailto:mdsum...@gmail.com] 
Envoyé : lundi 19 mars 2012 13:23
À : Olivier Eterradossi
Cc : r-help@r-project.org
Objet : Re: [R] plot method for rasters and layout

Is this with SDI in Windows? I'd update to a recent version of R, and please 
provide reproducible code next time.

It could be the same as this issue, now long ago fixed:
https://stat.ethz.ch/pipermail/r-devel/2011-February/059906.html

Cheers, Mike.

On Mon, Mar 19, 2012 at 9:57 PM, Olivier Eterradossi 
olivier.eterrado...@mines-ales.fr wrote:
 Hi list,

 I thought I was used to layouts, but today I am facing a problem I 
 cannot overcome  :



 On my R installation (Windows 7 Pro, SP1, R version 2.13.0, daily 
 update of packages), I am not able to put raster plots in user defined 
 layouts :



 layout.matrix-matrix(c(1,2,3,4,5,5),2,3)

 layout(mat=layout.matrix)

 layout.show(5)



 works fine, I get the correct frames in the correct place. But, using 
 5 graphs (that all plot OK if plotted alone) :



 plot(raster1)

 plot(raster2)

 plot(raster3)

 plot(raster4)

 plot(any.other.graph.meant.to.be.in.frame.5)



 Plots giving the same layout  as :



 par(mfrow=c(2,3))

 plot(raster1)

 plot(raster2)

 plot(raster3)

 plot(raster4)

 plot(any.other.graph.supposed.to.fall.in.frame.5)



 i.e. 3 rasterplots on the first row followed by the fourth raster and 
 the fifth graph, all of same size, the [2,3] frame being empty.



 I suppose this is due to a conflict between layout and the 
 bigplot/smallplot approach used by the imageplot() function, from 
 which the plot method for rasters is said to be inspired. But I am not sure 
 and I cannot work it out.



 Do I miss something, and can anybody help ?



 All the best to all of you, thanks as always for all the work done here !
 Olivier



 --

 Olivier ETERRADOSSI

 Maître-Assistant, HDR

 Ecole des Mines d’Alès (CMGD, site de Pau)

 Pôle Matériaux Polymères Avancés (MPA)

 Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9

 Tel : 05 59 30 90 35 (direct) - 05 59 30  54 25 (std)

 Fax : 05 59 30 63 68




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




--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania Hobart, 
Australia
e-mail: mdsum...@gmail.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.


[R] problem with rJava : same as message from wwreith on Mon, 27 Jun 2011

2011-06-28 Thread Olivier ETERRADOSSI

Hi R-listers,

I run R version 2.13.0, on a i386-pc-mingw32/i386 platform under Windows XP.
I perform daily update of my installed packages.
I've got the most recent Java for this platform installed, as I am told 
by the JavaUpdater when checking.


(and I've read the posting guide, so that I'm not going to get fired by 
Uwe as poor wwreith [joke])...


But :

since one of the last daily updates (cannot tell exactly when because I 
spent some days without calling library(rJava), I get this error message 
(translated from french for the first part, in english for the second) :

Error : .onLoad failed in loadNamespace() for 'rJava', details :
 Call : fun(...)


error : No CurrentVersion entry in 'Software\JavaSoft\Java Runtime 
Environment'! Try re-installing Java and make sure R and Java have 
matching architectures.


So it seems to be quite the same as wwreith.

Can somebody help ?

Thanks, all the best to everybody. Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
animateur du groupe Sensomines (Institut Carnot M.I.N.E.S)
-
CMGD
Pôle Matériaux Polymères Avancés
axe Propriétés Psycho-Sensorielles des Matériaux
-
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35
fax: +33 (0)5.59.30.63.68
http://www.mines-ales.fr
e-mail : olivier.eterrado...@mines-ales.fr

__
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] Saving objects inside a list

2011-01-04 Thread Olivier ETERRADOSSI

Message: 42
Date: Mon, 3 Jan 2011 18:58:04 -0200
From: Eduardo de Oliveira Hortaeduardo.oliveiraho...@gmail.com
To: r-helpr-help@r-project.org
Subject: Re: [R] Saving objects inside a list
Message-ID:
aanlktimbxmr0rusiws1grorhjh=wstofzqdoc-90z...@mail.gmail.com
Content-Type: text/plain

sapply(ls(),get) works fine. Thanks.

ps: the as.list and the eapply suggestions didn't work.

Hi Eduardo (and all the best for this new year),

are you sure the as.list and eapply solutions didn't work ? On my 
machine they produce a list but in reverse order compared to the 
result of ls(),...maybe it's the same with you :


names(as.list(.GlobalEnv))[6] is the name of the 6th variable FROM THE 
END of ls().


Regards. Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
animateur du groupe Sensomines (Institut Carnot M.I.N.E.S)
-
CMGD
Pôle Matériaux Polymères Avancés
axe Propriétés Psycho-Sensorielles des Matériaux
-
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35
fax: +33 (0)5.59.30.63.68
http://www.mines-ales.fr
e-mail : olivier.eterrado...@mines-ales.fr

__
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] behaviour of xls2sep when running read.xls (package gdata) sinceupgrade of R

2010-04-07 Thread Olivier ETERRADOSSI

Hello eveRybody (and probably special regards to Gabor G),
I recently upgraded from R-2.9.2-win32 to R-10.1.0-win32, and I'm using 
Windows XP Professional 2002 with service pack 3 on a PC with IntelCore 
Duo CPU@ 3.00 GHz.
Last time I used it (some weeks ago, before upgrading), one of my 
scripts (including the two lines cited below) used to run OK.
When I ran it yesterday evening (after upgrading), I get the following 
message...
 if 
(test){file1-computername\\dir1name\\subdir1name\\subdir2name\\subdir3name\\filename.xls
nap1- 
read.xls(file1,sheet=3,method=tab,perl=perl.path,head=T,row.names=1)}
Erreur dans xls2sep(xls, sheet, verbose = verbose, ..., method = 
method,  :
  Unable to read translated tab file 
'C:\DOCUME~1\OLIVIE~1.ETE\LOCALS~1\Temp\RtmpPF2rxf\file6df11649.tab'.

Erreur dans file.exists(tfn) : argument 'file' incorrect
I tried with other xls files, in other folders and on other physical 
disks, and it was still the same.
I didn't upgrade manually either Excel nor Perl , and I cannot see 
tracks of automatic upgrades.
I had a look at the ChangeLog file in the lib/gdata folder, saw that 
some changes were dealing with xls2sep... but couldn't find some help, 
or at least couldn't understand it...


Can someone help, and please excuse me if the answer is obvious... maybe 
I lack some stronger coffee this morning !

Very best regards to all of you. Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
animateur du groupe Sensomines (Institut Carnot M.I.N.E.S)
-
CMGD
Pôle Matériaux Polymères Avancés
axe Propriétés Psycho-Sensorielles des Matériaux
-
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.mines-ales.fr
e-mail : olivier.eterrado...@mines-ales.fr

__
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] behaviour of xls2sep when running read.xls (package gdata) sinceupgrade of R

2010-04-07 Thread Olivier ETERRADOSSI

Thanks Gabor for the tip,
you're right as always : older gdata (2.6.1) works as usual.
So it was not the R-2.9 - R-2.10 upgrade which was responsible, but the 
gdata one...

Regards, Olivier

Gabor Grothendieck a écrit :

There are some known problems with reading Excel files in the CRAN
version of gdata.  There are workarounds posted in the gdata section
of this R wiki page:

http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows

On Wed, Apr 7, 2010 at 4:46 AM, Olivier ETERRADOSSI
olivier.eterrado...@mines-ales.fr wrote:
  

Hello eveRybody (and probably special regards to Gabor G),
I recently upgraded from R-2.9.2-win32 to R-10.1.0-win32, and I'm using
Windows XP Professional 2002 with service pack 3 on a PC with IntelCore Duo
CPU@ 3.00 GHz.
Last time I used it (some weeks ago, before upgrading), one of my scripts
(including the two lines cited below) used to run OK.
When I ran it yesterday evening (after upgrading), I get the following
message...


if
(test){file1-computername\\dir1name\\subdir1name\\subdir2name\\subdir3name\\filename.xls


nap1-
read.xls(file1,sheet=3,method=tab,perl=perl.path,head=T,row.names=1)}
Erreur dans xls2sep(xls, sheet, verbose = verbose, ..., method = method,
 :
 Unable to read translated tab file
'C:\DOCUME~1\OLIVIE~1.ETE\LOCALS~1\Temp\RtmpPF2rxf\file6df11649.tab'.
Erreur dans file.exists(tfn) : argument 'file' incorrect
  

I tried with other xls files, in other folders and on other physical disks,
and it was still the same.
I didn't upgrade manually either Excel nor Perl , and I cannot see tracks of
automatic upgrades.
I had a look at the ChangeLog file in the lib/gdata folder, saw that some
changes were dealing with xls2sep... but couldn't find some help, or at
least couldn't understand it...

Can someone help, and please excuse me if the answer is obvious... maybe I
lack some stronger coffee this morning !
Very best regards to all of you. Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
animateur du groupe Sensomines (Institut Carnot M.I.N.E.S)
-
CMGD
Pôle Matériaux Polymères Avancés
axe Propriétés Psycho-Sensorielles des Matériaux
-
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 fax: +33 (0)5.59.30.63.68
http://www.mines-ales.fr
e-mail : olivier.eterrado...@mines-ales.fr

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





  


--
Olivier ETERRADOSSI
Maître-Assistant
animateur du groupe Sensomines (Institut Carnot M.I.N.E.S)
-
CMGD
Pôle Matériaux Polymères Avancés
axe Propriétés Psycho-Sensorielles des Matériaux
-
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.mines-ales.fr
e-mail : olivier.eterrado...@mines-ales.fr

__
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] I might be dumb : a simple question about foreach

2009-07-21 Thread Olivier ETERRADOSSI

Many thanks David for making the connection betweeen the two reports.
If I understand, other french users may have faced the same problem...
However I'll wait until it's solved to have a look at foreach.
Regards. Olivier

David M Smith a écrit :
A user in Japan reported a similar problem on the Revolutions blog 
( http://bit.ly/FKP2I ), and my best guess is that it's an 
(unintended!) effect of using locales. The developers in New Haven are 
looking at it, and I expect they'll be able to post an update to CRAN 
soon.


# David Smith

On Mon, Jul 20, 2009 at 5:48 AM, Olivier ETERRADOSSI 
olivier.eterrado...@ema.fr mailto:olivier.eterrado...@ema.fr wrote:


Hi list,
My attention was drawn to the foreach package by recent posts...I
decided to have a look...
I'm using R.2.9.1 on Windows, I have downloaded the foreach
package today (v 1.2.1), together with iterators (v. 1.0.1) and
codetools (v.0.2-2).
Full of hope I try the most simple thing of all out of the package
vignette :

 x - foreach(i = 1:3) %do% sqrt(i)

and get :

Erreur dans sqrt(i) : indice hors limites ( i.e. error in
sqrt(i) : index out of bounds)

but when trying :

x-foreach(i = 1:3) %do% print(sqrt(i))

I get :

[1] 1
[1] 1.414214
[1] 1.732051
Erreur dans print(sqrt(i)) : indice hors limites

Probably I didn't drink enough coffee this morning and I'm still
asleep : it is obvious that  I miss a point... but I am unable to
see which one.
Any help appreciated ! Many thanks, and very best regards Olivier

-- 
Olivier ETERRADOSSI

Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 fax: +33 (0)5.59.30.63.68
http://www.ema.fr

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




--
David M Smith da...@revolution-computing.com 
mailto:da...@revolution-computing.com
Director of Community, REvolution Computing 
www.revolution-computing.com http://www.revolution-computing.com

Tel: +1 (206) 577-4778 x3203 (San Francisco, USA)

Check out our upcoming events schedule at 
www.revolution-computing.com/events 
http://www.revolution-computing.com/events




--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

__
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] I might be dumb : a simple question about foreach

2009-07-20 Thread Olivier ETERRADOSSI

Hi list,
My attention was drawn to the foreach package by recent posts...I 
decided to have a look...
I'm using R.2.9.1 on Windows, I have downloaded the foreach package 
today (v 1.2.1), together with iterators (v. 1.0.1) and codetools (v.0.2-2).
Full of hope I try the most simple thing of all out of the package 
vignette :

 x - foreach(i = 1:3) %do% sqrt(i)

and get :
Erreur dans sqrt(i) : indice hors limites ( i.e. error in sqrt(i) : 
index out of bounds)

but when trying :


x-foreach(i = 1:3) %do% print(sqrt(i))

I get :


[1] 1
[1] 1.414214
[1] 1.732051
Erreur dans print(sqrt(i)) : indice hors limites
Probably I didn't drink enough coffee this morning and I'm still asleep 
: it is obvious that  I miss a point... but I am unable to see which one.

Any help appreciated ! Many thanks, and very best regards Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

__
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] I might be dumb : a simple question about foreach

2009-07-20 Thread Olivier ETERRADOSSI

Thanks Michael
I already tried the curly brackets before my first post... no hope, it
didn't change anything.
Turning %do% into %dopar% didn't work as well...
Do you suggest some Windows related behaviour ?
regards, Olivier


Michael Knudsen-2 wrote:
 
 On Mon, Jul 20, 2009 at 2:48 PM, Olivier
 ETERRADOSSIolivier.eterrado...@ema.fr wrote:
 
  x - foreach(i = 1:3) %do% sqrt(i)

 and get :

 Erreur dans sqrt(i) : indice hors limites ( i.e. error in sqrt(i) :
 index
 out of bounds)
 
 I once got similar errors because I didn't encapsulate the part af
 %do% or %dopar% in curly brackets. Try
 
 x - foreach(i = 1:3) %do% { sqrt(i) }
 
 I should say, however, that in this particular case, your original
 code evaluates without errors on my computer (Mac OSX 10.5.7 with R
 2.9.1).
 
 By the way, remember to use %dopar% instead of %do%, if you want to
 take advantage of multiple cores. While being totally ecstatic after
 discovering foreach, I wrote the following (very simple) guide:
 
 http://lifeofknudsen.blogspot.com/2009/07/most-of-work-i-do-in-r-has-to-do-with.html
 
 Maybe you'll find it useful, maybe not.
 
 -- 
 Michael Knudsen
 micknud...@gmail.com
 http://lifeofknudsen.blogspot.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.
 
 

-- 
View this message in context: 
http://www.nabble.com/I-might-be-dumb-%3A-a-simple-question-about-%22foreach%22-tp24569290p24569609.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.


Re: [R] I might be dumb : a simple question about foreach

2009-07-20 Thread Olivier ETERRADOSSI

Robert, and everybody :
sorry I didn't say I run Windows XP pro version 2002, Service Pack 3
Thank you, regards to all. Olivier


Robert Kinley wrote:
 
 Your code runs fine on my windows hp machine ( XP - sp2, R.2.9.1 )
 
 x - foreach(i = 1:3) %do% sqrt(i)
 x
 [[1]]
 [1] 1
 
 [[2]]
 [1] 1.414214
 
 [[3]]
 [1] 1.732051
 
 
 Are you on Vista , maybe ? 
 
  
 Robert  Kinley
 
  
 
 
 
 Michael Knudsen micknud...@gmail.com 
 Sent by: r-help-boun...@r-project.org
 20/07/2009 14:23
 
 To
 Olivier ETERRADOSSI olivier.eterrado...@ema.fr
 cc
 r-help@r-project.org
 Subject
 Re: [R] I might be dumb : a simple question about foreach
 
 
 
 
 
 
 On Mon, Jul 20, 2009 at 3:14 PM, Olivier
 ETERRADOSSIolivier.eterrado...@ema.fr wrote:
 
 Do you suggest some Windows related behaviour ?
 
 I haven't used Windows for more than ten years, so unfortunately I
 have no clue whatsoever. Maybe there are some Windows experts here who
 can help you. America is slowly waking up now, so cross your fingers
 :-)
 
 -- 
 Michael Knudsen
 micknud...@gmail.com
 http://lifeofknudsen.blogspot.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.
 
 
   [[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.
 
 

-- 
View this message in context: 
http://www.nabble.com/I-might-be-dumb-%3A-a-simple-question-about-%22foreach%22-tp24569290p24570254.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.


Re: [R] converting numeric into character strings

2009-05-13 Thread Olivier ETERRADOSSI

Hi Melissa
unless I miss a point, you should get what you want with (for example)

y-paste(b,collapse=,)

Hope this helps. Olivier


Melissa2k9 wrote:
 
 Hi,
 
 Im trying to put some numbers into a dataframe , I have a list of numbers
 (change points in a time series) like such
 
 [1]  2 11 12 20 21 98 99
 
 but I want R to recognise this as just a character string so it will put
 it in one row and column, ideally I want them seperated by commas so I
 would have for example
 
 Person  Change points (seconds)
 A   2,11,12,20,21,98,99  
 B4,5,89
  
 etc. Is there any way I can get this
 
 I've tried this:
 
 for example if the command to get the list of numbers was b-which(a!=s),
 then i have tried
 
 as.character(b) but I just end up with 
 
 [1] 2  11 12 20 21 98 99
 
 which is not what I want as this is more than one string and is not
 seperated by commas, I also tried
 
 paste(b,sep=,) but I end up with the same thing. Sorry it's a bit
 confusing to read but any help would be great! 
 
 Melissa
 

-- 
View this message in context: 
http://www.nabble.com/converting-numeric-into-character-strings-tp23518762p23519577.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.


Re: [R] 3d Scatterplot using rgl

2009-05-11 Thread Olivier ETERRADOSSI

Hi Zoé,
try
plot3d(swadt[,1],swadt[,2],swadt[,3],radius=swadt[,4],type=s)

Hope this helps. regards. Olivier


Zoe Hoare wrote:
 
 Hi,
 I am trying to plot a 3d scatter plot using the rgl package but am having
 trouble.
 I have a matrix containing x, y and z co-ordinates and a fourth element
 related to a count variable. 
 I would like to plot the points using plot3d with the sizes of the points
 related to the fourth element in the matrix. Is this possible with plot3d
 or do I need to use something else?
 
 I include a small example of what I am trying to do
 
  swadt
  A   B  Crun1 run2 run3 run4 run5 run6
   93  96 51  0.1   NA  0.1   NA   NA   NA
   93  97 50  0.3   NA   NA  0.1   NA   NA
   93  98 49  0.1   NA   NA   NA   NA   NA
   94  95 51   NA   NA   NA   NA   NA  0.1
   94 100 46  0.1   NA   NA   NA   NA   NA
   94  96 50  2.1  0.1  1.0  0.7  0.8  0.4
   94  97 49  3.2  0.9  1.9  1.9  1.6  1.6
   94  98 48  0.9   NA  0.3  0.4  0.5  0.1
   95  94 51   NA   NA   NA  0.1  0.1   NA
   95  95 50  3.4  0.7  2.8  2.4  2.9  2.3
   95  96 49 12.5 13.4 13.6 15.0 15.3 17.1
   95  97 48 10.2 10.8  8.9 10.8  8.7  9.3
   95  98 47  1.5   NA  0.9  0.7  0.8  0.1
   96  93 51  0.1   NA   NA   NA   NA   NA
 
 If I use
 plot3d(swadt[,1],swadt[,2],swadt[,3],size=swadt[,4])
 I get the following error
 Error in rgl.numeric(size) : size must be a single numeric value
 
 Is there a way of plotting this?
 Thanks
 Zoe Hoare
 
 
   
   [[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.
 
 

-- 
View this message in context: 
http://www.nabble.com/3d-Scatterplot-using-rgl-tp23480170p23481038.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.


Re: [R] Bubble Plot Over a Map

2009-05-07 Thread Olivier ETERRADOSSI

Hi Rodrigo,
did you consider having a look at package ggplot2 (thanks to Hadley
Wickham).
I guess you'll find something very close to your need (functions ggplot,
geom_point,...)
Hope this helps. regards. Olivier


Rodrigo Aluizio wrote:
 
 Hi everybody,
 
 Well here is another doubt! I’m elaborating some maps, and I pretend to
 plot
 over it the abundance of species. I could do that using points(), but I’d
 like to use bubble() from sp package.
 
 When trying to use bubble() I face the fallowing issue: When I call the
 bubble function it overwrite everything I previously plotted. It doesn’t
 happen with points (obviously), only with bubble(). I tried to specify
 panel.smooth as panel function to bubble, I tried to use add=T as
 argument,
 but it didn’t accept such thing.
 
 The only thing that I thought right now, so I still have to try, is saving
 the bubble() as an object and try to manipulate its properties over my
 map.
 
 I already searched the list posts but wasn’t able to find a similar doubt
 with its possible solutions.
 
  
 
 Bellow is the map code using points, I’m trying to substitute the points()
 functions with one bubble() function.
 
  
 
 for (i in 1:length(colnames(Spp10ml))) {
 
 png(paste(colnames(Spp10ml),'.png',sep='')[i],width=5.2,height=3.6,pointsize
 =5,units='in',bg=NA,restoreConsole=T,res=1200)
 
 par(mar=c(5,0,0,0))
 
 map('worldHires','brazil',ylim=c(-5.15,-4.55),xlim=c(-37,-36.1),type='n')
 
 rect(-37.1,-5.25,-36,-4.9,density=NULL,angle=45,col='#dbf4ff',border=F)
 
 plot(Batimetria,ylab='',xlab='',border=F,col=Cor$Cor,add=T)
 
 plot(Municipios,ylab='',xlab='',col=rgb(245,232,140,max=255,alpha=255),add=T
 ,lwd=0.2)
 
 axis(1,xaxp=c(-37,-36.1,5),cex.axis=1.5)
 
 axis(2,yaxp=c(-5.15,-4.55,5),cex.axis=1.5)
 
 text(Prof$Long,Prof$Lat,rownames(Prof),col='black',cex=1.2,srt=-24,family='A
 R',font=2)
 
 text(c(-36.96,-36.96,-36.865,-36.54,-36.37,-36.2),c(-4.96,-5.05,-5.11,-5.14,
 -5.14,-5.14),c('Areia
 
 Branca','Serra
 
 do Mel','Porto do
 Mangue','Macau','Guamaré','Galinhos'),col='Black',cex=1.3,font=2)
 
 rect(-36.20,-4.56,-36.155,-4.565,density=NULL,angle=45,col='black',border='b
 lack',lwd=0.1)
 
 rect(-36.155,-4.56,-36.111,-4.565,density=NULL,angle=45,col='white',border='
 black',lwd=0.1)
 
 shadowtext(c(-36.20,-36.155,-36.111,-36.215),c(-4.573,-4.573,-4.573,-4.562),
 c('0','5','10','km'),col='white',cex=1)
 
 Norte(-36.155,-4.60,0.02)
 
 box(which='plot',lty='solid')
 
 points(Pontos$long[Spp10ml[,i]0 
 Spp10ml[,i]=50],Pontos$lat[Spp10ml[,i]0
  Spp10ml[,i]=50],pch=21,bg=rgb(70,70,70,max=255,alpha=255),col=
 'black',cex=1.5)
 
 points(Pontos$long[Spp10ml[,i]=51 
 Spp10ml[,i]=200],Pontos$lat[Spp10ml[,i]=51 
 Spp10ml[,i]=200],pch=23,bg='yellow',col='black',cex=1.5)
 
 points(Pontos$long[Spp10ml[,i]=201 
 Spp10ml[,i]=400],Pontos$lat[Spp10ml[,i]=201 
 Spp10ml[,i]=400],pch=22,bg='orange',col='black',cex=1.5)
 
 points(Pontos$long[Spp10ml[,i]=401],Pontos$lat[Spp10ml[,i]=401],pch=24,bg=
 'red',col='black',cex=1.5)
 
 dev.off()}
 
  
 
 Thanks in advance.
 
  
 
 -
 
 MSc.  mailto:r.alui...@gmail.com Rodrigo Aluizio
 
 Centro de Estudos do Mar/UFPR
 Laboratório de Micropaleontologia
 Avenida Beira Mar s/n - CEP 83255-000
 Pontal do Paraná - PR - Brasil
 
 
 
 
   [[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.
 
 

-- 
View this message in context: 
http://www.nabble.com/Bubble-Plot-Over-a-Map-tp23426635p23428390.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.


Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI

Hi Silvia,
excuse me if I'm missing something but sampling the row numbers should make
it :

let M be your matrix, and spM a sample with n rows :
spM - M[sample(seq(1,dim(M)[1],by=1), n),]

Regards, Olivier


Silvia Lomascolo wrote:
 
 Hi R community,
 I am trying to obtain a sample from a matrix but sample(my.matrix) doesn't
 do what I need. I have a matrix of 1287 interactions between the species
 in columns and the species in rows and I want to obtain a smaller matrix
 with say, 800 interactions, that may or may not have the same number of
 columns and/or rows (i.e., some interactions may not be retrieved in a
 smaller sample). For example, my original mock matrix M is
 
 
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 The command sample(my.matrix) samples whole cells from my matrix, such
 that if the interaction between species 1 and 1 is included in the sample,
 they always show 140 interactions.  But what I want is to sample cases
 within each cell.  My sample matrix S could have =140 interactions
 between species 1 and 1, =100 between species 1 and 2, etc. Again, if
 some combination is absent from the sample matrix, that's OK.
 
 Here's my code, in case it helps:
 
 pla- c(10, 9, 6, 5, 3) #abundance of pla species
 pol- c(14, 10, 9, 4, 2) #abundance of pol species
 m-pla%*%t(pol) #matrix of interactions according to pla and pol abundance
 m
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 sample(m) #doesn't give me what I want...
 
 I have searched the forum for an answer but all questions regarding
 sampling from matrices refer to sampling whole rows or columns, not
 cases within a matrix.  
 Thanks in advance for any help! Silvia.
 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-sample-%22cases%22-within-a-matrix--tp23296664p23314865.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.


Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI

Well Silvia,
I understand that I didn't read your post carefully.
Forget about my previous (unrelevant) post.
regards. olivier


Olivier ETERRADOSSI wrote:
 
 Hi Silvia,
 excuse me if I'm missing something but sampling the row numbers should
 make it :
 
 let M be your matrix, and spM a sample with n rows :
 spM - M[sample(seq(1,dim(M)[1],by=1), n),]
 
 Regards, Olivier
 
 
 Silvia Lomascolo wrote:
 
 Hi R community,
 I am trying to obtain a sample from a matrix but sample(my.matrix)
 doesn't do what I need. I have a matrix of 1287 interactions between the
 species in columns and the species in rows and I want to obtain a smaller
 matrix with say, 800 interactions, that may or may not have the same
 number of columns and/or rows (i.e., some interactions may not be
 retrieved in a smaller sample). For example, my original mock matrix M is
 
 
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 The command sample(my.matrix) samples whole cells from my matrix, such
 that if the interaction between species 1 and 1 is included in the
 sample, they always show 140 interactions.  But what I want is to sample
 cases within each cell.  My sample matrix S could have =140
 interactions between species 1 and 1, =100 between species 1 and 2, etc.
 Again, if some combination is absent from the sample matrix, that's OK.
 
 Here's my code, in case it helps:
 
 pla- c(10, 9, 6, 5, 3) #abundance of pla species
 pol- c(14, 10, 9, 4, 2) #abundance of pol species
 m-pla%*%t(pol) #matrix of interactions according to pla and pol
 abundance
 m
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 sample(m) #doesn't give me what I want...
 
 I have searched the forum for an answer but all questions regarding
 sampling from matrices refer to sampling whole rows or columns, not
 cases within a matrix.  
 Thanks in advance for any help! Silvia.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-sample-%22cases%22-within-a-matrix--tp23296664p23315275.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.


Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI

Hi again Silvia (last time... ?),
now : do I understand : you want 
1) to randomly select some intersections between rows and columns
2) randomly select a number of cases for each intersection (being = the
number of initial cases ?

if yes, here is my solution, using your example :

# select intersections, put them in new matrix mm
mm-m[sample(seq(1,5,by=1),2),sample(seq(1,5,by=1),3)]

# make a function that samples a number of cases
foo-function(x) sample(seq(1,x,by=1),1)

# use mapply
mmm-matrix(mapply(mm,FUN=foo),dim(mm)[1],dim(mm)[2])

On my computer it seems to work... hope this really help, this time !
Regards. Olivier




Silvia Lomascolo wrote:
 
 Hi R community,
 I am trying to obtain a sample from a matrix but sample(my.matrix) doesn't
 do what I need. I have a matrix of 1287 interactions between the species
 in columns and the species in rows and I want to obtain a smaller matrix
 with say, 800 interactions, that may or may not have the same number of
 columns and/or rows (i.e., some interactions may not be retrieved in a
 smaller sample). For example, my original mock matrix M is
 
 
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 The command sample(my.matrix) samples whole cells from my matrix, such
 that if the interaction between species 1 and 1 is included in the sample,
 they always show 140 interactions.  But what I want is to sample cases
 within each cell.  My sample matrix S could have =140 interactions
 between species 1 and 1, =100 between species 1 and 2, etc. Again, if
 some combination is absent from the sample matrix, that's OK.
 
 Here's my code, in case it helps:
 
 pla- c(10, 9, 6, 5, 3) #abundance of pla species
 pol- c(14, 10, 9, 4, 2) #abundance of pol species
 m-pla%*%t(pol) #matrix of interactions according to pla and pol abundance
 m
  [,1] [,2] [,3] [,4] [,5]
 [1,]  140  100   90   40   20
 [2,]  126   90   81   36   18
 [3,]   84   60   54   24   12
 [4,]   70   50   45   20   10
 [5,]   42   30   27   126
 
 sample(m) #doesn't give me what I want...
 
 I have searched the forum for an answer but all questions regarding
 sampling from matrices refer to sampling whole rows or columns, not
 cases within a matrix.  
 Thanks in advance for any help! Silvia.
 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-sample-%22cases%22-within-a-matrix--tp23296664p23315500.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.


[R] Re : legend with small colored boxes

2009-04-29 Thread Olivier ETERRADOSSI

Hi Christophe,
just try :

legend(top,leg=c(a,b),fill=c(black,blue))



instead of your :

legend(top,leg=c(a,b),col=c(black,blue), fill=TRUE)

Regards, Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

__
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] Re : Taylor diagram

2008-12-08 Thread Olivier ETERRADOSSI

Hi Gabriela,
as suggested by Jim I'll have a look as soon as possible  (but only 
tomorrow I'm afraid).
Maybe you could provide me with a dataset of yours which shows the 
problem (use direct postin gt o my own address 
[EMAIL PROTECTED], instead of posting the data to Rlist) ?

Thanks,
Olivier

--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

__
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 - how to measure the distance?

2008-12-08 Thread Olivier ETERRADOSSI

Hi,
I'm not sure that I fully understand your problem, so forgive me if my
suggestion is irrelevant :
maybe you should have a look to function geod.dist , in the oce package.
Hope this helps. Olivier


porzycka wrote:
 
 Hello,
 I have been worked with R for 3 weeks. I have one problem. I could not
 find the answer on it on web pages. I do not know how to measure the
 shortes distance between point (Lon/Lat) and line. I used spatstat package
 and distmap() but I want to calculate these distances only for particular
 points without generate distance map.
 
 Thank you for all hints.
 S.Porzycka
 
 __
 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.
 
 

-- 
View this message in context: 
http://www.nabble.com/R---how-to-measure-the-distance--tp20879418p20897078.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.


[R] Re : Dataframe help

2008-11-06 Thread Olivier ETERRADOSSI

Hi Ramya,
Sorry if I missed something, but unless I have problems reading your 
message it seems that there is no line in your example matching both 
your test conditions...

Hope this helps. Olivier



Hi there,

I have a dataframe length.unique.info
  

 length.unique.info


abc 12  345
def  16  550
lmn  6   600
I want those names that fall under the condition (length.unique.info[,2][i]
=5  length.unique.info[,3][i] =500)

abcder-length.unique.info[which(length.unique.info[,2][i] =5 
length.unique.info[,3][i] = 500),1]

will  look for both the condition.It isnt returning names is there
anything i am missing.Kindly suggest me the way to do it.

Regards
Ramya


--
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68

http://www.ema.fr

__
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] adimpro package : R does not seem to find my ImageMagickinstallation

2008-03-19 Thread Olivier ETERRADOSSI
Thank you Professor,
yes it is (unfortunately...), or at least it seems to be ;-)
 c:\program files\imagemagick-6.3.0-q16;C:\Program Files\MiKTeX 
 2.6\miktex\bin;   ...8..(snip)..
Regards, Olivier


Prof Brian Ripley a écrit :
 On Wed, 19 Mar 2008, Olivier ETERRADOSSI wrote:

 Dear list,
 (sorry if I post to the wrong place...),

 Though having spent some time on it, I cannot find an answer by myself
 to the following behaviour of the read.image function (adimpro 
 package) :
 I'm running R.2.6.2 on Windows XP. The home directory is C:\Program
 files\R\R-2.6.2
 Version 0.4.4 of adimpro is loaded.
 ImageMagick 6.3.0 is installed, its directory is C:\Program
 files\ImageMagick-6.3.0-Q16

 When using function read.image in adimpro, extensionstif, tiff,
 png .. and so on are not recognized, as seems to say the following
 error message :
 Error in read.image(file = JFtiff.tiff) :
   cannot find JFtiff.ppm
 In my understanding, this means that adimpro behaves as if ImageMagick
 was not installed, as the manual says :
 If ImageMagick is not available only pgm, ppm and pnm formats
 can be processed
 What am I misunderstanding or doing wrong ? (perhaps wrong location of
 ImageMagick or wrong version...?)

 Is it (or its bin directory, if it has one) in your PATH?  Being 
 installed is not enough 


-- 
Olivier ETERRADOSSI
Maître-Assistant
CMGD / Equipe Propriétés Psycho-Sensorielles des Matériaux
Ecole des Mines d'Alès
Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
tel std: +33 (0)5.59.30.54.25
tel direct: +33 (0)5.59.30.90.35 
fax: +33 (0)5.59.30.63.68
http://www.ema.fr

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