[R] Problem with save or/and if (I think but maybe not ...)

Ptit_Bleu ptit_bleu at yahoo.fr
Mon Aug 27 11:32:52 CEST 2007


Dear Prof Ripley,

I thank you for your fast answer.
In order to follow your advices :

I deleted all the objects and the tfichiers.r already created.
I changed all the "tfichiers.t" of the script into "tfichiers.rda"

Then I launched the script twice.
The first time, as tfichiers.rda didnt' exist, it created one.
During the script, I got this warning :
1: la condition a une longueur > 1 et seul le premier élément est utilisé
in: if (nfichiers != "0")
(translate with my words : the condition has a length superior to 1 and only
the first element is used in ...)
Below, you will find the results.

The second launch gave the same results for nfichiers and rfichiers but for
tfichiers I obtained
"tfichiers".

Have you some ideas to help me (because I really have none ...)
Again thank you,
Ptit Bleu.

------------------------------------------------------
FIRST LAUNCH

>nfichiers
[1] "d:/Mydata/31_07_07.P0"   "d:/Mydata/31_07_2007.P0"
[3] "d:/Mydata/31_07_2007.P1" "d:/Mydata/31_07_2007.P2"
[5] "d:/Mydata/31_07_2007.P3"

> nfichiers!="0"
[1] TRUE TRUE TRUE TRUE TRUE

>rfichiers
[1] "d:/Mydata/31_07_07.P0"   "d:/Mydata/31_07_2007.P0"
[3] "d:/Mydata/31_07_2007.P1" "d:/Mydata/31_07_2007.P2"
[5] "d:/Mydata/31_07_2007.P3"

>tfichiers
[1] "d:/Mydata/31_07_07.P0"   "d:/Mydata/31_07_2007.P0"
[3] "d:/Mydata/31_07_2007.P1" "d:/Mydata/31_07_2007.P2"
[5] "d:/Mydata/31_07_2007.P3"
----------------------------------------------------------

SECOND LAUNCH
with these changes in order not to change tfichiers.rda
#tfichiers<-rfichiers
#save(tfichiers, file="tfichiers.rda")

>nfichiers
[1] "d:/Mydata/31_07_07.P0"   "d:/Mydata/31_07_2007.P0"
[3] "d:/Mydata/31_07_2007.P1" "d:/Mydata/31_07_2007.P2"
[5] "d:/Mydata/31_07_2007.P3"

> nfichiers!="0"
[1] TRUE TRUE TRUE TRUE TRUE

>rfichiers
[1] "d:/Mydata/31_07_07.P0"   "d:/Mydata/31_07_2007.P0"
[3] "d:/Mydata/31_07_2007.P1" "d:/Mydata/31_07_2007.P2"
[5] "d:/Mydata/31_07_2007.P3"

>tfichiers
"tfichiers"

 
-- 
View this message in context: http://www.nabble.com/Problem-with-save-or-and-if-%28I-think-but-maybe-not-...%29-tf4333945.html#a12344036
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list