Re: [R] Hello,

2008-08-12 Thread Richard Pearson

Kiran

exonmap is a bioconductor package - I'd suggest trying the bioconductor mailing 
list. Also, you're more likely to get a response if you include an informative 
subject line.


Regards

Richard.


Kiran Annaiah wrote:

Hello,

A newbie to R. I am trying to use the exonmap package in R. 
According to the docs, the xmapDatabase() command should read the

config file with all the connection parameters and connect to the DB.
But i get the error shown below


xmapDatabase(Human)
Error in mysqlNewConnection(dbDriver(drv), ...) : 
  RS-DBI driver: (could not connect [EMAIL PROTECTED] on

dbname NA
Error:Access denied for user 'cagadmin'@'cdev.cag.chop.edu' to database
'NA'
)



when i connect to db using dbConnect() it works fine.
conn-dbConnect(drv=MySQL,username=cagadmin )


Anybody who can shed some light on whats going on here?

thank you all

kiran



Kiran Annaiah
Center for Applied Genomics Informatics
Children's Hospital of Philadelphia
267-426-9355

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] rpart confidence intervals?

2008-07-23 Thread Richard Pearson

Hi RichardP

I guess you'll increase your chances of a response if you include some 
affiliation info. This could also avoid getting you confused with other people - 
I thought for a minute I'd been sleep-emailing :-)


Cheers

A N Other RichardP

RichardP wrote:

hi,

I am using rpart with a continuous response variable. Is there a way to
extract 95% confidence intervals for the predicted mean at each node?

cheers.


--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Error in installing packages

2008-07-22 Thread Richard Pearson

Lazarus

I'm not sure your first problem is actually a problem - it looks to me like the 
epicalc package installed OK. Have you tried using epicalc?


I'm sure your problem 2 is not an R problem, so don't know whether you'll get 
any help on this list.


Best wishes

Richard.


Lazarus Mramba wrote:

Dear R Users;

I am an R user who has recently bought a new laptop;Toshiba Satellite
U405 running on both Windows Vista and Ubuntu.

I have problems on the wondows vista when installing packages. The
argument 'lib' is missing.  How do i solve this problem?


Illustration:


install.packages(epicalc)

Warning in install.packages(epicalc) :
  argument 'lib' is missing: using
'C:\Users\lazurus\Documents/R/win-library/2.7'

--- Please select a CRAN mirror for use in this session ---
trying URL
'http://cran.za.r-project.org/bin/windows/contrib/2.7/epicalc_2.7.1.2.zip'
Content type 'application/zip' length 629215 bytes (614 Kb)
opened URL
downloaded 614 Kb

package 'epicalc' successfully unpacked and MD5 sums checked

The downloaded packages are in
   
C:\Users\lazurus\AppData\Local\Temp\RtmpMrOxin\downloaded_packages

updating HTML package descriptions

## problem 2 is about downloading R without internet connection
I have failed to get internet working under ubuntu for both wireless 
LAN and Ethernet cable and therefore i cannot download R from the net.

Both wireless and ethernet are not detected at all leave alone
connecting to the internet. I am using Atheros AR5007EG wireless network
adapter, Marvel Yukon 88E8040T PCI-E Fat Ethernrt Controller.
Internet works fine under the windows Vista system but not on the
Ubuntu side
Anyhelp will be appreciated.



Kind regards,
Lazarus Mramba
Junior Statistician
P.O Box 986, 80108,
Kilifi, Kenya
Mobile No. +254721292370
Tel: +254 41 522063
Tel: +254 41 522390
(office extension : 419)

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Creation of png=problems

2008-07-21 Thread Richard Pearson

Romain

You might get a fuller answer from others, but one thing you could try is using 
bitmap() rather than png().


Cheers

Richard.


Romain wrote:
Hi everybody, 


I am currently working with R and I would like to create jpeg graphs with it.
I am working on Windows and Unix but I would like to be able to create graphs 
(jpeg, png, bitmap...) under Unix.

I am working on Solaris version 8. The documentation for R states that the 
latest version of or R known to compile on Solaris 8 is version 2.6.2. I have 
been able to compile and install R version 2.6.2. under Unix. I also installed 
Hmisc package needed by my script.

The problem is that when I launch my script to create graphs from text files I 
get this error :


