Re: [R] Combine R2HTML and Rcmd BATCH?

2007-07-17 Thread Bos, Roger
Dieter,

I use htmlize in library prettyR to produce a HTML report at the end of
a long batch file and this process works fine.  I posted my call to
htmlize below, but it would take too much modification for me to produce
a working example.  My guess is that it is something else that is
messing up the process.  I bet if you created a very simple example it
would work.  And if it didn't work, you could post it here and then
people could try to find out why it doesn't work.  If it does work, you
can add to it gradually until you find the problem.  This is how I got
htmlize to work.

Roger


library(prettyR)
today <- as.Date(Sys.time(), format="%m/%d/%Y")
htmlize(Rfile="//rinnycs0051/research/R_HOME/morningNotesMaster.r",
HTMLbase="morningNotes", HTMLdir="//rinnycs0051/ramdata/morningNotes",
title="RAM Morning Notes " %+% today, echo=FALSE, do.nav=FALSE)


 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dieter Vanderelst
Sent: Tuesday, July 17, 2007 7:06 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Combine R2HTML and Rcmd BATCH?

Hi All,

I have an R script that spawns output in the form of an HTML page. This
is done by the R2HTML package.

Now I want to run the same script using Rcmd BATCH. However, it seems
that it is not possible to use R2HTML in this case.

My script ends with this error message:
#
Error in dev.print(png, file = AbsGraphFileName, width = Width, height =
Height,  :

can only print from screen device

Execution halted
#

I can not find how to work around this problem in the R2HTML manual or
the help archives.

Has anybody done a similar thing before? Any suggestions?

Greetings,
Dieter

--
Dieter Vanderelst
[EMAIL PROTECTED]
Department of Industrial Design
Designed Intelligence

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] can I run/launch an excel VBA macro from wihin R?

2007-07-16 Thread Bos, Roger
I have Excel files that use the auto_open() sub to run automatically and
then I can open the file using R by using the shell() command.  Then
once the file is done running, I can process the file again using R.
Works pretty well, as long as I don't have any problems on the excel
side.


shell("excel {path to filename}")
Excel has to be in your path, or you can give the full path to excel.
You don't need the double quotes if none of your folders or files have
spaces in them.

HTH, Roger

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Pujol
Sent: Monday, July 16, 2007 12:13 AM
To: r-help@stat.math.ethz.ch
Subject: [R] can I run/launch an excel VBA macro from wihin R?

Is there an "easy" or good way to run/launch an Excel VBA macro from
within R?

   
-
Pinpoint customers who are looking for what you sell. 
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Batch processing in Windows

2007-06-08 Thread Bos, Roger
Alternatively, use the full path in your call to R as I do below:

"F:\Program Files\R\R-2.4.1pat\bin\R.exe" CMD BATCH --vanilla --slave whatever.R

HTH,

Roger

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabor 
Grothendieck
Sent: Friday, June 08, 2007 1:51 PM
To: Sébastien Bihorel
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Batch processing in Windows

R isn't in your path.  Either change your path to include it or place Rcmd.bat 
from batchfiles anywhere in your existing path:

   http://code.google.com/p/batchfiles/

and then:

   Rcmd BATCH ...whatever...


On 6/8/07, Sébastien Bihorel <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am a complete newbe to R, so the following problem will probably be 
> trivial for most of you guys:  I get an error message every time I try 
> to run a R file directly from the DOS shell.
>
> My R file (test.R) is intended to create a basic graph and has a very 
> simple code:
>
> x<-rep(1:10,1)
> y<-rep(1:10,1)
> plot(x,y)
>
> I am using the following command to call this file directly from the 
> c:/
> root:
> C:/>R CMD BATCH e:/Documents Seb/3_/test.R
>
> And here is the error message (Translated from french to english):
> 'R' is not recognized as an internal or external command, an 
> executable script or a command file
>
> My OS is a french Windows XP sp2 and I am using R version 2.5.0. I 
> wonder if the problem comes from an installation problem...
>
> Thank you in advance for your help.
>
> Sebastien
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] GUI for R running under Linux

2007-06-05 Thread Bos, Roger
I am not very good with Linux, but I have a setup that works pretty well
using the KDE desktop environment, which offers Kate.  Once inside Kate
you can open a terminal session and start R there.  Then you can send
code snippets from Kate to R and see the output.  Its not as good as
Tinn-r under Windows, but as close as I could get.

HTH,

Roger 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Charles C. Berry
Sent: Monday, June 04, 2007 10:06 PM
To: John Sorkin
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] GUI for R running under Linux



RSiteSearch("GUI Linux")

will point you to this message to which an extraordinarily long thread
is
attached:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/56868.html

Oh yes, and to the R-FAQ

:-)

On Mon, 4 Jun 2007, John Sorkin wrote:

> Colleagues,
> I have been using R under windows for some time, and have become 
> accustomed to the GUI that accompanies R. I have recently begun using 
> R under Linux (Fedora), but can not find an equivalent GUI interface;
at a terminal window I enter R Am I missing something? Can I get a GUI
for R (version 2.5) running under Linux?
> Thanks,
> John
>
> John Sorkin M.D., Ph.D.
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology 
> Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) 
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
>
> Confidentiality Statement:
> This email message, including any attachments, is for the 
> so...{{dropped}}
>
> __
> R-help@stat.math.ethz.ch 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.
>

