Re: [R] read.table with data in specific formats

2006-05-18 Thread Xiao Liu
read.table segments rows by separators, not by format of entry.

Suppose your data.txt is like:
1.00 2.01 3.003
4.10 5.22 6.333
7.22 8.88 9.99

Then
 read.table(data.txt, sep =  )

Best Regards
XiaoQuoting YIHSU CHEN [EMAIL PROTECTED]:

 Dear R Users

  Does anyone know how to read a text with a specific format?   I know
 that has to do with two functions: read.table and sprintf but not sure
 how to put them together.   Say that I have a text file called
 data.txt, and I would to read it according with  %.14f %.10f %2.5f,
 which includes three columns.

 Thank you very much.


 Yihsu Chen
 The Johns Hopkins University

 __
 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



***
Xiao Liu
Stanford University Medical Center
Department of Developmental Biology
279 Campus Drive
Stanford, CA 94305-5329
(650)725-7612(L)

__
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


[R] R/Splus--Perl Interface ssh

2005-04-27 Thread XIAO LIU
Hi:

I'm using RSPerl_0.6-3 calling R from Perl under UNIX system. My perl programs 
with the RSPerl work well in my computer.  If submitting these programs to a 
UNIX system by 'ssh' or to GNQS system by 'qsub', these programs do not work 
even though both systems can run R.  Details are following.  Any suggestion 
will be highly appreciated.

Xiao

My perl program 'tt.pl'
   #!/usr/bin/perl -w
   use R;
   use RReferences;
   R::initR(--silent);
   R::setDebug(0);
   R::library(RSPerl);
   @t = R::call(min, (1,2));

I have a script 'doRSPerltt' for the perl program
   #!/bin/csh
   setenv LD_LIBRARY_PATH /usr/lib/R/lib
   setenv R_HOME /usr/lib/R
   perl -I/usr/lib/R/site-library/RSPerl/examples/../share/blib/arch 
-I/usr/lib/R/site-library/RSPerl/examples/../share/blib/lib 
-I/usr/lib/R/site-library/RSPerl/scripts t
t.pl

I used ssh to submit my job to machine 'queen'
   ssh queen 'cd /nfs/fs/clarke/xiaoliu  ./doRSPerltt'
An error message returns
   Fatal error: you must specify `--save', `--no-save' or `--vanilla'

If using 'qsub' to submit my job to a GNQS system
   qsub
   doRSPerltt
An error message returns
   Warning: no access to tty (Bad file descriptor).
   Thus no job control in this shell.
   Fatal error: you must specify `--save', `--no-save' or `--vanilla'


XIAO LIU wrote:
 Hi:
 
 I'm using RSPerl_0.6-3 calling R from Perl under UNIX system.  My perl 
 programs with the RSPerl work well in my computer.  However, if submitting to 
 GNQS system, these programs do not work.  It requires defining '--vanilla'.  
 Can anyone tell me what I should do? 
 

Are you certain this has something to do with RSPerl.
Specifically, have you tried running an R program on a GNQS system
and ensuring that works without --vanilla (as part of the command line 
arguments)?

If it is only for RSPerl, perhaps you would do well to post the
error message that is generated.


 Thank in advance
 
 Xiao
 
 __
 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

-- 
Duncan Temple Lang[EMAIL PROTECTED]
Department of Statistics  work:  (530) 752-4782
371 Kerr Hall fax:   (530) 752-7099
One Shields Ave.
University of California at Davis
Davis, CA 95616, USA



__
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

[R] R/Splus--Perl Interface

2005-04-25 Thread XIAO LIU
Hi:

I'm using RSPerl_0.6-3 calling R from Perl under UNIX system.  My perl programs 
with the RSPerl work well in my computer.  However, if submitting to GNQS 
system, these programs do not work.  It requires defining '--vanilla'.  Can 
anyone tell me what I should do? 

Thank in advance

Xiao

__
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


Re: [R] Varying x-axes ticks

2004-12-30 Thread XIAO LIU
 x - c(0:24, (25:104-24)/(104-24)*25+24)
y - 0.5*(104-104:0)/104
plot(x,y, xaxt = n)
 axis(1, at = 0:49, labels = c(0:24, (25:49-24)*(104-24)/25+24))


- Original Message -
From: Anthony Gichangi [EMAIL PROTECTED]
Date: Tuesday, December 28, 2004 12:57 pm
Subject: [R] Varying  x-axes ticks

 Dear R Users,
 I have the following situations to plot. 
 
 x-values (times)  :  range from 0 to 104   (in weeks)
 y-values (hazards)  :  range from 0 to  0.5
 
 Now I want to make a plot of time versus hazards such
 that  in the time axis (i.e x-axis) the values 0-24 occupies
 half of the axis and the values 25-104 ocupies the rest
 of the axis. 
 
 In other words I want to emphasize on first 24 weeks so that
 the features of the hazard are more pronounced for these 
 values.
 
 Anybody with ideas how I can accomplish this ?
 
 
 Thanks in advance
 
 
 With kind regards
 
 Anthony
 
 
 
   [[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

__
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


[R] package.skeleton()

2004-12-17 Thread XIAO LIU
Hi, R people:

I generated a package using package.skeleton().  But I can not load it using 
library().

 package.skeleton(RDIPcor, list = c(ROCAUC.i, cor.i), path = 
 /home/xiao)
Creating directories ...
Creating DESCRIPTION ...
Creating READMEs ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in /home/xiao/RDIPcor/README 
 library(RDIPcor, lib.loc = /home/xiao)
Error in testRversion(descfields) : This package has not been installed properly
 See the Note in ?library

My R1.8.0 is under LINUX.

Thanks in advance

Xiao

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


[R] direction of axes of plot

2004-06-27 Thread XIAO LIU
R users:

I want X-Y plotting with axes in reverse direction such as (0, -1, -2, -3, ).  How 
can I do it?

Thanks in advance

Xiao

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


[R] Perl--R interface

2004-06-23 Thread XIAO LIU
R users:

My R is 1.8.1 in Linux.  How can I call R in Perl process? And call Perl from R?

Thanks

Xiao

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


[R] Killed

2004-04-11 Thread XIAO LIU
I tried bootstrap on a sample of 13,000 observations:

It works fine when R = 200:
boot(data, cor.i, R = 200)

However, when R = 400, I got:
boot(data, cor.i, R = 400)
Killed

Any suggestions/ideas? 

Thank you very much

Xiao

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


Re: [R] abline

2004-03-08 Thread XIAO LIU
 x - c(1,2,3,6,4,8,4,7)
 y - c(3,2,7,4,5,4,5,6)
 h - c(3,5,7)
 plot(x,y)
 abline(y=h)

abline(h=h) will work.

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


[R] Apply a function to each cell of a ragged matrix

2004-02-17 Thread XIAO LIU
R-Helpers:

There are a matrix x and a factor f.  nrow(x) == length(f), e.g.:
x - matrix(1:6, nrow = 3)
f - factor(c(daytime, daytime, night))

I want the sum of all elements of rows of x for each corresponding level in factor 
f,
In this case, I want output like:
daytime [1] x[1,1]+x[2,1]+x[1,2]+x[2,2]
night   [2] x[3,1]+x[3,2]

But, tapply(x,f,sum) or by(x,f,sum) do not work.  What other functions can I use?

Thank you very much

Xiao

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


[R] Kurtosis function

2003-12-01 Thread XIAO LIU
Hi,

Which R package contains Kurtosis function?  Where can I get it?

Thank you very much.

Xiao

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help