Create_Graph(File)
Error in X11(paste(png::, filename, sep = ), width, height, pointsize,  : 
  unable to start device PNG

In addition: Warning message:
In png(paste(PATH, /, filename, sep = ), 800, 600) :
  no png support in this version of R

The thing is that I have tried to run my script under Windows with the same 
version (2.6.2) and everything is going well and the graph are created.

Is it because (under Unix):

capabilities()
jpeg  pngtcltk  X11 http/ftp  sockets   libxml fifo 
   FALSEFALSEFALSE TRUE TRUE TRUE TRUE TRUE


If so, could someone explain to me how to change these capabilities in order to 
ba able to set them TRUE.

I have also tried with other version of R but the error is the same one.

If you have any other ideas about why it doesn't work I would be very grateful.

The fact is that I have created a programm under Unix to make automatic the 
creation of the text files and I would like to create automatically the 
correspondant graphs.

I hope someone will be able to help me.

Thanks for your time.

Have a good day.

R.



La route des vacances en quelques clics grâce à Voila ! 
http://itineraire.voila.fr/itineraire.html

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


--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Subsetting an array by a vector of dimensions

2008-07-11 Thread Richard Pearson

Hi

Is it possible to subset an n-dimensional array by a vector of n dimensions? 
E.g. assume I have


x - array(1:24, dim=2:4)
x[1,1,2]

[1] 7

dims - c(1,1,2)


I would like a function that I can supply x and dims as parameters to, and have 
it return 7. Also, I would like to do something like:


x[1,1,]

[1]  1  7 13 19

dims2- c(1,1,NA)


And have a function of x and dims2 that gives me back [1]  1  7 13 19

Does such a thing exist?

Thanks

Richard


--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Subsetting an array by a vector of dimensions

2008-07-11 Thread Richard Pearson

My understanding of matrix subscripting is that this can be used to access 
arbitrary elements from an array and return them as a vector, but I don't 
understand how that helps me here. I've now written a function that seems to do 
what I originally wanted, but I've also realised I want to do assignment too. I 
need to read up more on writing assignment functions to do this. However, I'm 
thinking that someone has already solved this, in a far more elegant way than 
my hacking :-). Here's my function for anyone interested:


subsetArray - function(x, subset) {

+   subsetString - paste(subset, collapse=,)
+   subsetString - gsub(NA,,subsetString)
+   evalString - paste(expression(x), [, subsetString, ])
+   eval(parse(text=evalString))
+ }

x - array(1:24, dim=2:4)
subsetArray(x, c(1,1,2))

[1] 7

subsetArray(x, c(1,NA,2))

[1]  7  9 11

subsetArray(x, c(1,NA,NA))

[,1] [,2] [,3] [,4]
[1,]17   13   19
[2,]39   15   21
[3,]5   11   17   23


subsetArray(x, c(1,1,2)) - 25
Error in subsetArray(x, c(1, 1, 2)) - 25 : 
 could not find function subsetArray-


Best wishes

Richard.


Patrick Burns wrote:

I think you are looking for subscripting with a
matrix:

x[cbind(1,1,2)]

See, for instance, the subscripting section of chapter 1
of S Poetry.


Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

Richard Pearson wrote:

Hi

Is it possible to subset an n-dimensional array by a vector of n 
dimensions? E.g. assume I have



x - array(1:24, dim=2:4)
x[1,1,2]

[1] 7

dims - c(1,1,2)


I would like a function that I can supply x and dims as parameters to, 
and have it return 7. Also, I would like to do something like:



x[1,1,]

[1]  1  7 13 19

dims2- c(1,1,NA)


And have a function of x and dims2 that gives me back [1]  1  7 13 19

Does such a thing exist?

Thanks

Richard






--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Subsetting an array by a vector of dimensions

2008-07-11 Thread Richard Pearson
In case anyone's still interested, I now have (I think!) a complete solution 
(thanks to a quick look at my new favourite document - S Poetry :-)


subsetArray - function(x, subset) {
  subsetString - paste(subset, collapse=,)
  subsetString - gsub(NA,,subsetString)
  evalString - paste(expression(x), [, subsetString, ])
  eval(parse(text=evalString))
}

subsetArray-- function(x, subset, value) {
  subsetString - paste(subset, collapse=,)
  subsetString - gsub(NA,,subsetString)
  evalString - paste(expression(x), [, subsetString, ] -, 
expression(value))
  eval(parse(text=evalString))
  x
}

x - array(1:24, dim=2:4)
subsetArray(x, c(1,1,2))
subsetArray(x, c(1,1,2)) - 25
x