Charles C. Berry(858) 534-2098
  Dept of Family/Preventive
Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0901

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Is it possible to print a data.frame without the row names?

2007-05-24 Thread Bos, Roger
Is it possible to print a data.frame without the row names?  I checked
?data.frame, ?print, ?format and didn't see anything that helped.  In
the example below, I would just like to show the two columns of data and
not the row.names 1:10.
 
> a<-data.frame(1:10, 21:30)
> a
   X1.10 X21.30
1  1 21
2  2 22
3  3 23
4  4 24
5  5 25
6  6 26
7  7 27
8  8 28
9  9 29
1010 30
> row.names(a)<-NULL
> a
   X1.10 X21.30
1  1 21
2  2 22
3  3 23
4  4 24
5  5 25
6  6 26
7  7 27
8  8 28
9  9 29
1010 30
> 
 
Thanks,
 
Roger J. Bos, CFA
  
 

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient. 
**
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] how to change font size in HTML output

2007-05-24 Thread Bos, Roger
I have not been able to figure out how to change the font size for
R2HTML::HTML output.  Or for output from prettyR::htmlize.  If anyone
can give me a couple hints that would be great.
 
Thanks,

Roger J. Bos


** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient. 
**
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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] Is it possible to control R with S+?

2007-05-17 Thread Bos, Roger
The new version of S+ (version 8.0) is supposed to be able to read R
code unmodified.  Insightful is supposedly spending a ton of time making
S+ able to use all R code without modification.  It must be taking them
longer than expected because I though it was supposed to be released by
the second quarter.  I have a S+ license and I haven't heard any
announcement from Insightful.  Anyone have more of an update?

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom.O
Sent: Thursday, May 17, 2007 7:46 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Is it possible to control R with S+?


I am currently using S+, which is my company standard econometric
package, but unfortunately in some areas R has a lot more to offer in
nice functions/libraries. Libraries I would like to use in S+. So I
would like to use the R functions by calling on R from S+. For example
export the data to be used in the R calculation in a temporary txt-file,
and then S+ calls on R to start and read the txt file. R then executes
the function specified and then exports the results in another txt file
which then S+ uploads. Is this possible? Or does anyone have another
solution?

Thanks Tom

--
View this message in context:
http://www.nabble.com/Is-it-possible-to-control-R-with-S%2B--tf3771485.h
tml#a10662666
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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.table opening a website incl Password

2007-05-16 Thread Bos, Roger
Chuck, Roland is trying to read from a web site instead of a ftp site.

I have also gotten this to work:
read.table("ftp://myusr:[EMAIL PROTECTED]/mydir/test.dat")
But when I try to do the same thing from the SEC's ftp site I get an
error, so beyond R, there may be some internet settings that need to be
fiddled with.  Maybe I can tag onto Roland's question and ask for hints
on what configuration options are available?

Thanks,

Roger


 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chuck Cleland
Sent: Wednesday, May 16, 2007 1:08 PM
To: Roland Rau
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] read.table opening a website incl Password

Roland Rau wrote:
> Dear all,
> 
> in the past I have been able to access websites with data directly. 
> For example the following code works nicely
> 
> mydata <- 
> read.table("http://www.lifetable.de/data/MPIDR/POL_2004.txt";,
header=TRUE)
> 
> But what happens if I need a username and password (a different site)?

> How do I do that? Or is it not possible to this in R?
> I tried something like this
> 
> mydata.frame <- 
> read.table("myusr:[EMAIL PROTECTED]/adir/afile.txt")
> 
> but it did not work.
> I'd appreciate any hints.
> My platform is Win32 (and I am actually running R 2.3.1, but I guess
> (hope!) this is not the reason. At least I checked the NEWS file 
> whether any changes appeared since 2.3.1 which could affect this
behavior).

  In what way did it not work?  The following seems to work for me:

read.table("ftp://myusr:[EMAIL PROTECTED]/mydir/test.dat")

> Thanks,
> Roland
> 
> __
> R-help@stat.math.ethz.ch 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.

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] creating a new column

2007-05-08 Thread Bos, Roger
I haven't been following your discussion, but based on your method, the 
following should also work and would be the one-line equivalent:

m$act.surv.time<-pmin(m[,"censoringTime"],m[,"survivalTime"]) 

In other words, you can add a column by just assigning a value to a new column 
name.  You can also use the following syntax:

m$act.surv.time<-pmin(m$"censoringTime",m$"survivalTime") 

I just thought you might want to see different version of accomplishing the 
same thing.

Roger.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of raymond chiruka
Sent: Tuesday, May 08, 2007 12:36 PM
To: Schmitt, Corinna; r
Subject: Re: [R] creating a new column

thanks for the help But l ened up using
  
act.surv.time<-pmin(m[,"censoringTime"],m[,"survivalTime"])
  
m<-cbind(m,act.surv.time)
which seems to work
thanks

  

