[R] RCurl : All connection are used ?

2010-11-22 Thread omerle
     Hi everybody,

I got a problem with the ftpUpload function from the RCurl package. My goal is 
to Upload a lot of files from a local directory to a web server.

1st try :

for (i in 1:length(file)){
      ftpUpload(what=files[i],to=files[i])
}
At i=11 I get : (my server has only 10 available open connections available) :
Erreur dans curlPerform(url = to, upload = TRUE, readfunction = 
uploadFunctionHandler(what,  :
  Got a 421 ftp-server response when 220 was expected

2 nd Try :

ftpConnection=getCurlHandle(userpwd=ftp$userpwd,maxconnects=1,fresh.connect=0)
for (i in 1:length(file)){
      ftpUpload(what=files[i],to=files[i],curl=ftpConnection)
}
And I got this error after 30 files (the error is not linked to the web server 
but to the R session) :
Error in file(file, rb) : all conection are used

I read the documentation and the options from curl library but I can't find how 
to solve my problem even if I think that the problem is linked to not closing 
the position I opened. Do you have any idea how to solve it ?

Thanks,

Olivier Merle


Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

[[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] Different time between date() and Sys.date()

2010-10-21 Thread omerle
Hi,

I got two different times between these functions :
 date()
[1] Thu Oct 21 12:11:37 2010
 Sys.time()
[1] 2010-10-21 10:11:40 GMT


I know that its because I did Sys.setenv(TZ=GMT). Even if my system is set by 
default at CEST.
I think that the difference between date() and Sys.time() is equal to the 
difference between CEST and GMT.
I would like to get the time of my machine even if I set GMT as a time zone 
with the Sys.time() function.
How can I get the real time from the Sys.time() function ?
Or I can really set my time zone to GMT to get the real time with Sys.time() ?

Thanks,

Olivier Merle

Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

[[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] Different time between date() and Sys.date()

2010-10-21 Thread omerle
Thanks for you answer.
It s sufficient but I d like to know why my system think I am CEST and yours 
think your are EDT.
Can I change it ?
Do you know where can I find a list of the timezone ?

 Message du 21/10/10 15:07
 De : David Winsemius
 A : omerle
 Copie à : r-help@r-project.org
 Objet : Re: [R] Different time between date() and Sys.date()



 On Oct 21, 2010, at 6:19 AM, omerle wrote:

  Hi,
 
  I got two different times between these functions :
  date()
  [1] Thu Oct 21 12:11:37 2010
  Sys.time()
  [1] 2010-10-21 10:11:40 GMT
 
 
  I know that its because I did Sys.setenv(TZ=GMT). Even if my
  system is set by default at CEST.
  I think that the difference between date() and Sys.time() is equal
  to the difference between CEST and GMT.
  I would like to get the time of my machine even if I set GMT as a
  time zone with the Sys.time() function.
  How can I get the real time from the Sys.time() function ?
  Or I can really set my time zone to GMT to get the real time with
  Sys.time() ?

  Sys.time()
 [1] 2010-10-21 09:04:40 EDT
  as.POSIXlt(Sys.time(), tz=GMT)
 [1] 2010-10-21 13:06:40 GMT

 
  Thanks,
 
  Olivier Merle
 
  Une messagerie gratuite, garantie à vie et des services en plus, ça
  vous tente ?
  Je crée ma boîte mail www.laposte.net
 
  [[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.

 David Winsemius, MD
 West Hartford, CT


 

Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

[[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] Data.frames : difference between x$a and x[, a] ? - How set new values on x$a with a as variable ?

2010-09-10 Thread omerle
Hi,

I got two questions :

1st Question
            a=S
            b=data.frame(S=3)
            do.call(`-`,list(do.call(`$`,list(b,S)),5))
= How can I put new values on S column having the column name as a variable ?

2 nd Question
       a=S
       b=data.frame(S=3)
       b[,S]=list(1:10) #Doesnt works
       b$S=list(1:10) #Works
= Isnt the same thing ? What is the difference between these two things ?


Thanks,

Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

[[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] Data.frames : difference between x$a and x[, a] ? - How set new values on x$a with a as variable ?

2010-09-10 Thread omerle
 Message du 10/09/10 14:53
 De : Ista Zahn
 A : omerle
 Copie à : r-help@r-project.org
 Objet : Re: [R] Data.frames : difference between x$a and x[, a] ? - How set 
 new values on x$a with a as variable ?


 Hi,

 On Fri, Sep 10, 2010 at 4:05 AM, omerle wrote:
  Hi,
 
  I got two questions :
 
  1st Question
              a=S
              b=data.frame(S=3)
              do.call(`-`,list(do.call(`$`,list(b,S)),5))

 I think there is some confusion here. Why are you setting a equal to
 S but then never using it?

  = How can I put new values on S column having the column name as a 
  variable ?

 I'm having trouble parsing this. What exactly do you want to do?
1 - Put a list as an element of a data.frame. That's quite convenient for my 
pricing function.
 
 
  2 nd Question
         a=S
         b=data.frame(S=3)
         b[,S]=list(1:10) #Doesnt works
         b$S=list(1:10) #Works
  = Isnt the same thing ? What is the difference between these two things ?

 I believe b[[S]] is the same as b$S, b[,S] is different. But I
 have to question your assertion that b$S=list(1:10) Works. This is a
 very odd construction (putting a list as an element of a data.frame)
 and is almost certainly not what you want.
2 - That's what I want. I figured out just five minutes ago that b[[S]] works 
because it's the same thing as b$S.
But I still dont know what is b[,S] compared to b[[S]]
 
 
  Thanks,
 
  Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
  tente ?
  Je crée ma boîte mail www.laposte.net
 
         [[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.
 
 



 --
 Ista Zahn
 Graduate student
 University of Rochester
 Department of Clinical and Social Psychology
 http://yourpsyche.org

 

Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

[[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] Using library and lib.loc

2010-09-02 Thread omerle
Hi,

I didn't find any post on this subject so I ll ask you some advices.

Let's say that I have two library trees.

Number 1 is the default R library tree on path1
Number 2 is another library tree on a server with all packages on path2.

When I set library(aaMI,lib.loc=paths2) it loads the package even if its not on 
default R library
When I set library(fOptions,lib.loc=paths2) it doesn't load because timeSeries 
is not on default R library (timeSeries is a required package for fOptions)

 library(fOptions,lib.loc=.lib.loc)
Le chargement a nécessité le package : timeDate
Le chargement a nécessité le package : timeSeries
Erreur : le package 'timeSeries' ne peut être chargé
De plus : Message d'avis :
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = 
lib.loc) :
  aucun package nommé 'timeSeries' n'est trouvé

(Sorry for french error message. By the way, how can I set error in French 
(setting language in English in R installation is not sufficient !)

How can I set lib.loc for every package that I will load ?

Or is there any global way of doing this ?

Thanks,

Olivier


Une messagerie gratuite, garantie à vie et des services en plus, ça vous 
tente ?
Je crée ma boîte mail www.laposte.net

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