Re: [R] How to solve empty cells in the contingency table?

2008-06-27 Thread David Duffy
Hi,Dear all R experts, I am trying to do the 2-way contingency table analysis by fitting the loglinear models. However, I found my table has several empty cells which are theoretically missing values.I have no idea of how to solve them coz we cannot compute the simulated p-value with

[R] Superimposing Multiple Vectors Plots in One Figure

2008-06-27 Thread Gundala Viswanath
Hi, I have 3 vectors which I want to plot as in one plot. I was wondering why this code of mine only show the last vector: __BEGIN__ library(lattice) out_fname - paste(MyPlot.png,sep=) trellis.device(png, color=TRUE) png(out_fname) plot(vect1,type=l,col=red,xlab=Nof Genes, ylab=RMSD)

Re: [R] stationary terminology time series question

2008-06-27 Thread Prof Brian Ripley
Stationarity is a statement about a stochastic process, not about a single realization. It is a statement about what might have happened, not what did happen. A sine wave with a random (uniform) wave is stationary, and indeed the superposition of such waves is the spectral decomposition. A

[R] request: To access a particular list

2008-06-27 Thread Muhammad Azam
Dear R community I have a problem to access particular list. I have a code given below where there is recursive process. It is not possible to run it because there are few other functions involved inside like sv, LN, RN etc. k=0; n=0; variable=c(); vr-list() func - function(data,testdata)

[R] finding the suitable distribution

2008-06-27 Thread mohamed nur anisah
Dear R-users, Attach with is my data..what i want to do is finding a suitable distribution for my data..I want to run a few test like the poisson and the exponential distribution. Please help me on how to find the p-value for poisson as well as the exponential distribution without knowing

[R] finding suitable distribution with default parameter

2008-06-27 Thread mohamed nur anisah
Dear R-users, Attach with is my data..what i want to do is finding a suitable distribution for my data..I want to run a few test like the poisson and the exponential distribution. Please help me on how to find the p-value for poisson as well as the exponential distribution without

[R] Alternative of Cairo

2008-06-27 Thread [EMAIL PROTECTED]
Hi All, I am a new member to R programming. Am generating some visuals by using Cairo library. But Cairo is not compatible with all compilers(Box plot,histogram and RNA degradation plots-I would prefer to use some libraries rather than R native functions).Can anyone suggest an alternative for

Re: [R] Extract naiveBayes details

2008-06-27 Thread David Meyer
Stephan: the Naive Bayes model consists of several tables, one for each (categorical) predictor. Using m = naiveBayes( ... ) m$tables you will get (as the help page says): tables: A list of tables, one for each predictor variable. For each categorical variable a table giving, for

Re: [R] [SPAM] - constructing arbitrary (positive definite) covariance matrix - Found word(s) list error in the Text body

2008-06-27 Thread Mizanur Khondoker
Thanks to everyone who responded to my email. Moshe's email explains clearly why my matrices were not positive definite for certain negative correlations. I now have better understanding of the problem. Thanks Mizan 2008/6/27 Moshe Olshansky [EMAIL PROTECTED]: If the main diagonal element of

[R] (no subject)

2008-06-27 Thread 王春萍
Dear everyone: I am now doing one exercise with hclust and i do not know how to deal with the reslut as produced by it! My aim is to find out the number of clusters and what are the members for each cluster? So I am writing to here to get your help thanks in advance! chunping

[R] confidence bounds using contour plot

2008-06-27 Thread Pascal Hänggi
Sorry for the wrong placing of my last email. Here a solution to my problem and incomprehension respectively: # Example 95% x - rnorm(1000, mean = 0, sd = 1) y - rnorm(1000, mean = 1, sd = 1.3) kerneld - kde2d(x, y, n = 100, lims = c(-5.0, 5.0, -5.0, 5.0)) pp - array() for (i in 1:1000){

Re: [R] stuck on making a line graph across time, with 4 categories