"Schmitt, Corinna" <[EMAIL PROTECTED]> wrote:  Hallo, I just tried, if my 
solution might be possible for you. Here is the result:

> s=2
>while(s!=0){ n=20
+  m<-matrix(nrow=n,ncol=4)
+  colnames(m)=c("treatmentgrp","strata","censoringTime","survivalTime")
+ for(i in 1:20)  
m[i,]<-c(sample(c(1,2),1,replace=TRUE),sample(c(1,2),1,replace=TRUE),rexp(1,.007),rexp(1,.002))
+ m<-cbind(m,0)
+  m[m[,3]>m[,4],5]<-1
+  colnames(m)[5]<-"censoring"
+   print(m)
+s=s-1
+ }

#bilding a data frame from m

x=data.frame(m)

# adding a column, where nrow(x) = number of row in x and in the # new coulmn 
should stand the entries 1...20.

x=data.frame(x,"actual surv time"=c(1:nrow(x)))

> x
   treatmentgrp strata censoringTime survivalTime censoring actual.surv.time
1 1  2377.486125   1070.66287 01
2 1  2242.468604   1061.30474 02
3 1  2 40.904656 51.88263 03
4 2  2 44.025595590.15317 04
5 1  1253.093279247.32141 15
6 2  2 50.486272257.25016 06
7 1  1337.591250554.05931 07
8 2  2 74.905075873.14563 08
9 1  2 57.196581765.43142 09
101  2370.147307   1646.65368 0   10
111  2152.738532480.12355 0   11
122  2 15.313303139.19791 0   12
131  2 17.205624641.15764 0   13
142  1 81.753924107.02202 0   14
151  2 60.774221665.27500 0   15
162  1  8.712562142.90775 0   16
171  1 54.542722   1904.88060 0   17
182  2 85.626140214.66811 0   18
192  1 31.257923739.96591 0   19
201  1 85.910141306.14860 0   20


See it works! For more information of data frames, see ?data.frame Here are 
some additional examples.


> x[2,6]  # Extraction of special entries: x[2,6]= 2 -> row 2, column 6
[1] 2
> x[2,6]=100  # Changing entires: x[2,6]=100
> x
   treatmentgrp strata censoringTime survivalTime censoring actual.surv.time
1 1  2377.486125   1070.66287 01
2 1  2242.468604   1061.30474 0  100
3 1  2 40.904656 51.88263 03
4 2  2 44.025595590.15317 04
5 1  1253.093279247.32141 15
6 2  2 50.486272257.25016 06
7 1  1337.591250554.05931 07
8 2  2 74.905075873.14563 08
9 1  2 57.196581765.43142 09
101  2370.147307   1646.65368 0   10
111  2152.738532480.12355 0   11
122  2 15.313303139.19791 0   12
131  2 17.205624641.15764 0   13
142  1 81.753924107.02202 0   14
151  2 60.774221665.27500 0   15
162  1  8.712562142.90775 0   16
171  1 54.542722   1904.88060 0   17
182  2 85.626140214.66811 0   18
192  1 31.257923739.96591 0   19

Re: [R] Changing working directory

2007-04-23 Thread Bos, Roger
?setwd
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Walter Paczkowski
Sent: Monday, April 23, 2007 7:41 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Changing working directory

Good morning,

I keep copies my .RData file in different directories for different
projects on Windows XP.  There is an icon on my desktop for each project
so all I have to do is click on the icon to open R for a specific
project, i.e. a specific .RData file.  How do I change to another .RData
file from within R without first closing R?

Thanks,

Walt Paczkowski

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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 R applications from Web

2007-04-19 Thread Bos, Roger
I guess you would have to do all those step for a Internet based portal,
but if you just want to have a web interface on a _Intranet_ portal
where you trust your users, you can use Rpad which is much easier in
that you don't really have to write any code, just do the install
procedure.  There is a Google group for Rpad as well, if you have more
questions about it. 

HTH,

Roger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John McNeil
Sent: Thursday, April 19, 2007 11:42 AM
To: d.sarthi maheshwari
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Accessing R applications from Web

Sarthi,

I have done what you describe using PHP and R on a linux server.  
Basically, you follow these steps:
- Create a form to gather input
- Parse input from the form with PHP into a file that R can read
- Run R commands from PHP with exec().
- Convert the postscript output to an image a web browser can read,
- Use HTML/PHP to format the output with a link to the image

I learned to do this by studying Alfredo Pontillo and Angelo Mineo's
R-php (http://dssm.unipa.it/R-php). Specifically, look at the file
pages/result/index.php  They have done lots of other good stuff in their
project, like filtering dangerous commands - you would not want to let a
user just type in any R code, because they could seriously damage your
server. However, if you keep the R code on the server, and just parse
numeric or string inputs, you can take the simple approach described
above.

You will need to install GhostScript (http://www.gnu.org/software/
ghostscript/ghostscript.html) and ImageMagick (http://
www.imagemagick.org/) on your server for the image conversion

Feel free to email me directly if you have problems

John
http://www.labsynch.com

On Apr 19, 2007, at 2:46 AM, d. sarthi maheshwari wrote:

> Hi
>
> I am trying to provide web interface to my R application. My 
> requirements are simple and can be written down as follows :
>
> 1) User must provide all the input parameters on web interface.
> 2) Based on the input values, R will do some computations.
> 3) Project the numerical results as well as plots as html page to the 
> user on web.
>
> Kindly tell me which package can help me in doing this. Your help 
> would be highly appreciated.
>
> --
> Thanks & Regards
> Sarthi M.
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] clear console