Thanks to Pat!

Richard


Richard Pearson wrote:
My understanding of matrix subscripting is that this can be used to 
access arbitrary elements from an array and return them as a vector, but 
I don't understand how that helps me here. I've now written a function 
that seems to do what I originally wanted, but I've also realised I want 
to do assignment too. I need to read up more on writing assignment 
functions to do this. However, I'm thinking that someone has already 
solved this, in a far more elegant way than my hacking :-). Here's my 
function for anyone interested:



subsetArray - function(x, subset) {

+   subsetString - paste(subset, collapse=,)
+   subsetString - gsub(NA,,subsetString)
+   evalString - paste(expression(x), [, subsetString, ])
+   eval(parse(text=evalString))
+ }

x - array(1:24, dim=2:4)
subsetArray(x, c(1,1,2))

[1] 7

subsetArray(x, c(1,NA,2))

[1]  7  9 11

subsetArray(x, c(1,NA,NA))

[,1] [,2] [,3] [,4]
[1,]17   13   19
[2,]39   15   21
[3,]5   11   17   23


subsetArray(x, c(1,1,2)) - 25
Error in subsetArray(x, c(1, 1, 2)) - 25 :  could not find function 
subsetArray-


Best wishes

Richard.


Patrick Burns wrote:

I think you are looking for subscripting with a
matrix:

x[cbind(1,1,2)]

See, for instance, the subscripting section of chapter 1
of S Poetry.


Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

Richard Pearson wrote:

Hi

Is it possible to subset an n-dimensional array by a vector of n 
dimensions? E.g. assume I have



x - array(1:24, dim=2:4)
x[1,1,2]

[1] 7

dims - c(1,1,2)


I would like a function that I can supply x and dims as parameters 
to, and have it return 7. Also, I would like to do something like:



x[1,1,]

[1]  1  7 13 19

dims2- c(1,1,NA)


And have a function of x and dims2 that gives me back [1]  1  7 13 19

Does such a thing exist?

Thanks

Richard








--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Sum(Random Numbers)=100

2008-07-08 Thread Richard Pearson

Shubha

Does table(ceiling(runif(100,0,50))) give you something like you want?

Richard.

Shubha Vishwanath Karanth wrote:

...actually I need to allocate certain amount of money (here I mentioned
it as 100) to a randomly selected stocks(50 stocks)... i.e., 100 being
divided among 50 stocks and preferably all are integer allocations(i.e.,
5 8 56 12 etc without any decimals)...

