[R] Passing in arguments into function

2011-01-23 Thread Paul Evans
Hi, I had a function that looked like: diff <- lm(x ~ y + z) How can I pass the argument to the 'lm' function on the fly? E.g., if I pass it in as a string (e.g. "x ~ y + z"), then the lm function treats it as a string and not a proper argument. many thanks [[alternative HTM

[R] string question

2010-06-30 Thread Paul Evans
Hi, How can I get double quotes embedded in the string? Example: -- str1 <- '"xyz"' ## desired output # abc"xyz" qr2 <- paste('abc',str1,sep='') print(qr2) - Actual output: > [1] "abc\"str\"" I also tried putting an escape sequence before the quote, but couldn'

Re: [R] Header in read.table() function

2010-02-03 Thread Paul Evans
Hi All, I hadn't realized the 'a-1' will open such a can of worms! Actually, the header elements will look something like 'ABCD-002-234-01D' (instead of 'a-1'). I get the files from somwhere else, so I cannot change how the input file is. Should I go ahead with the check.names=FALSE option?

[R] Header in read.table() function

2010-02-03 Thread Paul Evans
Hi, I wanted to read in a table that had hyphens in the header / column names. When I read it in however, it replaces the hyphens with a dot. Which parameter in the read.table function do I need to set to change this behaviour? Example code: jm <- matrix(1:4,2,2) rownames(jm) <- c('a','b') colna

[R] Newbie question on precision

2010-01-08 Thread Paul Evans
Hi all, How can I get R to change the default precision value? For example: > x=0.9 > 1-x [1] 0 > Is there a way that I can get a non-zero value using some parameter, or some package? many thanks. [[alternative HTML version deleted]] __

[R] Rgraphviz installation

2009-12-16 Thread Paul Evans
Hi, I wanted to install Rgraphviz. From the R GUI, I downloaded the package but when I tried to load it I got the following error message: "This application has failed to start because libcdt-4.dll was not found. Re-installing the application may fix this problem." The R commands and errors are:

Re: [R] copyING directories and files

2009-12-11 Thread Paul Evans
s wrote: > > I'd use a shell() command to call xcopy or robocopy, or cp given you > have some unix tools installed. > > Uwe Ligges > > > > Paul Evans wrote: >> Hi, >> >> I am using the windows version of R. I wanted to copy a directory >> (

[R] copyING directories and files

2009-12-11 Thread Paul Evans
Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this (something like the 'cp' command in UNIX)? I have looked at 'file.copy', but as the name implies I think it only copies one f

[R] Lattice package - Trellis

2009-10-15 Thread Paul Evans
Hi, I was trying to make a graph using trellis, and my code is: - library(lattice) makeGraph <- function(){ trellis.device() tbg <- trellis.par.get("background") tbg$col <- "white" trellis.par.set("background",tbg) # Test

[R] Clustering for Ordinal data

2009-10-14 Thread Paul Evans
Hi, I just wanted to check whether there is a clustering package available for ordinal data. My data looks something like: #1 #2 #3 #4. A B C D... D B C A... D C A A... where each column represents a sample, and each row some ordinal values. I would like to cluster such that similar samples

Re: [R] newby question

2009-07-04 Thread Paul Evans
Hi all, Thanks very much for the prompt responses! All the suggestions worked :) Paul From: Martin Morgan Cc: r-h...@stat.math.ethz.ch Sent: Saturday, July 4, 2009 1:01:16 PM Subject: Re: [R] newby question Hi Paul -- Paul Evans wrote: > Hi, > &g

[R] newby question

2009-07-04 Thread Paul Evans
Hi, I work with bio-conductor, but this is probably a basic R question. I want to emulate the GOBPOFFSPRING$"GO:0008150" command: > allBP <- GOBPOFFSPRING$"GO:0008150" > class(allBP) [1] "character" > length(allBP) [1] 16066 > I want to create a function so that I can execute the command by p

Re: [R] Heatmap: draw horizontal line

2009-05-06 Thread Paul Evans
= abline(h = c(3.5,5.5), lwd = 3)) what your are looking for? hth, Matthias Paul Evans schrieb: > Hi, > > I wanted to draw a heatmap with some horizontal lines. For example: > > #-- code -- > mat <- matrix(-1:1,7,9) > heatmap.2(mat,Rowv=NA,trace = 'none'

[R] Heatmap: draw horizontal line

2009-05-06 Thread Paul Evans
Hi, I wanted to draw a heatmap with some horizontal lines. For example: #-- code -- mat <- matrix(-1:1,7,9) heatmap.2(mat,Rowv=NA,trace = 'none',key=F) #end code - In this heatmap, I want to subgroup the rows. For instance, I would like to group rows 5,6 & 7 together, and would

[R] Vizualization of points within sets

2009-04-20 Thread Paul Evans
Hi all, I have a visualization question regarding sets. My problem is as follows: I have several sets, each having some members (or 'points'). I would like to connect the points, while keeping the sets. For example, if I have 3 sets (Set 1 contains points A, B, C): Set 1: -- A, B, C Set 2:

Re: [R] download.file()

2008-03-18 Thread Paul Evans
reply! - Original Message From: Stefan Grosse <[EMAIL PROTECTED]> To: r-help@r-project.org; Paul Evans <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2008 1:57:46 PM Subject: Re: [R] download.file() On Tuesday 18 March 2008 06:32:18 pm Paul Evans wrote: PE> Also, is there a

Re: [R] download.file()

2008-03-18 Thread Paul Evans
Thanks Henrik. Also, is there a method/package (in R) with which I can unpack a tar file programatically? thanks again! - Original Message From: Henrik Bengtsson <[EMAIL PROTECTED]> To: Prof Brian Ripley <[EMAIL PROTECTED]> Cc: Paul Evans <[EMAIL PROTECTED]>; [EMA

Re: [R] download.file()

2008-03-18 Thread Paul Evans
Aaah...I see now. Thanks !! - Original Message From: Henrik Bengtsson <[EMAIL PROTECTED]> To: Paul Evans <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] Sent: Tuesday, March 18, 2008 11:59:45 AM Subject: Re: [R] download.file() On Tue, Mar 18, 2008 at 8:57 AM, Henrik Bengt

[R] download.file()

2008-03-18 Thread Paul Evans
Hi, I wanted to download a file and did the following: - > fileLink <- > 'ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE1000/GSE1000_RAW.tar' > download.file(fileLink,'/geoDat') trying URL 'ftp://ftp.ncbi.nih.gov/pub/geo/DATA