2007-04-05 Thread Bos, Roger

This has been asked previously and I happened to have saved the final
answer:

cls <- function() {
   require(rcom)
   wsh <- comCreateObject("Wscript.Shell")
   comInvoke(wsh, "SendKeys", "\014")
   invisible(wsh)
}
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gabor
Grothendieck
Sent: Thursday, April 05, 2007 7:39 AM
To: Robert McFadden
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] clear console

Check out:

http://tolstoy.newcastle.edu.au/R/help/06/02/21634.html

On 4/5/07, Robert McFadden <[EMAIL PROTECTED]> wrote:
> Hi R Users,
>
> In Windows I can clear console using CTRL-L, but can I do this by 
> certain command in my programs? e.g
>
> for (i in 1:10){
>
> something
>
> clear console
>
> }
>
>
>
> Best,
>
> Rob
>
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Standardization

2007-03-27 Thread Bos, Roger
I am not sure I understand your question, but you may want to have a
look at ?scale.  It might get you started.

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sergio Della
Franca
Sent: Tuesday, March 27, 2007 10:52 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Standardization

Dear R-Helpers,

I want to perform a stadardiazation of a variable with mehtod range.

How can i achve this results?


Thank you in advance.


Sergio Della Franca

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Cannot allocate vector size of... ?

2007-03-15 Thread Bos, Roger
Yes, your error is due to running out of memory.  This is probably one
of the most frequent questions asked here, so if you search again you
can find a lot of advice on how to get around it.  

As you learn more about R programming you will learn how to store data
more efficiently, rm() to remove variables you no longer need, gc() to
garbage collect and free up memory.  Try to open only the files you
need, do some of the analysis, then get rid of everything you don't
need, then do some more analysis.

Thanks,

Roger 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wingfield, Jerad
G.
Sent: Thursday, March 15, 2007 12:27 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Cannot allocate vector size of... ?

Hello all, 

 

I've been working with R & Fridolin Wild's lsa package a bit over the
past few months, but I'm still pretty much a novice. I have a lot of
files that I want to use to create a semantic space. When I begin to run
the initial textmatrix( ), it runs for about 3-4 hours and eventually
gives me an error. It's always "ERROR: cannot allocate vector size of
xxx Kb". I imagine this might be my computer running out of memory, but
I'm sure. So I thought I would send this to community at large for any
help/thoughts.

 

I search the archives and didn't really find anything that specifically
speaks to my situation. So I guess I have s few questions. First, is
this actually an issue with the machine running out of memory? If not,
what might be the cause for the error? If so, is there a way to minimize
the amount of memory used by the vector data structures (e.g., Berkeley
DB)?

 

Thanks,

Gabe Wingfield

IT and Program Specialist I

Center for Applied Social Research

University of Oklahoma

2 Partners Place

3100 Monitor, Suite 100

Norman, OK 73072


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Occasional problems with starting batch mode

2007-03-15 Thread Bos, Roger
I use a windows Server 2003 machine to run R code in batch mode every
night using the following command:

"F:\Program Files\R\R-2.4.1pat\bin\R.exe" CMD BATCH --vanilla --slave
"batch_master_dr.R"

This produces an output file, of which the first three lines look like
this:

Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading required package: R2HTML

99% of the time this works great.  Every once in a while, I get the
following error message instead and it does not run any of my subsequent
code:

Loading required package: tcltk
Loading Tcl/Tk interface ... Unable to register TkTopLevel class

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

Does anyone have any clue where I should look to fix this problem?

Thanks,

Roger
   
version.string R version 2.4.1 Patched (2007-02-04 r40647)

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Freeman-Tukey arcsine transformation

2007-03-13 Thread Bos, Roger
I'm curious what this transformation does, but I am not curious enough to pay 
$14 to find out.  Someone once told me that the arcsine was a good way to 
transform data and make it more 'normal'.  I am wondering if this is an 
improved method.  Anyone know of a free reference?

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard
Sent: Tuesday, March 13, 2007 10:58 AM
To: Inman, Brant A. M.D.
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Freeman-Tukey arcsine transformation

Inman, Brant A. M.D. wrote:
> R-Experts:
>
> Does anyone know if there are R functions to perform the Freeman-Tukey 
> double arcsine transformation and then backtransform it?
>
>   

Well, if not, both are given by explicit formulas, so it shouldn't take long to 
implement, cf.:

The Teacher's Corner


*The Inverse of the Freeman-Tukey Double Arcsine Transformation

*



John J. Miller 


/The American Statistician/, Vol. 32, No. 4. (Nov., 1978),
p. 138. 