Thank you,
Shubha
-Original Message-
From: Moshe Olshansky [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 12:09 PM

To: [EMAIL PROTECTED]; Shubha Vishwanath Karanth
Subject: Re: [R] Sum(Random Numbers)=100

If they are really random you can not expect their sum to be 100.
However, it is not difficult to get that given that the sum of n
independent Poisson random variables equals N, any individual one has
the conditional binomial distribution with size = N and p = 1/n, i.e.
P(Xi=k/Sn=N) = (N over k)*(1/n)^k*((n-1)/n)^(N-k).
So you can generate X1 binomial with size = 100 and p = 1/50; if X1 = k1
then the sum of the rest 49 must equal 100 - k1, so now you generate X2
binomial with size = 100-k1 and p = 1/49; if X2 = k2 then generate X3
binomial with size = 100 -(k1+k2) and p = 1/48, etc.

Why do you need this?


--- On Tue, 8/7/08, Shubha Vishwanath Karanth [EMAIL PROTECTED]
wrote:


From: Shubha Vishwanath Karanth [EMAIL PROTECTED]
Subject: [R] Sum(Random Numbers)=100
To: [EMAIL PROTECTED]
Received: Tuesday, 8 July, 2008, 3:58 PM
Hi R,

 


I need to generate 50 random numbers (preferably poisson),
such that
their sum is equal to 100. How do I do this?

 

 


Thank you,

Shubha

 


This e-mail may contain confidential and/or privileged
i...{{dropped:13}}

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

This e-mail may contain confidential and/or privileged i...{{dropped:10}}

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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 want to install a package on Max OS X from a local file

2008-06-25 Thread Richard Pearson

From the (terminal window) command line try:


R CMD INSTALL path.to.file/filename.tar.gz

Does that do it?

Richard


stephen sefick wrote:

install.packages(file.choose(), repos=NULL)
thought this would work, but it didn't
the package is the sowas package - this doesn't seem to be a CRAN package,
and it can be found at :

http://tocsy.agnld.uni-potsdam.de/wavelets/

On Wed, Jun 25, 2008 at 8:25 AM, stephen sefick [EMAIL PROTECTED] wrote:


I can't figure this one out- I am the administrator,  The file that I want
to install is a .tar.gz which is located on my desktop.  How do I get it
into my packages directory- through the GUI or through brute force?
thanks

stephen

--
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make us
feel like gods. We are mammals, and have not exhausted the annoying little
problems of being mammals.

-K. Mullis







--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson

Is it possible to temporarily suspend output? I am using a function that gives 
lots of output using cat, that is not very informative. Is it possible to turn 
output off, run the function, then turn output back on again? I've looked at 
?options and done various RSiteSearch()s but couldn't find a way to do this.

Many thanks,

Richard.

--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson

Wacek, many thanks! I'm wondering however whether this will be problematic on 
Windows (I have no windows box to hand to check this, but am creating a package 
that I would like to be cross-platform)?

Richard.

Wacek Kusnierczyk wrote:

Richard Pearson wrote:

Is it possible to temporarily suspend output? I am using a function
that gives lots of output using cat, that is not very informative. Is
it possible to turn output off, run the function, then turn output
back on again? I've looked at ?options and done various RSiteSearch()s
but couldn't find a way to do this.



sink(/dev/null)

?sink

vQ

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Suppressing output (e.g. from cat)

2008-06-24 Thread Richard Pearson

Many thanks Brian and Hadley, the quiet function works well for me. Maybe a 
candidate for utils?

Best wishes

Richard.

hadley wickham wrote:

Or:

tc - textConnection(NULL, w)
sink(tc)
...
sink()
close(tc)

That is a lot more expensive and subject to

   o   Use of textConnection(NULL, mode=w) could segfault.

(NEWS for 2.7.1).  Output textConnections are convenient, but have quite a
lot of overhead since they need to keep the character vector current.


That's true and I hadn't considered the speed issue.  It would be nice
to have an analogue to capture.output though.  Maybe:

quiet - function(x) {
  sink(tempfile())
  on.exit(sink())
  invisible(force(x))
}

?

Hadley




--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Extracting row.names

2008-06-23 Thread Richard Pearson

As a further aside, names is also not the best choice for a variable name for 
the same reason.

Richard.


Erik Iverson wrote:
row.names is a function that takes a data.frame as an argument.  So how 
about


  row.names(data)

?

As an aside, 'data' is not the best choice for a variable name in R, 
since there is a function called 'data' that will get overridden if you 
do this ...


Patrick Richardson wrote:

List,

I'm trying to extract the row names of a table I have read into R.


data - read.table(mesodata.txt, header=TRUE, row.names=1)


When I try to extract them using,


names - data$row.names


I get,


names

NULL

I've tried changing to a matrix, data frame, etc. and still get 
NULL. I've checked ?row.names as well as help on extracting part of 
an object,
etc. and unless I'm missing something obvious (likely), I can't figure 
out

how to extract them.

BACKGROUND
I want to extract the row names (which are basically gene id's) as 
well as

some other columns (which I can do successfully) and cbind them into
another data frame (which I can also do successfully). I just can't 
get the

row names extracted (Assigned) to an seperate object.

Any suggestions would be appreciated.

Many Thanks,

Patrick




sessionInfo()

R version 2.7.0 (2008-04-22) i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base


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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] which question

2008-06-06 Thread Richard Pearson

I didn't get any attached data, but my suspicion here is that you have somehow 
got RefSeq IDs in column 8 of human, as well as the gene symbols. Did you read 
this data in from a text file?

Eleni Christodoulou wrote:

An example is:

symbol=human[which(human[,3] %in% genes.sam.names),8]

The data* human* and *genes.sam.names* are attached. The result of the above
command is:

symbol

 [1] CCL18  MARCO  SYT13
 [4] FOXC1  CDH3
 [7] CA12   CELSR1 NM_018440
[10] MICROTUBULE-ASSOCIATED NM_015529  ESR1
[13] PHGDH  GABRP  LGMN
[16] MMP9   BMP7   KLF5
[19] RIPK2  GATA3  NM_032023
[22] TRIM2  CCND1  MMP12
[25] LDHB   AF493978   SOD2
[28] SOD2   SOD2   NME5
[31] STC2   RBP1   ROPN1
[34] RDH10  KRTHB1 SLPI
[37] BBOX1  FOXA1  NM_005669
[40] MCCC2  CHI3L1 GSTM3
[43] LPIN1  DSC2   FADS2
[46] ELF5   CYP1B1 LMO4
[49] AL035297   NM_152398  AB018342
[52] PIK3R1 NFKBIE MLZE
[55] NFIB   NM_052997  NM_006023
[58] CPB1   CXCL13 CBR3
[61] NM_017527  FABP7  DACH
[64] IFI27  ACOX2  CXCL11
[67] UGP2   CLDN4  M12740
[70] IGKC   IGKC   CLECSF12
[73] AY069977   HOXB2  SOX11
[76]NM_017422  TLR2
[79] CKS1B  BC017946   APOBEC3B
[82]HLA-DRB1   HLA-DQB1
[85]CCL13  C4orf7
[88]NM_173552
21345 Levels:  (2 (32 (55.11 (AIB-1) (ALU (CAK1) (CAP4) (CASPASE ... ZYX

As you can see, apart from gene symbols, which is the required thing, RefSeq
ID sare also retrieved...

Thanks a lot,
Eleni






On Fri, Jun 6, 2008 at 1:23 PM, Dieter Menne [EMAIL PROTECTED]
wrote:


Eleni Christodoulou elenichri at gmail.com writes:


I was trying to select a column of a data frame using the *which*

command. I

was actually selecting the rows of the data frame using *which, *and then
displayed a certain column of it. The command that I was using is:
sequence=*mydata*[*which*(human[,3] %in% genes.sam.names),*9*]


Please provide a running example. The *mydata* are difficult to read.


Dieter

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Remove an object by the reference

2008-05-13 Thread Richard Pearson

How about rm(list=x)?

Richard.


Shubha Vishwanath Karanth wrote:

Hi R,

 


A simple question, but don't know the answer...

 


x=a

a=5

 


I need to remove the object a by using only x. something like 
rm(somefunction(x))...Is this possible?

 


Shubha Karanth | Amba Research

Ph +91 80 3980 8031 | Mob +91 94 4886 4510 


Bangalore * Colombo * London * New York * San José * Singapore * 
www.ambaresearch.com

 


This e-mail may contain confidential and/or privileged i...{{dropped:13}}





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


--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] generic question - Genomics with R

2008-04-29 Thread Richard Pearson

I'd also suggest you check out http://www.bioconductor.org - Bioconductor is an 
open source and open development software project for the analysis and comprehension of 
genomic data

Richard.

Liviu Andronic wrote:

Hello,

On 4/29/08, [Ricardo Rodriguez] Your XEN ICT Team [EMAIL PROTECTED] wrote:

 I am trying to make my mind about the use of R for Computational and
Statistical Approaches to Genomics.


[..]

 Please, could you help me to go in the right direction?


I am not sure what pointers you are looking for, but checking the CRAN
Task Views [1] may be a starting point.

Liviu
[1] http://cran.r-project.org/web/views/index.html

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] deleting variables

2008-04-29 Thread Richard Pearson

?rm

Richard

Ralf Goertz wrote:

How can I automatically exclude one variable from being saved in the
workspace when I quit an R session? The problem is I don't know how to
erase a variable once it has been created.

Background: I open a connection called con to a database server in my
~/.Rprofile. Obviously, the connection expires when quitting the R
session. Unfortunately, the workspace is loaded after ~/.Rprofile is
run. So con get overwritten by the old workspace. I thought of using
.First() or .Last() but as these are functions I don't know how to
modify global variables.

Ralf

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Set of well distinguishable line types?

2008-04-28 Thread Richard Pearson

I've used the following to get a few different line types. However, I'd be interested to 
hear from someone with expertise in creating line types that are maximally 
distinguishable by human eyes.

ltys = c(22, 44, 13, 1343, 73, 2262, 12223242, F282, F4448444, 
224282F2, F1)

Best wishes

Richard.


Jim Lemon wrote:

Werner Wernersen wrote:

Hi,

I am plotting several lines into one plot and would
like them to be distinguishable in print later on as
well. Thus, my question is: Is there a larger set of
such line types available like the sets available for
colors?

Maybe somebody has already put in the work to define
some additional good looking and distinguishable line
types.


Hi Werner,
If you look at lty, there is an option for defining broken line types by 
strings of up to 8 hexadecimal digits, e.g.


abline(h=1,lty=28f8)

gives a line like the centerline used in mechanical drawing.

Jim

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



--
Richard D. Pearson [EMAIL PROTECTED]
School of Computer Science,http://www.cs.man.ac.uk/~pearsonr
University of Manchester,  Tel: +44 161 275 6178
Oxford Road,   Mob: +44 7971 221181
Manchester M13 9PL, UK.Fax: +44 161 275 6204

__
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] Equivalent of TensorRank

2008-03-26 Thread Richard Pearson
length(dim())?

Amit Soni wrote:
 Hi,

 In Mathematica, if we have a 3X3 matrix A, we can get its dimensions by:
 Dimensions[A] = {3,3}
 TensorRank[A] = 2

 In R, we have dim() for Dimensions[]. Is there any direct function similar
 to TensorRank in R?

 Thank you

   [[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-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] ROC analysis

2008-03-19 Thread Richard Pearson
Eleni

Does the fpr.stop argument do what you want? This is described in 
?performance under the details of the auc measure. Try, e.g.

perform=performance(pred,measure=auc,fpr.stop=0.5)


Richard.


Eleni Christodoulou wrote:
 Hello list,

 I am trying to perform ROC analysis and count the AUC in order to validate
 my results. I use package ROCR. I would like to count the AUC not under the
 cutoff found by performance but to use another cutoff that I calculate.
 How could I change the following  command in order to get what I want?
 perform=performance(pred,measure=auc,x.measure=cutoff), where pred is a
 prediction object.

 Thank you very much,
 Eleni

   [[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-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] levels() function for a vector

2008-03-11 Thread Richard Pearson
Karen

levels returns the levels attribute of a variable, and a vector has no 
such attribute. This is usually used with a factor, e.g.

  temp - c(3, 5, 5, NA)
  levels(factor(temp))
[1] 3 5

Best wishes

Richard


Chang Liu wrote:
 Hello:
  
 I'm trying to use levels function, but I don't know why it's returning NULL. 
 For example:
  
   
 temp[1]  3  5  5 NA levels(temp)NULL
 
  
 Also, I've tried: 
   
 list(temp)[[1]][1] 3 5 5 NA 
 levels(list(temp))NULL
 
 Is there a specific requirement on the parameter?
  
 Karen
  
 _


   [[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-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 to create ROC curve for 2 dimensional classifiers

2008-02-22 Thread Richard Pearson
I'm not aware of any packages for doing such plots. Conceptually, 
presumably a ROC curve for a 2d classifier would be a 3d chart, with 
x-axis being FPR for 1st classifier, z-axis being FPR for 2nd classifier 
and y-axis being TPR. You would get a ROC surface rather than a ROC 
curve. Does that make sense?

Regards

Richard.


Waverley wrote:
 Hi,

 I understand for 1 d classifiers, you can use ROCR package.

 Is there a package you can plot ROC curve for 2d classifiers?  One of
 my colleagues asked me about this.  I have been quite puzzled,
 conceptually, how you can do the ROC curve for 2d classifiers.  Can
 someone share his/her knowledge or experience?

 Thanks in advance.



__
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 to make t.test handle NA and essentially constant values ?

2008-02-12 Thread Richard Pearson
Do you mean to deal with the situation where you're doing many t-tests 
in a loop? If so there was a post very recently on this list about this:

https://stat.ethz.ch/pipermail/r-help/2008-February/153254.html

Richard.


Ng Stanley wrote:
 Thanks. Someone please help to make t.test go through all the data and not
 to be disrupted by the two problems.

 On 2/12/08, Petr PIKAL [EMAIL PROTECTED] wrote:
   
 Hi

 [EMAIL PROTECTED] napsal dne 12.02.2008 09:09:23:

 
 Hi,

 First problem:
   
 test - matrix(c(1,1,2,1), 2,2)
 apply(test, 1, function(x) { t.test(x) $p.value })
 
 Error in t.test.default(x) : data are essentially constant
   
 make your data not constant

 
 Second problem:
   
 test - matrix(c(1,0,NA,1), 2,2)
 apply(test, 1, function(x) { t.test(x) $p.value })
 
 Error in t.test.default(x) : not enough 'x' observations
   
 increase number of observations


 
 How to make t-test ignores this errors ?
   
 Well, the procedure is complaining that you do not give it correct data.
 You shall be gratefull for a great software which prevent you from making
 silly things as try to compute t.test when data have zero variantion or
 number of observations is 1.

 Regards
 Petr

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

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