2008-06-27 Thread ONKELINX, Thierry
A solution with ggplot2 would be dataset - data.frame(cat = factor(rbinom(1000, 1, prob = .33), labels = LETTERS[1:2]), startyear = floor(runif(1000, 2001, 2009)), studentid = 1:1000) library(ggplot2) ggplot(dataset, aes(x = startyear, colour = cat)) + stat_bin(aes(y = ..count..), geom=line,

[R] change values in data frames

2008-06-27 Thread poul
Hello every body, I am quite a new user of R so I beg your pardon for this naive question and the lake of syntax with wich I ask it: I have a data frames like this: colacolb 1 c 1 i 1 i 1 c 2 i 2 c 2 c 2 i 2 i ... 1 I would like

[R] removing blanks from a string

2008-06-27 Thread juli pausas
Hi Is there a way to remove blank characters from the end of strings in a vector? Something like the =TRIM functions of the OpenOffice spreadsheet. E.g., a - c(hola, Yes , hello )# I'd like to get: c(hola, Yes, hello) Thanks Juli -- http://www.ceam.es/pausas

Re: [R] removing blanks from a string

2008-06-27 Thread jim holtman
Is this what you want: x - c(hola, Yes , hello ) gsub( *$, , x) [1] hola Yes hello On Fri, Jun 27, 2008 at 4:34 AM, juli pausas [EMAIL PROTECTED] wrote: Hi Is there a way to remove blank characters from the end of strings in a vector? Something like the =TRIM functions

Re: [R] bug in nls?

2008-06-27 Thread Petr PIKAL
Thank you both. Katharine approach seemed to me easier to implement so I used it successfully. However I still wonder why in linear model using lm I can use for (i in ) lm( data[,i]~data[,1]) but in nls the same construction fails. I understand that it is sometimes difficult to set

Re: [R] (no subject)

2008-06-27 Thread Peng Jiang
Hi , Ping, First you should report more detail about your problem and make sure it is a R specific one. To find out more on using hclust, I suggest you try help(hclust). I am not sure about what result you want to obtain since the result of hclust seems straight forward. By the way,

Re: [R] removing blanks from a string

2008-06-27 Thread john seers (IFR)
There is also the trim command in the gdata package. Removes blanks from the front of the string as well which may not be what you want. Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman Sent: 27 June 2008 10:27 To: juli

Re: [R] bug in nls?

2008-06-27 Thread Petr PIKAL
Thank you Berwin. Ok, I take your point. I normally do nls modelling interactively but this time I was given a set of data so I tried to use an approach which I use quite often in lm or in plotting to pdf file. I obviously was not successful and there is nothing about it in documentation or

[R] assigning colors to barplot

2008-06-27 Thread Archana Vagish
Hi, I want to plot a series of numbers ( which lie in the range 1-20, there are many such numbers) as a barplot. However instead of representing the values in terms of height, i want to assign one unique color to each number. How can this be done in R? Thanks, archana, II yr PhD student, Dept of

[R] Odp: using contour() with x,y,z data?

2008-06-27 Thread Petr PIKAL
Hi you probably want to look to interp from arima package Petr Pikal [EMAIL PROTECTED] 724008364, 581252140, 581252257 [EMAIL PROTECTED] napsal dne 26.06.2008 20:00:48: Hello list, I'm new to R and I have a problem :-) Below is what my data file that looks like. I tried to import and

Re: [R] removing blanks from a string

2008-06-27 Thread Prof Brian Ripley
There are well-informed answers given as examples on the sub() help page. Hint 1: there is no need to globally substitute patterns anchored at the end: they can only match in one place. There is also no need to substitute for . Hint 2: 'blank characters' and 'spaces' are not the same

Re: [R] bug in nls?

2008-06-27 Thread Prof Brian Ripley
As has already been pointed out, the syntax of formulae in nls() is not the same as in linear models. So things which are valid for linear models are not necessarily valid for others. Since nls() is sparsely documented on the help page, you need to look at the references (and you can also

Re: [R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Lauri Nikkinen
I'm working with Windows XP and R 2.6.0 R.Version() $platform [1] i386-pc-mingw32 -Lauri 2008/6/27, Lauri Nikkinen [EMAIL PROTECTED]: Hello, Is there a way to control pointsize of pdf:s produced by Sweave? I would like to have the same pointsize from (not a working example)

[R] Odp: Superimposing Multiple Vectors Plots in One Figure

2008-06-27 Thread Petr PIKAL
Hi you mix base and lattice graphics. [EMAIL PROTECTED] napsal dne 27.06.2008 08:25:55: Hi, I have 3 vectors which I want to plot as in one plot. I was wondering why this code of mine only show the last vector: __BEGIN__ library(lattice) out_fname - paste(MyPlot.png,sep=) why not

[R] matching problem

2008-06-27 Thread Tom.O
Hi R gurus I have a matching problem that I cant solve. I have tried multiple solutions and searched varius help-sites but I cant get it to work. This is the problem myexstrings = c(*AAA.AA,BBB BB,*.CCC.,**dd- d) what I want do do is to remove any non-characters in the beginning and everything

Re: [R] igraph (was Compilation error during package installation)

2008-06-27 Thread Prof Brian Ripley
Please discuss this with the package maintainer (see the posting guide). He will need lots of details you have omitted, including the precise OS and the C++ compiler used. BTW, this illustrates a common problem with packages using C++, which people often test only under one compiler, and

[R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Lauri Nikkinen
Hello, Is there a way to control pointsize of pdf:s produced by Sweave? I would like to have the same pointsize from (not a working example) pdf(file=C:/temp/example.pdf, width=7, height=7, bg=white, pointsize=10) plot(1:10) etc.. dev.off() as \documentclass[a4paper]{article}

Re: [R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Duncan Murdoch
On 27/06/2008 6:23 AM, Lauri Nikkinen wrote: I'm working with Windows XP and R 2.6.0 R.Version() $platform [1] i386-pc-mingw32 -Lauri 2008/6/27, Lauri Nikkinen [EMAIL PROTECTED]: Hello, Is there a way to control pointsize of pdf:s produced by Sweave? I would like to have the same pointsize

Re: [R] igraph (was Compilation error during package installation)

2008-06-27 Thread Gabor Csardi
Wanding, I'm the maintainer of igraph, but missed your previous email. Yes, currently the released version of igraph fails to compile with gcc 4.3.x. I made the required modifications to fix this, but these are still in the igraph development tree, as there has been no release since that.

Re: [R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Lauri Nikkinen
pdf.options() seems to be a new function (from 2.7.0), so I quess I'll have to upgrade or write my own hook function for Sweave. Thanks. Best Lauri 2008/6/27, Duncan Murdoch [EMAIL PROTECTED]: On 27/06/2008 6:23 AM, Lauri Nikkinen wrote: I'm working with Windows XP and R 2.6.0

[R] Yule Kendall resistant measure of skewness

2008-06-27 Thread tolga . i . uzuner
Dear R Users, Is anyone aware of a package which calculates the Yule Kendall resistant (to errors,outliers) measure of skewness ? An easy calculation to perform, but was just wondering if a package exists (as the contents of that package would probably include other cool things I would also be

Re: [R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Duncan Murdoch
On 27/06/2008 7:12 AM, Lauri Nikkinen wrote: pdf.options() seems to be a new function (from 2.7.0), so I quess I'll have to upgrade or write my own hook function for Sweave. Thanks. I'd recommend upgrading. I think it would be difficult to do this with a hook function: you'd basically need

Re: [R] Sweave: controlling pointsize (pdf)

2008-06-27 Thread Lauri Nikkinen
Yes, I think so too. I already tried with options(SweaveHooks=list(fig=function() pdf(pointsize=10))) but as you said it tries to open pdf device and Sweaving fails... Best Lauri 2008/6/27, Duncan Murdoch [EMAIL PROTECTED]: On 27/06/2008 7:12 AM, Lauri Nikkinen wrote: pdf.options() seems to

Re: [R] matching problem

2008-06-27 Thread Hans-Joerg Bibiko
On 27 Jun 2008, at 12:23, Tom.O wrote: Hi R gurus I have a matching problem that I cant solve. I have tried multiple solutions and searched varius help-sites but I cant get it to work. This is the problem myexstrings = c(*AAA.AA,BBB BB,*.CCC.,**dd- d) what I want do do is to remove any

Re: [R] Connecting lines across missing data points, xyplot

2008-06-27 Thread Jim Lemon
David Afshartous [EMAIL PROTECTED] wrote: All, I have data across 5 time points that I am graphing via xyplot, along with error bars. For one of the variables I have missing data for two of the time points. The code below is okay but I can't seem to get the lines to connect

Re: [R] assigning colors to barplot

2008-06-27 Thread Jim Lemon
On Fri, 2008-06-27 at 15:17 +0530, Archana Vagish wrote: Hi, I want to plot a series of numbers ( which lie in the range 1-20, there are many such numbers) as a barplot. However instead of representing the values in terms of height, i want to assign one unique color to each number. How can

[R] xyplot and separate abline per plot

2008-06-27 Thread Karin Lagesen
Hello list! I have a set of data like this: alldata[1:5,] breaks numbers disttype moltypetype 1 0.0006598 Gapped Distances 5S Between species 2 0.407 0 Gapped Distances 5S Between species 3 0.8135228 Gapped Distances 5S Between

[R] Similarity matching with probabilities

2008-06-27 Thread francogrex
Hello, It's just a strange coincidence that someone posted just very recently a question about matching. I know there are several match function in the base package (such as match, pmatch, charmatch, and the gsub etc) but I can't seem to use them wisely to be able to get what I need. suppose I

Re: [R] matching problem

2008-06-27 Thread Tom.O
Well I have tried that and it's unfortuanally not the solution. This return all the characters in the string, but I dont want the characters after the ending non-character symbol. Only the starting characters ore of interest. gsub(\\W*,, myexstrings,perl=T) [1] A B CCC ddd Regards

Re: [R] matching problem

2008-06-27 Thread Daniel Folkinshteyn
this should do what you want: myexstrings = c(*AAA.AA,BBB BB,*.CCC.,**dd- d) a = gsub(^\\W*,, myexstrings,perl=T) b = gsub(\\W.*, , a, perl=T) b [1] AAA BBB CCC dd first one, removes any non-word characters from the beginning (as you already figured out) second one, removes any remaining

[R] Optimisation of xyplot style

2008-06-27 Thread Sébastien
Dear R-users, The following provides a basis to illustrate some questions I have about xyplot() customization. x - rep(1:2, times = 6) y - numeric() for (i in 1:3) { y - c(y, 1:4*10^(i-1)) } g - rep(1:6, each = 2) ax - rep(1:3, each = 4) tmp - data.frame(x,y,g) xyplot(y ~ x | g,

[R] Switching entries in vector in by groups of two

2008-06-27 Thread David Afshartous
All, I have a long vector that contains an even number of entries. I'd like to switch the 1st and 2nd entry, the 3rd and 4th, and so on, without writing a loop. This code works: X = c(8, 10, 6, 3, 20, 1) index = c(2,1,4,3,6,5) X[index] But for a long list is there a way to generate the index?

Re: [R] matching problem

2008-06-27 Thread Hans-Joerg Bibiko
On 27 Jun 2008, at 13:56, Tom.O wrote: Well I have tried that and it's unfortuanally not the solution. This return all the characters in the string, but I dont want the characters after the ending non-character symbol. Only the starting characters ore of interest. gsub(\\W*,,

Re: [R] Switching entries in vector in by groups of two

2008-06-27 Thread Gabor Grothendieck
You can do it without and index like this: c(matrix(X, 2)[2:1,]) or if you need the index for some purpose apart from this: c(matrix(seq_along(X), 2)[2:1,]) On Fri, Jun 27, 2008 at 10:11 AM, David Afshartous [EMAIL PROTECTED] wrote: All, I have a long vector that contains an even number of

Re: [R] Switching entries in vector in by groups of two

2008-06-27 Thread Marc Schwartz
on 06/27/2008 09:11 AM David Afshartous wrote: All, I have a long vector that contains an even number of entries. I'd like to switch the 1st and 2nd entry, the 3rd and 4th, and so on, without writing a loop. This code works: X = c(8, 10, 6, 3, 20, 1) index = c(2,1,4,3,6,5) X[index] But for a

Re: [R] Switching entries in vector in by groups of two

2008-06-27 Thread Henrique Dallazuanna
Try this: ave(X, rep(1:(length(X)/2), each = 2), FUN=rev) On Fri, Jun 27, 2008 at 11:11 AM, David Afshartous [EMAIL PROTECTED] wrote: All, I have a long vector that contains an even number of entries. I'd like to switch the 1st and 2nd entry, the 3rd and 4th, and so on, without writing a

Re: [R] Similarity matching with probabilities

2008-06-27 Thread Hans-Joerg Bibiko
On 27 Jun 2008, at 14:30, francogrex wrote: Hello, It's just a strange coincidence that someone posted just very recently a question about matching. I know there are several match function in the base package (such as match, pmatch, charmatch, and the gsub etc) but I can't seem to use

Re: [R] Switching entries in vector in by groups of two

2008-06-27 Thread David Afshartous
Thanks Henrique, Marc, and Gabor! On 6/27/08 10:17 AM, Henrique Dallazuanna [EMAIL PROTECTED] wrote: Try this: ave(X, rep(1:(length(X)/2), each = 2), FUN=rev) On Fri, Jun 27, 2008 at 11:11 AM, David Afshartous [EMAIL PROTECTED] wrote: All, I have a long vector that contains an

Re: [R] Switching entries in vector in by groups of two

2008-06-27 Thread Peter Dalgaard
Henrique Dallazuanna wrote: Try this: ave(X, rep(1:(length(X)/2), each = 2), FUN=rev) Also, ix - 2*rep(1:(length(X)/2-1), each = 2) + 2:1 X[ix] or ix - seq_along(X) + c(1,-1) X[ix] On Fri, Jun 27, 2008 at 11:11 AM, David Afshartous [EMAIL PROTECTED] wrote: All, I have a long

Re: [R] binomial distribution

2008-06-27 Thread Peng Jiang
Hi, xiechao i don't think that is a R specific problem. you mean u got two random variables X,Y and both of them binomial distributed and you want to find the distribution of a new variable Z = X/Y. That is a basic transformation problem. u can start with introducing a new r.v. namely W,

Re: [R] matching problem

2008-06-27 Thread Tom.O
Thanks guys, all of you. You have just made this weekend a much more happier weekend. Regards Tom Hans-Jörg Bibiko wrote: On 27 Jun 2008, at 13:56, Tom.O wrote: Well I have tried that and it's unfortuanally not the solution. This return all the characters in the string, but I dont

[R] NA value

2008-06-27 Thread Alfredo Alessandrini
I'm trying to replace NA with 0 value... I've write a loop, but don't work... Where's the problem? cimfasy_rwl 1991 0.92 0.72 0.50 1.29 0.54 1.22 1992 2.15 1.28 1.23 2.26 1.22 3.17 1993 1.50 0.87 1.68 1.97 0.83 2.55 1994

Re: [R] xyplot and separate abline per plot

2008-06-27 Thread Sébastien Bihorel
Hi Karin, Try this xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata, panel = function(x, y, ...){ panel.abline(h = 0, col.line = 1) panel.xyplot(x, y, ..., pch = 1, col.symbol = 1)}) Look at panel.abline in the lattice help for more details. Here, h = 0 will plot a

[R] permutation distribution for Friedman test

2008-06-27 Thread Michael Andric
Hi I am looking to generate permutations for data tested using the friedman.test. Just read a paper by Joachim Rohmel, The permutation distribution of the Friedman test (Computational Statistics Data Analysis 1997, 26: 83-99). He offers APL code for carrying out these procedures; wondering if

Re: [R] NA value

2008-06-27 Thread Doran, Harold
Don't use a loop for this. Do this. X - matrix(c(NA, 2, NA, 4),ncol=2) # Sample matrix X[is.na(X)] - 0 # Do this instead -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alfredo Alessandrini Sent: Friday, June 27, 2008 10:37 AM To:

[R] R help

2008-06-27 Thread Rajasekaramya
Hi, I have a problem in assessing the list element. i have list called geneset it contains the following elements geneset [[1]] V1 V2 V3 ...V200 Genenamegene1 gene2gene200 [[2]] V1V2 V3 V4...V[240]

Re: [R] R help

2008-06-27 Thread Jorge Ivan Velez
Hi Ramya, Try something like this: as.character(unlist(lapply(geneset,function(x) x[1]))) HTH, Jorge On Fri, Jun 27, 2008 at 10:33 AM, Rajasekaramya [EMAIL PROTECTED] wrote: Hi, I have a problem in assessing the list element. i have list called geneset it contains the following

Re: [R] matching problem

2008-06-27 Thread Gabor Grothendieck
Here is a solution using strapply from the gsubfn package: library(gsubfn) strapply(myexstrings, (\\w+).*, backref = -1, simplify = c) It matches the first string of word characters following by anything else and then returns the first backreference in each match, i.e. the portion within

Re: [R] NA value

2008-06-27 Thread Alfredo Alessandrini
Don't use a loop for this. Do this. I need to use a loop... I've many data. Alfredo __ 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

Re: [R] NA value

2008-06-27 Thread K. Elo
Hi, cimfasy_rwl[ is.na(cimfasy_rwl) ] -0 Or did I understood Your right? HTH, Kimmo Alfredo Alessandrini wrote: I'm trying to replace NA with 0 value... I've write a loop, but don't work... Where's the problem? cimfasy_rwl 1991 0.92 0.72 0.50 1.29 0.54 1.22

Re: [R] Superimposing Multiple Vectors Plots in One Figure

2008-06-27 Thread Gundala Viswanath
Dear Petr, Thanks so much for your detailed guidance. I'll have a look at your suggestions. - Gundala Viswanath Jakarta - Indonesia On Fri, Jun 27, 2008 at 7:09 PM, Petr PIKAL [EMAIL PROTECTED] wrote: Hi you mix base and lattice graphics. [EMAIL PROTECTED] napsal dne 27.06.2008 08:25:55:

Re: [R] binomial distribution

2008-06-27 Thread Peter Dalgaard
Peng Jiang wrote: Hi, xiechao i don't think that is a R specific problem. you mean u got two random variables X,Y and both of them binomial distributed and you want to find the distribution of a new variable Z = X/Y. That is a basic transformation problem. u can start with introducing a

Re: [R] R help

2008-06-27 Thread Daniel Folkinshteyn
try this: firstgenes = lapply(geneset, function(x){return(x[1,1])}) firstgenes = do.call(rbind(firstgenes)) on 06/27/2008 10:33 AM Rajasekaramya said the following: Hi, I have a problem in assessing the list element. i have list called geneset it contains the following elements

Re: [R] R help

2008-06-27 Thread Daniel Folkinshteyn
oh, unlist - very nice function, thanks :) on 06/27/2008 11:23 AM Jorge Ivan Velez said the following: Hi Ramya, Try something like this: as.character(unlist(lapply(geneset,function(x) x[1]))) HTH, Jorge On Fri, Jun 27, 2008 at 10:33 AM, Rajasekaramya [EMAIL PROTECTED] wrote: Hi, I

Re: [R] Problems exporting graphs

2008-06-27 Thread stephen sefick
pdf( yourfile.pdf, height=22, width=17) #yourcode dev.off() then use the gimp (free) to transform it to .png or whatever else (pdf makes good graph) On Thu, Jun 26, 2008 at 8:59 PM, Daniel Folkinshteyn [EMAIL PROTECTED] wrote: not sure why it doesn't work, but try the following: first, plot

Re: [R] NA value

2008-06-27 Thread Sarah Goslee
Like this: for (i in files_rwl) { thisfile - get(i) thisfile[is.na(thisfile)] - 0 assign(i, thisfile) } It's likely that you could condense it, but using the long form makes it clear what's happening. Sarah -- Sarah Goslee http://www.functionaldiversity.org

[R] plotting prcomp

2008-06-27 Thread Dan Bolser
Please consider the following PCA example; my.df - data.frame(A=(x - rnorm(100,mean=100, sd=10)), B=(y - x + rnorm(100,mean=10, sd=10))) plot(my.df) my.pc - prcomp(my.df, center=TRUE, scale=TRUE) biplot(my.pc) my.x - (my.pc$x)[,1] my.y - (my.pc$x)[,2] plot(my.x, my.y,

Re: [R] NA value

2008-06-27 Thread Jorge Ivan Velez
Dear K. Elo, You're right! cimfasy_rwl=read.table(textConnection(1991 0.92 0.72 0.50 1.29 0.54 1.22 1992 2.15 1.28 1.23 2.26 1.22 3.17 1993 1.50 0.87 1.68 1.97 0.83 2.55 1994 0.69 0.00 0.76 1.89 0.60 0.87

Re: [R] R help

2008-06-27 Thread Martin Morgan
Hi Rajasekaramya sapply(geneset[1:5431], [[, V1) or Bioconductor::subListExtract(geneset[1:5431], V1) Martin Rajasekaramya wrote: Hi, I have a problem in assessing the list element. i have list called geneset it contains the following elements geneset [[1]]

Re: [R] NA value

2008-06-27 Thread Alfredo Alessandrini
for (i in files_rwl) { thisfile - get(i) thisfile[is.na(thisfile)] - 0 assign(i, thisfile) } It's likely that you could condense it, but using the long form makes it clear what's happening. ..it's work Thanks... Alfredo

[R] getting multiple argument names

2008-06-27 Thread whizvast
hi, all- i wrote a function that accept multiple arguments, but don't know how to assign names automatically. run the following code: foo - function (...) { x = list(...) names(x) - deparse(substitute(...)) x } a = 1; b = 2; c = 3 y - foo( a, b, c) names(y) as you can see, only the first

Re: [R] Problems exporting graphs

2008-06-27 Thread Prof Brian Ripley
On Fri, 27 Jun 2008, stephen sefick wrote: pdf( yourfile.pdf, height=22, width=17) #yourcode dev.off() then use the gimp (free) to transform it to .png or whatever else (pdf makes good graph) So do R's graphics devices If you do want to convert PDF to PNG there are much better ways

Re: [R] plotting prcomp

2008-06-27 Thread Prof Brian Ripley
On Fri, 27 Jun 2008, Dan Bolser wrote: Please consider the following PCA example; my.df - data.frame(A=(x - rnorm(100,mean=100, sd=10)), B=(y - x + rnorm(100,mean=10, sd=10))) plot(my.df) my.pc - prcomp(my.df, center=TRUE, scale=TRUE) biplot(my.pc) my.x - (my.pc$x)[,1] my.y -

[R] Error reading a table

2008-06-27 Thread naw3
Hi, I get the following error when I try to read in a CSV file: Path-read.table('MetaCycSample2.csv',sep=',', header=FALSE) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 17 did not have 5 elements Some of the rows have more columns than others. Also when

Re: [R] plotting prcomp

2008-06-27 Thread Prof Brian Ripley
On Fri, 27 Jun 2008, Prof Brian Ripley wrote: On Fri, 27 Jun 2008, Dan Bolser wrote: Please consider the following PCA example; my.df - data.frame(A=(x - rnorm(100,mean=100, sd=10)), B=(y - x + rnorm(100,mean=10, sd=10))) plot(my.df) my.pc - prcomp(my.df, center=TRUE,

[R] SAM FDR

2008-06-27 Thread Davendra Sohal
Hello all, I am doing SAM and the median of positive genes in the permutated sets is = false positives, and the parent set gives true positives. FDR = FP/TP * 100. My FDR comes to greater than 100. Is that possible? Please help! Thanks, -D. [[alternative HTML version deleted]]

Re: [R] Yule Kendall resistant measure of skewness

2008-06-27 Thread Jorge Ivan Velez
Dear Tolga, See equation 2.6 herehttp://secamlocal.ex.ac.uk/people/staff/dbs202/cag/courses/MT37C/course/node14.html. Also try this: # Yule Kendall resistant measure of skewness YK=function(x){ qs=quantile(x,probs=c(0.25,0.5,.75)) res=(qs[1]-2*qs[2]+qs[3])/(qs[2]-qs[1]) names(res)=NULL res } #

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-27 Thread Thomas Frööjd
Hi Thank you very much for taking time to answer. The solution of using hist(data) for the main dataset and adding lines(density(refdata)) for the reference data seem to work great. I forgot to mention one thing however, I need to have frequency on the y azis instead of density as now. I know

Re: [R] Error reading a table

2008-06-27 Thread jim holtman
Try read.table(,fill=TRUE) On Fri, Jun 27, 2008 at 12:00 PM, [EMAIL PROTECTED] wrote: Hi, I get the following error when I try to read in a CSV file: Path-read.table('MetaCycSample2.csv',sep=',', header=FALSE) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,

Re: [R] R help

2008-06-27 Thread Martin Morgan
Martin Morgan wrote: Hi Rajasekaramya sapply(geneset[1:5431], [[, V1) or Bioconductor::subListExtract(geneset[1:5431], V1) oops, I meant using the 'Biobase' package from Bioconductor, e.g., library(Biobase) subListExtract(geneset[1:5431], V1) Sorry for the confusion, Martin Martin

Re: [R] Problems exporting graphs

2008-06-27 Thread hippie dream
This is solved for me. Upgrading R to 2.7.1 sorted out the issue somehow. Maybe there is a problem with Ubuntu 8.04 and R 2.6.2. Or maybe some other package was installed that fixed it. Whatever the case. Thanks! Prof Brian Ripley wrote: On Fri, 27 Jun 2008, stephen sefick wrote: pdf(

[R] include S4 class and methods in a package

2008-06-27 Thread baptiste Auguié
DeaR list, Pardon the stupidity of this question but I've been trying this for a while now without success. I've followed the example given in the green book programming with data, and I now have a working example of a S4 class with a few methods (plot, summary, as.data.frame). It's all

Re: [R] getting multiple argument names

2008-06-27 Thread Bert Gunter
You evidence a good deal of confusion. VR's S PROGRAMMING, in particular Chapter 3 (especially section 3.5 on Computing on the Language) would be helpful to you. See also their example on p. 46. However in brief: foo - function (...) { x -3 list(...) } returns the evaluated ... arguments as a

Re: [R] Yule Kendall resistant measure of skewness

2008-06-27 Thread tolga . i . uzuner
Dear Jorge, Many thanks, this is great. Tolga Jorge Ivan Velez [EMAIL PROTECTED] 27/06/2008 18:11 To [EMAIL PROTECTED] cc r-help@r-project.org Subject Re: [R] Yule Kendall resistant measure of skewness Dear Tolga, See equation 2.6 here. Also try this: # Yule Kendall resistant

Re: [R] getting multiple argument names

2008-06-27 Thread Gabor Grothendieck
Try: RSiteSearch(names of objects passed as ...) On Fri, Jun 27, 2008 at 11:48 AM, whizvast [EMAIL PROTECTED] wrote: hi, all- i wrote a function that accept multiple arguments, but don't know how to assign names automatically. run the following code: foo - function (...) { x =

Re: [R] question on affylmGUI / oneChannelGUI

2008-06-27 Thread Martin Morgan
Bogdan Tanasa [EMAIL PROTECTED] writes: Hi everyone. Actually, you don't want to say hi to _everyone_; you sent your mail to three different news groups, but should have sent it to the single news group that will be most helpful to you. You should have sent your email to the Bioconductor

[R] Recoding

2008-06-27 Thread Agustin Lobo
Hi! Given a vector (or a factor within a df),i.e. v1 - c(1,1,1,2,3,4,1,10,3) and a dictionary cbind(c(1,2,3),c(1001,1002,1003)) is there a function (on the same line than recode() in car) to get v2 as c(1001,1001,1001,1002,1003,4,1001,10,1003) ? I'm using myself a function based on match()

Re: [R] Problems exporting graphs

2008-06-27 Thread stephen sefick
I'll surely look into it. Stephen On Fri, Jun 27, 2008 at 1:43 PM, hippie dream [EMAIL PROTECTED] wrote: This is solved for me. Upgrading R to 2.7.1 sorted out the issue somehow. Maybe there is a problem with Ubuntu 8.04 and R 2.6.2. Or maybe some other package was installed that fixed it.

Re: [R] Recoding

2008-06-27 Thread Jorge Ivan Velez
Dear Agustin, Perhaps v1 - c(1,1,1,2,3,4,1,10,3) dput(as.numeric(ifelse(v1%in%c(1,2,3),paste(100,v1,sep=),v1))) HTH, Jorge On Fri, Jun 27, 2008 at 2:41 PM, Agustin Lobo [EMAIL PROTECTED] wrote: Hi! Given a vector (or a factor within a df),i.e. v1 - c(1,1,1,2,3,4,1,10,3) and a dictionary

Re: [R] Recoding

2008-06-27 Thread Daniel Folkinshteyn
if there's nothing specific for it, you could probably do it with merge? on 06/27/2008 02:41 PM Agustin Lobo said the following: Hi! Given a vector (or a factor within a df),i.e. v1 - c(1,1,1,2,3,4,1,10,3) and a dictionary cbind(c(1,2,3),c(1001,1002,1003)) is there a function (on the same

Re: [R] Recoding

2008-06-27 Thread Marc Schwartz
on 06/27/2008 01:41 PM Agustin Lobo wrote: Hi! Given a vector (or a factor within a df),i.e. v1 - c(1,1,1,2,3,4,1,10,3) and a dictionary cbind(c(1,2,3),c(1001,1002,1003)) is there a function (on the same line than recode() in car) to get v2 as c(1001,1001,1001,1002,1003,4,1001,10,1003) ? I'm

[R] adtest for weibull distribution

2008-06-27 Thread René Pineda
HiI need help about anderson-darlin test for a weibull distribution in R.Thanks. René _ [[elided Hotmail spam]] e ready. [[alternative HTML version deleted]] __

Re: [R] Alternative of Cairo

2008-06-27 Thread Michael Lawrence
On Fri, Jun 27, 2008 at 12:05 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All, I am a new member to R programming. Am generating some visuals by using Cairo library. But Cairo is not compatible with all compilers May I ask which compiler you are using? There are other vector

Re: [R] plotting prcomp

2008-06-27 Thread Dan Bolser
2008/6/27 Prof Brian Ripley [EMAIL PROTECTED]: On Fri, 27 Jun 2008, Prof Brian Ripley wrote: On Fri, 27 Jun 2008, Dan Bolser wrote: Please consider the following PCA example; my.df - data.frame(A=(x - rnorm(100,mean=100, sd=10)), B=(y - x + rnorm(100,mean=10, sd=10)))

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-27 Thread Daniel Folkinshteyn
if you want the frequency scale rather than density scale, then leave hist as is (by default it uses the frequency scale), and rescale the density by multiplying it by the appropriate NOBS. on 06/27/2008 01:16 PM Thomas Frööjd said the following: Hi Thank you very much for taking time to

[R] cumulative sum of within levels of a dataframe

2008-06-27 Thread Levi Waldron
This one should be easy but it's giving me a hard time mostly because tapply puts the results in a list. I want to calculate the cumulative sum of a variable in a dataframe, but with the accumulation only within each level of a factor. For a very simple example, take: df -

Re: [R] cumulative sum of within levels of a dataframe

2008-06-27 Thread Erik Iverson
Just use ?unlist df$willdo - unlist(tapply(df$x, df$fac, cumsum)) df$ideal - df$willdo - df$x Levi Waldron wrote: This one should be easy but it's giving me a hard time mostly because tapply puts the results in a list. I want to calculate the cumulative sum of a variable in a dataframe, but

Re: [R] cumulative sum of within levels of a dataframe

2008-06-27 Thread Gavin Simpson
On Fri, 2008-06-27 at 16:52 -0400, Levi Waldron wrote: This one should be easy but it's giving me a hard time mostly because tapply puts the results in a list. I want to calculate the cumulative sum of a variable in a dataframe, but with the accumulation only within each level of a factor.

Re: [R] cumulative sum of within levels of a dataframe

2008-06-27 Thread Gabor Grothendieck
Try this: df$wildo - ave(df$x, df$fac, FUN = cumsum) On Fri, Jun 27, 2008 at 4:52 PM, Levi Waldron [EMAIL PROTECTED] wrote: This one should be easy but it's giving me a hard time mostly because tapply puts the results in a list. I want to calculate the cumulative sum of a variable in a

  1   2   >