Stable URL:

http://links.jstor.org/sici?sici=0003-1305%28197811%2932%3A4%3C138%3ATIOTFD%3E2.0.CO%3B2-Z



  Abstract

A formula for the inverse of the Freeman-Tukey double arcsine
transformation is derived. This formula is useful when
expressing means of double arcsines as retransformed
proportions. When the mean is taken from original proportions
involving different n's, it is suggested that the harmonic mean
of the n's be used in the inversion formula.



> Thanks,
>
> Brant Inman
> Mayo Clinic
>
> __
> R-help@stat.math.ethz.ch 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.
>   


-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Memory Limits in Ubuntu Linux

2007-03-07 Thread Bos, Roger
David,

Here is what my boot.ini file looks like:

[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /noexecute=optin /fastdetect /3gb

The easiest way to edit the boot.ini file is My
Computer/Properties/Advanced/Startup & Recovery/Edit; add the /3gb and
reboot.  I know that a messed up boot.ini file can be a real pain.  I
posted what mine looks like so you can compare yours, but I wouldn't
suggest making any changes to your boot.ini except at the very end of
the last line.

HTH,

Roger


 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 07, 2007 12:27 PM
To: Bos, Roger
Cc: r-help@stat.math.ethz.ch
Subject: RE: [R] Memory Limits in Ubuntu Linux

Thanks for the tips, Roger.

fyi: When I added /3GB to the boot.ini, the resulting desktop was
incomplete and locked - no chance to try starting R. Searching the web
lead me to believe that this was possibly a dead-end, so I abandoned
this effort. Any hints on getting this to work, anyone? 



On 7 Mar 2007 at 8:26, Bos, Roger wrote:

> David,
> 
> I wouldn't give up on windows so fast.  Many people have gotten the 
> 3Gb switch to work. One used to have to modify the header of the 
> Rgui.exe program to use the switch, but now the binary comes ready for

> that, so its really quite easy.  I would like to hear more about why 
> its not working for you.
> 
> As for Linux, I use FC5 for which there is a 64-bit binary.  But there

> are also 64-bit binaries for other distros.  The 32-bit and 64-bit 
> binaries are in different directories, so you should have no trouble 
> telling them apart.
> 
> I have heard good things about Ubuntu--mainly that its very easy to 
> use--but FC5 has been pretty easy to learn too and I use the KDE 
> desktop which gives me Kate as a text editor.  You can open a terminal

> window in Kate to run R and set up a key like F10 to send the code 
> from the editor to R.  Its not quite as good as my Windows setup with 
> Tinn-R, but almost as good.
> 
> Thanks,
> 
> Roger
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 06, 2007 5:37 PM
> To: Bos, Roger
> Subject: RE: [R] Memory Limits in Ubuntu Linux
> 
> Thanks for your prompt reply!
> 
> The windows 3GB switch is quite problematic - it was not useable on my

> machine, and there are comments about these problems around the net.
> Thus, on to Linux. My machine has 4Gig, and some megabytes are grabbed

> by my Asus motherboard, leaving some 3.56 Gig.
> 
> So if I understand your suggestion, try the 64-bit version of Ubuntu 
> (based on Debian but I had better luck with the video part of the
> install) and then use the corresponding image from CRAN. My fear is 
> that the CRAN Ubuntu version might be 32-bit - any idea how to find 
> out before I embark on another install? Which Linux do you have - you 
> described some significant success with getting large jobs to run.
> 
> And yes, I've worked hard to save memory by tweaking the code.
> 
> 
> Thanks again.
> 
> 
> On 6 Mar 2007 at 16:51, Bos, Roger wrote:
> 
> > David,
> > 
> > First of all, under Windows you can get about 3GB available to R by 
> > using the /3Gb switch in your boot.ini file, assuming you have 4Gb 
> > of memory installed on your windows machine.  Using that method, I 
> > have seen the memory using of my R process get as big as 2.7Gb in 
> > task manager.  What's important, of course, is contiguous space, as 
> > you mentioned.  There, you may want to check your code closely and 
> > make sure that its memory usage is as efficient as possible and you 
> > are storing the minimal amount you need for each run.  If you don't 
> > need an object for a while consider writing it to disk and reading 
> > it back
> in later.
> > 
> > Second, AFAIK to get any benefit from more memory is Linux you have 
> > to
> 
> > go to the 64bit version.  I am a Linux newbie too, so I choose to 
> > use one of the pre-compiled binaries available on CRAN.  In other 
> > words, you shouldn't have to compile anything yourself.  How much 
> > memory do you have on your Linux box?  I have 16Gb and I know I have

> > ran stuff that wouldn't run on my 4Gb windows box.
> > 
> > HTH,
> > 
> > Roger
> > 
> > 
> > 
> > 
> > 
> >  
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of 
> > [EMAIL PROTECTED]
> > Sent: Tuesday, March 0

Re: [R] Memory Limits in Ubuntu Linux

2007-03-07 Thread Bos, Roger
David,

I wouldn't give up on windows so fast.  Many people have gotten the 3Gb
switch to work. One used to have to modify the header of the Rgui.exe
program to use the switch, but now the binary comes ready for that, so
its really quite easy.  I would like to hear more about why its not
working for you.

As for Linux, I use FC5 for which there is a 64-bit binary.  But there
are also 64-bit binaries for other distros.  The 32-bit and 64-bit
binaries are in different directories, so you should have no trouble
telling them apart.  

I have heard good things about Ubuntu--mainly that its very easy to
use--but FC5 has been pretty easy to learn too and I use the KDE desktop
which gives me Kate as a text editor.  You can open a terminal window in
Kate to run R and set up a key like F10 to send the code from the editor
to R.  Its not quite as good as my Windows setup with Tinn-R, but almost
as good.

Thanks,

Roger


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 06, 2007 5:37 PM
To: Bos, Roger
Subject: RE: [R] Memory Limits in Ubuntu Linux

Thanks for your prompt reply!

The windows 3GB switch is quite problematic - it was not useable on my
machine, and there are comments about these problems around the net.
Thus, on to Linux. My machine has 4Gig, and some megabytes are grabbed
by my Asus motherboard, leaving some 3.56 Gig. 

So if I understand your suggestion, try the 64-bit version of Ubuntu
(based on Debian but I had better luck with the video part of the
install) and then use the corresponding image from CRAN. My fear is that
the CRAN Ubuntu version might be 32-bit - any idea how to find out
before I embark on another install? Which Linux do you have - you
described some significant success with getting large jobs to run.

And yes, I've worked hard to save memory by tweaking the code.


Thanks again.


On 6 Mar 2007 at 16:51, Bos, Roger wrote:

> David,
> 
> First of all, under Windows you can get about 3GB available to R by 
> using the /3Gb switch in your boot.ini file, assuming you have 4Gb of 
> memory installed on your windows machine.  Using that method, I have 
> seen the memory using of my R process get as big as 2.7Gb in task 
> manager.  What's important, of course, is contiguous space, as you 
> mentioned.  There, you may want to check your code closely and make 
> sure that its memory usage is as efficient as possible and you are 
> storing the minimal amount you need for each run.  If you don't need 
> an object for a while consider writing it to disk and reading it back
in later.
> 
> Second, AFAIK to get any benefit from more memory is Linux you have to

> go to the 64bit version.  I am a Linux newbie too, so I choose to use 
> one of the pre-compiled binaries available on CRAN.  In other words, 
> you shouldn't have to compile anything yourself.  How much memory do 
> you have on your Linux box?  I have 16Gb and I know I have ran stuff 
> that wouldn't run on my 4Gb windows box.
> 
> HTH,
> 
> Roger
> 
> 
> 
> 
> 
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Tuesday, March 06, 2007 3:44 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Memory Limits in Ubuntu Linux
> 
> I am an R user trying to get around the 2Gig memory limit in Windows, 
> so here I am days later with a working Ubuntu, and R under Ubuntu. But

> - the memory problems seem worse than ever. R code that worked under 
> windows fails, unable to allocate memory.
> 
> Searching around the web, it appears that the problem may be the 
> ability to find contguous memory for my big vectors, but a fresh boot 
> of Ubuntu does not help either.
> 
> Which way to go?
> 
> 1) Try to install 64-bit version for bigger address space. Would this 
> help? Is this workable for my Athlon 64 Dual-core? (the live cd seems 
> to work but I never got it to boot after a disk install, but then the 
> 386 version was no better until I learned more about Grub...I could 
> try again if this might solve the
> problem)
> 
> 2) Recompile R to get bigger memory capability? (I'll have to 
> cross-post to some R forums too) This will be a challenge for a Linux 
> newbie...like me.
> 
> 3) Any other suggestions? My goal is to create a bigger neural network

> than fits in my Windows R version.
> --
> David Katz
>  www.davidkatzconsulting.com
>541 482-1137
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch 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

Re: [R] [friday topic]: what exactly is statistical computing

2007-03-02 Thread Bos, Roger
This means it comes with substantial statistical routines built-in.  You
could just as well use VBA or Java for your programming language, but
with those you would have to write pretty much any stat routine you
need.  With R, since it is a 'statistical computing' language, you know
that most of what you need has already been programmed, tested(?), and
is ready to use. 

I have seen you on this list for a while.  You already know all this.  I
am not sure why you are asking this question.

Roger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wensui Liu
Sent: Friday, March 02, 2007 9:43 AM
To: r-help@stat.math.ethz.ch
Subject: [R] [friday topic]: what exactly is statistical computing

Dear List,
on www.r-project.org, the title says 'The R Project for Statistical
Computing'.

but what exactly is the definition of statistical computing?

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] FTP download from ftp.sec.gov

2007-03-02 Thread Bos, Roger
Thanks to everyone for trying it out.  I guess the part that surprises me is 
that I currently download a file from a different FTP site every night with no 
problem.  I have also downloaded from web sites with no problem.  Buy now that 
I know the R code is okay I can look into other fixes for the problems.  Thanks 
again, Roger


-Original Message-
From: Peter Dalgaard [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 02, 2007 3:17 AM
To: Gabor Grothendieck
Cc: Bos, Roger; r-help@stat.math.ethz.ch
Subject: Re: [R] FTP download from ftp.sec.gov

Gabor Grothendieck wrote:
> On Windows XP it worked for me on both 2.4.1 and 2.5.0.  I did notice 
> that on 2.4.1 it says "using Synchronous WinInet calls" but does not 
> say this on 2.5.0.  See below for the two transcripts.
>
>   
>> ftp <- "ftp://anonymous:[EMAIL PROTECTED]/edgar/full-index/company.idx"
>> download.file(url=ftp, destfile="test.txt")
>> 
> trying URL 'ftp://anonymous:[EMAIL PROTECTED]/edgar/full-index/company.idx'
> using Synchronous WinInet calls
> opened URL
> downloaded 33930Kb
>   
This appears to be highly system dependent. Works for me on my home machine 
using Fedora 6, but not on the office machine running SUSE 10. I wouldn't be 
surprised if firewall configuration plays a part.

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907



** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] FTP download from ftp.sec.gov

2007-03-01 Thread Bos, Roger
All,

I have managed to download files from web sites and ftp sites using R,
so just for fun I tried to do so from the SEC's ftp site using the
following code:

ftp <- "ftp://anonymous:[EMAIL PROTECTED]/edgar/full-index/company.idx"
download.file(url=ftp, destfile="test.txt")

And it does not work.  R says it cannot open the URL. If I paste the ftp
part into IE it works fine.  Its not critical, but I would be interested
if anything figures out how to make it work.  (I know R is probably not
the best language for FTP download and text parsing, but that's another
topic).

Thanks, Roger


** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] How to print a double quote

2007-02-22 Thread Bos, Roger
Can anyone tell me how to get R to include a double quote in the middle
of a character string?  

For example, the following code is close:

> fnd<-"Open fnd 'test'"
>cat(fnd)
Open fnd 'test'>
>

But instead of Open fnd 'test' I need: Open fnd "test".  Difference
seems minor, but I am writing batch files for another program to read in
and it has to have the double quotes to work.  

Thanks in advance for any help or ideas,

Roger

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Handling large calculations and memory

2007-02-12 Thread Bos, Roger
We don't know how much memory your computer has and how exactly you plan
to generate these samples, so no one can really help you all that much.
Its best for you to just code up what you want to do and find out if you
get any memory errors or not.  If you run into trouble and you can show
us exactly what you are doing, I am sure that at that point many people
will be very helpful.

Thanks,

Roger

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrick Leoni
Sent: Monday, February 12, 2007 11:18 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Handling large calculations and memory

Dear All,

I am planning to run a Monte-Carlo experiment which involves to do
roughly 100.000 times the following

1- Generating a sample of, say, 50.000 numbers from an ARMA or GARCH
2- Doing some regressions on the series
3- On each regression storing one special value from the results into a
sequence that will be analyzed later.

The experiment is calculation-intensive, and I suspect some problems of
memory management. I would appreciate some advices for the experiment to
run smoothly in terms of memory.

Many Thanks,

Patrick Leoni

Department of Economics and Finance
NUI at Maynooth

Maynooth, Co. Kildare
Republic of Ireland

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Linking R with Microsoft SQL Server / Client

2007-02-12 Thread Bos, Roger
Yes, you can use RODBC to connect to MS SQL.  You can query, issue
commands, and save to the db from R and it works very well (at least for
me).

For example, with a database named xf, create an ODBC data source and
then link open a connection in R:
library(RODBC)
xf <- odbcConnect("xf", username, password)
Then you can issue commands such as those below:

go <- sqlQuery(xf, "alter table roger_test alter column name varchar(3)
NOT NULL")
go <- sqlQuery(xf, "select * from roger_test")
sqlSave(xf, val, tablename="roger_test", append=TRUE, rownames=FALSE)

HTH,

Roger
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ONKELINX, Thierry
Sent: Monday, February 12, 2007 9:36 AM
To: Steve Friedman; r-help@stat.math.ethz.ch
Subject: Re: [R] Linking R with Microsoft SQL Server / Client

Dear Steve,

Reading the data shouldn't be a problem with RODBC. I've been doing that
plenty of times. I'm not sure about writing, but I suppose you probably
will.

Cheers,

Thierry




ir. Thierry Onkelinx

Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature
and Forest

Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance

Gaverstraat 4

9500 Geraardsbergen

Belgium

tel. + 32 54/436 185

[EMAIL PROTECTED]

www.inbo.be 

 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt

A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney


-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Steve Friedman
Verzonden: maandag 12 februari 2007 15:15
Aan: r-help@stat.math.ethz.ch
Onderwerp: [R] Linking R with Microsoft SQL Server / Client

Hello

My colleagues and I have recently established a large database (40
tables each with greater than 15 variables) in Microsoft's SQL Server
2000.
Currently we are accessing this database via SQL client running an
Windows
XP.   Our objectives are many fold including running SQL applications,
outputting results to ARC/INFO IMS, production of summarizing tables -
graphs and web interfaces for user accessibility.

The project is still very much in a design phase.  I'm interested in
knowing if we can link R directly to the database  as it is either
stored in SQL Server, or SQL Client, or if we are better off keeping it
simple and extracting ascii (csv)  files from SQL server prior to
processing summarizing and model development.

Any insight provided will be greatly appreciated.

Steve

--
Steve Friedman
Computational Ecology and Visualization Laboratory Michigan State
University

Envisioning Ecosystem Decisions

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] memory problem

2007-01-07 Thread Bos, Roger
Doing so will also require using the Linux version of R as there is no
open source 64bit compiler to create a windows version (so I am told).
Anyway, memory is getting cheap now.  I got a 64bit machine from Dell
with 16Gb od DDR2 for around $4000.  Good luck.
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges
Sent: Sunday, January 07, 2007 3:42 AM
To: Zoltan Kmetty
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] memory problem



Zoltan Kmetty wrote:
> Hi!
> 
> I had some memory problem with R - hope somebody could tell me a
solution.
> 
> I work with very large datasets, but R cannot allocate enough memoty 
> to handle these datasets.
> 
> I want work a matrix with row= 100 000 000 and column=10
> 
> A know this is 1 milliard cases, but i thought R could handle it 
> (other commercial software like spss could do), but R wrote out 
> everytime: not enough memory..
> 
> any good idea?


Buy a machine that has at least 8Gb (better 16Gb) of RAM and proceed ...

Uwe Ligges



> Thanks, Zoltan
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] persistant: Matlab->R

2006-12-15 Thread Bos, Roger
To the extent that 'persistent' means 'global', global in R is: <<-, so
r <- 1 is local scope and r <<- 1 is global scope.

HTH, 

Roger
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Charles C. Berry
Sent: Thursday, December 14, 2006 3:34 PM
To: Bernard Gregory
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] persistant: Matlab->R


It is just my guess that the 'open.account' example in 10.7 Scope of
Introduciton to R is what you are after.

If I understand what 'presistent' means, the 'total' in the example is
approximately equal to a persistent variable.


On Thu, 14 Dec 2006, Bernard Gregory wrote:

> Dear list members,
>
> Could anyone tell me if there is an equivalent of the Matlab
declaration 'persistant' in R?
>
> Thank you very much,
>
> Bernard Gregorry.
> (Matlaber converted to R).
>
>
> -
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@stat.math.ethz.ch 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.
>

Charles C. Berry(858) 534-2098
  Dept of Family/Preventive
Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0717

__
R-help@stat.math.ethz.ch 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.

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] escape character to get " printed in output

2006-11-30 Thread Bos, Roger
Gabor & Marc,

Yes, you are right.  Thanks for clarifying that for me.  I should have
tested it fully before hand.

Thanks,

Roger 

-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 30, 2006 3:12 PM
To: roger bos
Cc: RHelp
Subject: Re: [R] escape character to get " printed in output

It did work.  That's how print represents strings.

Try:

> cat("hello \"hello\" hello")
hello "hello" hello>
> strsplit("hello \"hello\" hello", "")[[1]]
 [1] "h"  "e"  "l"  "l"  "o"  " "  "\"" "h"  "e"  "l"  "l"  "o"  "\"" "
"  "h"
[16] "e"  "l"  "l"  "o"

On 11/30/06, roger bos <[EMAIL PROTECTED]> wrote:
> I want to use R to run dos commands (either by create batch files or 
> using shell())and I need to write double quotes on the file (or shell 
> command).  As an easier example, lets take:
>
> > print("hello 'hello' hello")
> [1] "hello 'hello' hello"
>
> Lets say instead of the above, I wanted:
> "hello "hello" hello"
> If possible, how would I do that?
>
> I understand that \ is an escape character, so I tried:
>
> > print("hello \"hello\" hello")
> [1] "hello \"hello\" hello"
>
> But that did not work.
>
> TIA, Roger
>
> __
> R-help@stat.math.ethz.ch 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.
>

** * 
This message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
R-help@stat.math.ethz.ch 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] Please help using SQL with R & SQL Server

2004-11-16 Thread Bos, Roger
I cannot get a database connection in R to my MS SQL Server database.  In
S-Plus 6.2 I have used the following successfully:

rawdata <- importData(type="DIRECT-SQL", user="xfl2",
password="xfl2", server="rinnycs0059", database="xf", table="",
sqlQuery="select * from testTbl")

In R I have tried both DBI and RSQLite, but have not had any luck.  It
always says cannot find driver.  All the examples use My SQL or some other
program.  I only have SQL Server by Microsoft.  I know R might not have a
native driver, but I have tried "ODBC", too, without luck.  If anyone can
give me an example and hints on finding the driver that would be great!
Thanks.  Roger

** * This 
message is for the named person's use only. It may 
contain confidential, proprietary or legally privileged 
information. No right to confidential or privileged treatment 
of this message is waived or lost by any error in 
transmission. If you have received this message in error, 
please immediately notify the sender by e-mail, 
delete the message and all copies from your system and destroy 
any hard copies. You must not, directly or indirectly, use, 
disclose, distribute, print or copy any part of this message 
if you are not the intended recipient.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html