Re: [R] Loading same libraries (old version newest version) in r

2009-10-12 Thread Patrick Connolly
On Mon, 12-Oct-2009 at 10:54AM +1100, Steven Kang wrote: | Hi all, | | I require 2 RMySQL libraries in order to query from a database. You mean you require 2 RMySQL packages. We must be pedantic to answer your question. | | 'RMySQL_0.7-4' (newest version) results in an error when more than 1

Re: [R] user input in R

2009-10-12 Thread Petr PIKAL
And try also search statsrus The first hit shall be Paul Johnsons's howto's which helped me several years ago especially with basic issues. Regards Petr r-help-boun...@r-project.org napsal dne 10.10.2009 18:00:19: I'm just learning R (I don't know any other programming languages),

[R] field index given name.

2009-10-12 Thread tdm
Hi, How do I access the index number of a field given I only know the field name? eg - I want to set the probability of the field 'species' higher than the other fields to use in sampling. colprob - array(dim=NCOL(iris)) for(i in 1:NCOL(iris)){colprob[i]=0.5} colprob[iris$species] = 1 #this

Re: [R] Loading same libraries (old version newest version) in r

2009-10-12 Thread Prof Brian Ripley
On Mon, 12 Oct 2009, Patrick Connolly wrote: On Mon, 12-Oct-2009 at 10:54AM +1100, Steven Kang wrote: | Hi all, | | I require 2 RMySQL libraries in order to query from a database. You mean you require 2 RMySQL packages. We must be pedantic to answer your question. | | 'RMySQL_0.7-4' (newest

Re: [R] field index given name.

2009-10-12 Thread Schalk Heunis
Hi Phil Try the following which(names(iris)=='Species') [1] 5 HTH Schalk Heunis On Mon, Oct 12, 2009 at 8:53 AM, tdm ph...@philbrierley.com wrote: Hi, How do I access the index number of a field given I only know the field name? eg - I want to set the probability of the field 'species'

Re: [R] field index given name.

2009-10-12 Thread tdm
Thanks - would never have guessed that. I eventually got the following to do what I want... colprob - array(dim=NCOL(iris)) for(i in 1:NCOL(iris)){ + colprob[i]= + ifelse(names(iris)[i] == 'Species',1,0.5) + } colprob [1] 0.5 0.5 0.5 0.5 1.0 Schalk Heunis-2 wrote: Hi Phil Try the

[R] Help Error

2009-10-12 Thread Arif Chandra
Hi R-users, I would like to ask question related to error output. If an error comments come out, then the program will automatically stop. I want to ask , how I can still continue the program even though there is an error comment? var=VAR(Canada,p=3,type=const) for (j in 1:nrow(com)) {

Re: [R] Help Error

2009-10-12 Thread Schalk Heunis
This may be of some help:?try On Mon, Oct 12, 2009 at 9:42 AM, Arif Chandra arif.chan...@hotmail.comwrote: Hi R-users, I would like to ask question related to error output. If an error comments come out, then the program will automatically stop. I want to ask , how I can still continue the

[R] Position of legend box

2009-10-12 Thread ogbos okike
Good morning to you. I have about 4 different lines in one plot. I have used legend to indicate the colour of each plot. But the box contain the legend covers part of the lines thereby blurring the legend. There are some spaces in the plot that are empty and large enough to accommodate the legend

[R] package nlme

2009-10-12 Thread wenjun zheng
Hi R Users, When I use package nlme for linear model with random effects, there exists errors and I don't know the data structure of lme. Here is my data: Rice-data.frame(Yield=c(8,7,4,9,7,6,9,8,8,8,7,5,9,9,5,7,7,8,8,8,4,8,6,4,8,8,9),

Re: [R] package nlme

2009-10-12 Thread ONKELINX, Thierry
You did not specify the random effects. Try something like Rice.lme-lme(Yield ~ Variety + Stand,data=Rice, random = ~1|Block) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research

[R] Problem Fixed

2009-10-12 Thread ogbos okike
I write to thank all those who have helped me to fix this problem. Best regards Ogbos 2009/10/7 ogbos okike ogbos.ok...@gmail.com Good morning. I wish to plot two data on the same axis. I tried plot(x,y, type = l) for the first and tried to use lines or points(x,y, lty = 2, col = 4) to add or

[R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread romunov
Dear List, today I turn to you with a next problem. I'm trying to compare species richness between various datasets (locations) using species accumulation curves (Chapter 4, page 54 in Tree diversity analysishttp://www.worldagroforestry.org/treesandmarkets/tree_diversity_analysis.aspby Kindt

Re: [R] Creating a Clustered-Stacked Column Chart

2009-10-12 Thread Jim Lemon
On 10/12/2009 01:53 AM, zhijie zhang wrote: Thanks. I think there may be no easy method to achive it. library(lattice) barchart(Titanic, scales = list(x = free),auto.key = list(title =Survived),layout=c(4,1),horizontal = FALSE) The above method generates four graphs, two graphs in the left

Re: [R] plot the same types of graphics on the same R graphic device

2009-10-12 Thread carol white
one example is to plot two vectors against each other and then, to plot the CI (confidence interval) of each point on the same graphics. The first could be done by plot and the second by plotCI in gplots package but how to plot on the same R graphic device? Look forward to your reply, --- On

Re: [R] plot the same types of graphics on the same R graphic device

2009-10-12 Thread Jim Lemon
On 10/12/2009 08:47 PM, carol white wrote: one example is to plot two vectors against each other and then, to plot the CI (confidence interval) of each point on the same graphics. The first could be done by plot and the second by plotCI in gplots package but how to plot on the same R graphic

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread joris meys
Dear Roman, could you give us the trace given by traceback() ? I suspect the error is resulting from the permutations and/or jackknife procedure in the underlying functions specaccum and specpool. You can take a look at the package R.huge, but that one is deprecated already. There are other

[R] Non linear fitting of 2 distributions with shared parameters

2009-10-12 Thread Etienne Toffin
Hi, I need to compare non-linear fittings of 2 different experimental distributions. I use nls() to the fit the 2 distribution and it works pretty well. The statistical comparison of 2 non linear fits is well described in the book Fitting Models to Biological Data using Linear and

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread romunov
Hello joris, this is the traceback() output. Hopefully you can make some sense out of it. Thank you for the tips as well (R.huge looks promising)! traceback() 7: vector(integer, length) 6: integer(nbins) 5: tabulate(bin, pd) 4: as.vector(data) 3: array(tabulate(bin, pd), dims, dimnames = dn) 2:

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread joris meys
Hi Roman, that throws a different light on the problem. It goes wrong from the start, so it has little to do with the bootstrap or jackknife procedures. R.huge won't help you either. Likely your error comes from the fact that factor1 is not an argument of the function accumcomp. the argument is

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread romunov
Hi Joris, thanks for spotting that one. This little mistake has gotten in when I was trying desperate things with the analysis (factor1 is used in diversitycomp). Nevertheless, here is the result: poacc2 - accumcomp(PoCom, y=PoEnv, factor=HM_sprem, method=exact) Error in if (p == 1) { :

Re: [R] field index given name.

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 3:22 AM, tdm wrote: Thanks - would never have guessed that. I eventually got the following to do what I want... colprob - array(dim=NCOL(iris)) for(i in 1:NCOL(iris)){ + colprob[i]= + ifelse(names(iris)[i] == 'Species',1,0.5) + } colprob [1] 0.5 0.5 0.5 0.5 1.0

Re: [R] Position of legend box

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 4:07 AM, ogbos okike wrote: Good morning to you. I have about 4 different lines in one plot. I have used legend to indicate the colour of each plot. But the box contain the legend covers part of the lines thereby blurring the legend. There are some spaces in the plot

Re: [R] is that possible to graph 4 dimention plot

2009-10-12 Thread joris meys
I'm basically put off by the question itself. Plotting a 4-dimensional graph is rather complicated if the world has only 3 dimensions. A 4-dimensional representation is typically a movie (with time as the 4th dimension). You could try to project a heatmap on a 3D surface graph, but I doubt this

[R] List mappings and variable creation

2009-10-12 Thread Michael Pearmain
Hi All, I have a questions about associative list mappings in R, and if they are possible? I have data in the form show below, and want to make a new 'bucket' variable called combined. Which is the sum of the control and the exposed metric values This combined variable is a many to many matching

[R] R and computer size

2009-10-12 Thread Vibe Henriette Skov
Dear R-mailing list Hope you can help me. I am using R for windows to analyze my 107 HGU133Plus2.0 chips, however, R chrash when I try to use ReadAffy(). I want to buy a computer that can handle all these arrays, do you know how big a computer I need to buy? Best, Skov, Denmark

Re: [R] svy / weighted regression

2009-10-12 Thread Laust
Dear Peter, Thanks for the input. The zero rates in some strata occurs because sampling depended on case status: In Finland only 50% of the non-cases were sampled, while all others were sampled with 100% probability. Best Laust On Sat, Oct 10, 2009 at 11:02 AM, Peter Dalgaard

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Terry Therneau
-- begin included Greetings! I want to follow the evolution of a Nelder-Mead function minimisation (a function of 2 variables). Hence each simplex will have 3 vertices. Therefore I would like to have a function which can output the coordinates of the 3 vertices after each new

Re: [R] svy / weighted regression

2009-10-12 Thread David Winsemius
I think you are missing the point. You have 4 zero death counts associated with much higher person years of exposure followed by 4 death counts in the thousands associated with lower degrees of exposures. It seems unlikely that these are real data as there are not cohorts that would

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Ted Harding
On 12-Oct-09 13:24:01, Terry Therneau wrote: -- begin included Greetings! I want to follow the evolution of a Nelder-Mead function minimisation (a function of 2 variables). Hence each simplex will have 3 vertices. Therefore I would like to have a function which can output

Re: [R] R and computer size

2009-10-12 Thread Martin Morgan
Vibe Henriette Skov wrote: Dear R-mailing list Hope you can help me. I am using R for windows to analyze my 107 HGU133Plus2.0 chips, however, R chrash when I try to use ReadAffy(). I want to buy a computer that can handle all these arrays, do you know how big a computer I need to buy? Hi

Re: [R] Error: cannot allocate vector of size 1.2 Gb

2009-10-12 Thread joris meys
That's the file I needed, and the problem I expected. The factor you specify is not a factor, but a numerical variable. Even more, if you tabulate it, you have 2 times the values 1, 2 and 5, and all other values only once. That's what gives you the error. p is an internal variable of the function

[R] RPostgreSQL and needed .dlls

2009-10-12 Thread Josuah Rechtsteiner
Dear List, I am trying to connect from R 2.9.2 on Win XP SP3 to a remotely installed PostgreSQL DB (8.3.7 on Ubuntu Server 9.04). Everything seems to be properly installed, as I can connect to the DB from within Excel and RKWard (running on another machine). But regarding R on the Win XP,

[R] need help

2009-10-12 Thread MOH MOHA
Sample Size λ=5      α = 4       β = 3 Min. 1St Qu. Median Mean 3rd Qu. Max. 100 0.00 1.740638 4.040032 4.433828 5.607589 22.450405

[R] function: ploting an igraph object within lattice

2009-10-12 Thread Andrewjohnclose
Hi, I would like to be able to develop a function to plot an igraph object with lattice (trellis type displays will be usefull for grouping etc). Anyway, I mostly feeble Igraph requires that you convert two columns of data two an igraph object and to be able to plot the graph...I have tried a

[R] R commander.

2009-10-12 Thread Ilyas .
i have two RData files,,i want to print them to check the format of the tables in these files,,,i can load both the files and can read it as well load('ann.RData') str(ann) List of 4 $ Name : chr [1:561466] rs3094315 rs12562034 rs3934834 rs9442372 ... $ Position : int [1:561466] 742429

Re: [R] how to output profile plots for groups using lattice package

2009-10-12 Thread George Kalema
Hi Peter (and anyone else willing to help me out), Many thanks for your help. Having used your code plus a few other modifications, I only get the points plotted but without the two lines. I just cannot figure out what the problem is. My code is as follows: library(lattice) datos2 -

[R] Using diff, ifelse on zoo object

2009-10-12 Thread charliegenge
Hi, I'm having an issue when using diff and ifelse on a zoo object. x.Date - as.Date(2003-02-01) + c(1, 3, 7, 9, 14) - 1 x - zoo(rnorm(5), x.Date) x.POS - c(0,0,0,1,1) x- merge(x,x.POS) x x x.POS 2003-02-01 -0.1858136 0 2003-02-03 -1.3188533 0

[R] Vector Allocation -problem

2009-10-12 Thread premmad
When i tried running Zip-sqldf(select a.*,b.s_lv from Zip a inner join lin b on a.S=B.S) Error: cannot allocate vector of size 15.6 Mb and with following warning Warning messages: 1: In as.list.data.frame(X) : Reached total allocation of 1024Mb: see help(memory.size) 2: In

[R] tktext-window smaller than text

2009-10-12 Thread Anne Skoeries
Hi there, I need to build up a tktext-widget that contains a longer text than the tktext-widget actually is. So what I mean is, that the tktext window is of width=100 and the text in it has a length greater 100. But I don't want the window to just wrap the line, but to belong to

[R] Ordinal response model

2009-10-12 Thread drlucyasher
I have been asked to analyse some questionnaire data- which is not data I'm that used to dealing with. I'm hoping that I can make use of the nabble expertise (again). The questionnaire has a section which contains a particular issue and then questions which are related to this issue (and

Re: [R] R commander.

2009-10-12 Thread David Winsemius
You seem to have gotten an extraneous list item called Chromosome to which an empty string has been assigned. What happens if you issue this command: ann2 - data.frame( Name=ann$Name, Position=ann$Position, Chr.num=factor(ann$Chr.num) ) (I took the liberty of making Chr.num into a

Re: [R] field index given name.

2009-10-12 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of tdm Sent: Monday, October 12, 2009 12:22 AM To: r-help@r-project.org Subject: Re: [R] field index given name. Thanks - would never have guessed that. I eventually got the

[R] xyplot does not find variable in data

2009-10-12 Thread Jacob Wegelin
When we call a lattice function such as xyplot, to what extent does the data designation cause the function to look inside the data for variables? In the examples below, the subset argument understands that Variety is a variable in the data. But the scales argument does not understand that nitro

[R] combining/overlaying boxplot and barplot

2009-10-12 Thread Soenario, Ivan (KNMI)
Dear all, I would like to visualise when days are rainy or dry in bar/boxplots. Therefore I've tried to combine raingauge data (boxplots) and percentage of raingauges with 0mm measurements (barplot). See attachment mei2004.pdf (if it came through). I've come this far: barplot(dcp0[monthindex],

Re: [R] spectral analysis

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 5:24 AM, sdlywjl666 wrote: Dear all£¬ Is there some functions to estimate the spectrum by the fft of autocorrelation? The blindingly obvious search terms: fft spectrum autocorrelation ... in two hops to what appears to be a function to this: Auto And/Or Cross

[R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Mark Kimpel
I'm trying to use mtext to create a main title over multiple plots. Below is a simple self-contained example and my sessionInfo (I should note I've also tried this with R-2.8.1 with the same results). When I execute the code chunk below, I get the plots, but no title. I've tried this using the

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Tony Plate
Try playing around with the oma setting in par() -- it sets the outer margins, which by default are zero. The following shows the mtext label for me, using the windows device: par(mfrow=c(2,2)) par(oma) [1] 0 0 0 0 par(oma=c(0,0,2,0)) for (i in 1:4) plot(0:1,0:1) mtext(text = my test plots,

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 1:41 PM, Tony Plate wrote: Try playing around with the oma setting in par() -- it sets the outer margins, which by default are zero. The following shows the mtext label for me, using the windows device: par(mfrow=c(2,2)) par(oma) [1] 0 0 0 0 par(oma=c(0,0,2,0)) for

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Dieter Menne
Mark Kimpel wrote: I'm trying to use mtext to create a main title over multiple plots. Below is a simple self-contained example and my sessionInfo (I should note I've also tried this with R-2.8.1 with the same results). When I execute the code ... Thanks for your nice example

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Simon Bonner
Hey Mark, The text is actually there -- I can just see the bottom of the 'y' and the 'p' in my plotting window. You can move the text down (into the plot) with the argument line. E.g.: mtext(text = my test plots, side = 3, outer = TRUE, line=-2) Hope that helps... - Simon Bonner

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread Greg Snow
Since you are using LaTeX, you might consider creating the plots all in 1 step, but use the tikzdevice, this provides LaTeX (pgf) commands to create the plot that you can then insert LaTeX commands to built up the plot bit by bit. You could also look at using the subplot function in the

Re: [R] Ordinal response model

2009-10-12 Thread Dieter Menne
drlucyasher wrote: The questionnaire has a section which contains a particular issue and then questions which are related to this issue (and potentially to each other): 1) importance of the issue (7 ordinal categories from -3 to +3) 2) impact of the impact (7 ordinal categroies from -3

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread Greg Snow
This only works if all the plots are the same size and the defaults are used for the margins. Try it with different sized figure regions in layout, the added lines don't match at the end. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] Speed up and limit memory usage of lm()

2009-10-12 Thread Dieter Menne
gauti wrote: I have been doing series of linear regression models lm(). In this case the execution time and memory usage becomes a huge issue. I have therefore been trying to speed the process and limit the memory usage. Have a look at package biglm. Dieter -- View this message

[R] mkdir in R?

2009-10-12 Thread Peng Yu
Hi, Besides calling shell command mkdir by system(), I'm wondering if there is a buildin command in R to make a new directory. Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-12 Thread baptiste auguie
Interesting, I hadn't tried this but it probably explains why navigation to different regions of a layout is neither documented nor advisable. Yet another alternative is to use Grid graphics. In particular, 1- lattice or ggplot2 provide ways to arrange several plots in a rectangular layout, with

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Bert Gunter
Deepayan will correct me if I'm wrong, but I'm pretty sure that the answer is that it looks in the frame in the data argument only for variables in the formula argument. Note that the fact that it also works for the subset argument is explicitly mentioned therein: subset: logical or integer

Re: [R] mkdir in R?

2009-10-12 Thread Erik Iverson
?dir.create -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Monday, October 12, 2009 1:01 PM To: r-h...@stat.math.ethz.ch Subject: [R] mkdir in R? Hi, Besides calling shell command mkdir by system(), I'm

Re: [R] mkdir in R?

2009-10-12 Thread Henrique Dallazuanna
Try dir.create On Mon, Oct 12, 2009 at 3:00 PM, Peng Yu pengyu...@gmail.com wrote: Hi, Besides calling shell command mkdir by system(), I'm wondering if there is a buildin command in R to make a new directory. Regards, Peng __

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Deepayan Sarkar
On Mon, Oct 12, 2009 at 9:32 AM, Jacob Wegelin jacob.wege...@gmail.com wrote: When we call a lattice function such as xyplot, to what extent does the data designation cause the function to look inside the data for variables? In the examples below, the subset argument understands that Variety

[R] crosstabulation and unlist function

2009-10-12 Thread eugen pircalabelu
Hello R-users, My toy example: aa-c(1:5) bb-c(NA,2,NA,4,5) cc-c(1,2,NA,4,NA) dd-c(A,B,B,A,C) df-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation between table(unlist(df[,1:3])) and df$dd? I want to find out

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Mark Kimpel
Thanks Tony (and others). Setting oma corrects the problem. Mark Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, Mobile VoiceMail (317) 399-1219 Skype No Voicemail please On Mon,

[R] Using tabs in output instead of spaces

2009-10-12 Thread ws
Is there a way to have xtabs and friends use tabs in their output to separate columns rather than spaces? It would be great for importing into other software. TIA! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Using tabs in output instead of spaces

2009-10-12 Thread Erik Iverson
?write.table is probably a good starting point. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ws Sent: Monday, October 12, 2009 1:39 PM To: r-h...@stat.math.ethz.ch Subject: [R] Using tabs in output instead of spaces Is

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Romain Francois
On 10/12/2009 08:30 PM, Deepayan Sarkar wrote: On Mon, Oct 12, 2009 at 9:32 AM, Jacob Wegelinjacob.wege...@gmail.com wrote: When we call a lattice function such as xyplot, to what extent does the data designation cause the function to look inside the data for variables? In the examples below,

Re: [R] Using diff, ifelse on zoo object

2009-10-12 Thread Gabor Grothendieck
The problem is that ifelse does not work the way you might think (see value section of ?ifelse) and basically should not be used with three zoo objects unless the three arguments to ifelse have the same time index. We can get that effect by using na.pad = TRUE in your diff call: TradedRate -

[R] How to hide tick lines behind the box-and-whisker 's in a boxplot

2009-10-12 Thread Helmer Belbo
Dear R people, I wonder how to hide tick lines behind other figures in a plot, e.g. in a boxplot. # Sample code: x- c(rep(4,50),rep(5,20),rep(6,50),rnorm(20,5,1)) boxplot(x) axis(2,tck=1,col.ticks='grey',lty=5 ) # end of sample code The tick lines is put on top of the box-plot, but I would

Re: [R] Trendline for a subset of data

2009-10-12 Thread Greg Snow
Others have show how to use the segments function, but this can also be done using the original abline function along with the clip function. Here is an example: plot( iris$Petal.Width, iris$Petal.Length, col=c('red','green','blue')[iris$Species]) tmp - levels(iris$Species) tmp2 -

Re: [R] crosstabulation and unlist function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 2:36 PM, eugen pircalabelu wrote: Hello R-users, My toy example: aa-c(1:5) bb-c(NA,2,NA,4,5) cc-c(1,2,NA,4,NA) dd-c(A,B,B,A,C) df-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation between

Re: [R] crosstabulation and unlist function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 3:25 PM, David Winsemius wrote: On Oct 12, 2009, at 2:36 PM, eugen pircalabelu wrote: Hello R-users, My toy example: aa-c(1:5) bb-c(NA,2,NA,4,5) cc-c(1,2,NA,4,NA) dd-c(A,B,B,A,C) df-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to

Re: [R] crosstabulation and unlist function

2009-10-12 Thread eugen pircalabelu
Hello, First of all, thank you David for your reply, but sadly this is not what i wanted (i am sorry for not being more specific about my problem!) aa-c(1:5) bb-c(NA,2,NA,4,5) cc-c(1,2,NA,4,NA) dd-c(A,B,B,A,C) table(unlist(df[,1:3])) df aa bb cc dd 1 1 NA 1 A 2 2 2 2 B 3 3 NA

[R] Creating object referant from argument name

2009-10-12 Thread Maxwell Reback
Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something-function(input){ id-substring(input,3,3) j-list1 if(id==2)j-list2 if(id==3)j-list3 if(id==4)j-list4 ...} Instead of all these if() arguments, I was hoping to use

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Bert Gunter
What principle is at work? A strange one called standard non-standard evaluation; see http://developer.r-project.org/nonstandard-eval.pdf for a nice overview by Thomas Lumley. ?xyplot says: data: For the 'formula' method, a data frame containing values (or more

Re: [R] Creating object referant from argument name

2009-10-12 Thread Rolf Turner
On 13/10/2009, at 9:14 AM, Maxwell Reback wrote: Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something-function(input){ id-substring(input,3,3) j-list1 if(id==2)j-list2 if(id==3)j-list3 if(id==4)j-list4 ...} Instead

Re: [R] Creating object referant from argument name

2009-10-12 Thread jim holtman
try this: (?get) j- get(paste(list,substring(input,3,3),sep=)) On Mon, Oct 12, 2009 at 4:14 PM, Maxwell Reback mreb...@gmail.com wrote: Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something-function(input){

Re: [R] crosstabulation and unlist function

2009-10-12 Thread rmailbox
What you're really saying is that you don't care about the distinction between aa, bb and cc. In that case, a different arrangement of the data will be more useful: library (reshape ) df.melt - melt ( df, id.var = dd) with ( df.melt, table ( dd, value ) ) Eric - Original message -

Re: [R] crosstabulation and unlist function

2009-10-12 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eugen pircalabelu Sent: Monday, October 12, 2009 1:06 PM To: David Winsemius Cc: R-help Subject: Re: [R] crosstabulation and unlist function Hello, First of all, thank you

Re: [R] how to plot a data by different group

2009-10-12 Thread Ista Zahn
Hi Catherine, Assuming your variables are in a dataframe called myData, some variation of the following may be what you want: library(ggplot2) myData.m - melt(myData, measure.vars=c(Y1, Y2)) qplot(X, value, colour=variable, shape=groupf3, facets=groupf1~groupf2, geom=point, data=myData.m) -Ista

[R] lapply / mapply and assignments

2009-10-12 Thread Magnus Torfason
I have a list of isometric structures, and I want to change the same part of each structure in the list, assigning one element of a vector to each of these parts. In other words, I want to achieve the following: l - list( list(a=1,b=2), list(a=3,b=4)) unlist(lapply(l, [[, a)) [1] 1 3 #

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Charles C. Berry
On Mon, 12 Oct 2009, Magnus Torfason wrote: I have a list of isometric structures, and I want to change the same part of each structure in the list, assigning one element of a vector to each of these parts. In other words, I want to achieve the following: l - list( list(a=1,b=2),

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Charles C. Berry
Hmmm, after thinking about it, better see ?mapply SIMPLIFY logical; attempt to reduce the result to a vector or matrix? Try mapply( ..., SIMPLIFY=FALSE ) HTH, Chuck On Mon, 12 Oct 2009, Magnus Torfason wrote: I have a list of isometric structures, and I

Re: [R] lapply / mapply and assignments

2009-10-12 Thread Gabor Grothendieck
Try: mapply(..., SIMPLIFY = FALSE) On Mon, Oct 12, 2009 at 5:25 PM, Magnus Torfason zulutime@gmail.com wrote: I have a list of isometric structures, and I want to change the same part of each structure in the list, assigning one element of a vector to each of these parts. In other

Re: [R] xyplot does not find variable in data

2009-10-12 Thread Peter Ehlers
One other way that is sometimes useful is to use the tick.number argument as in: xyplot(yield ~ nitro, data=Oats, scales=list(x=list(tick.number=4)), subset=Variety==Victory ) This is especially handy if you want to just tick/label every other value. -Peter Ehlers Jacob Wegelin wrote:

Re: [R] how to output profile plots for groups using lattice package

2009-10-12 Thread Peter Ehlers
Hi George, Your problem is not with xyplot, but with the NA occurrences in your data. Try adding subset = {!is.na(MSE)}, to your xyplot call, or (better), subset the data before calling xyplot. -Peter Ehlers George Kalema wrote: Hi Peter (and anyone else willing to help me out), Many

Re: [R] What is the correct way to define __hash__?

2009-10-12 Thread Peng Yu
On Mon, Oct 12, 2009 at 4:03 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-10-12 15:45 PM, Peng Yu wrote: Hi, I'm wondering what is the general way to define __hash__. I could add up all the members. But I am wondering if this would cause a performance issue for certain classes.

[R] Invoking par(mfrow...) on an already subdivided plot

2009-10-12 Thread Maxwell Reback
I'd like to generate on a single device multiple plots, each of which contains two plots. Essentially, I've got sub-plots which consist of two tracks, the upper one displaying gene expression data, and the lower one mapping position. I'd like to display four of these two-track sub-plots on one

Re: [R] How to hide tick lines behind the box-and-whisker 's in a boxplot

2009-10-12 Thread Peter Ehlers
Helmer, You can just place another boxplot on top of the first like this: boxplot(x) axis(2,tck=1,col.ticks='grey',lty=5 ) boxplot(x, col=white, add=TRUE) -Peter Ehlers Helmer Belbo wrote: Dear R people, I wonder how to hide tick lines behind other figures in a plot, e.g. in a

[R] Kolmogorov smirnov test

2009-10-12 Thread Roslina Zakaria
Hi r-users,   I would like to use Kolmogorov smirnov test but in my observed data(xobs) there are ties.  I got the warning message.  My question is can I do something about it?   ks.test(xobs, xsyn)       Two-sample Kolmogorov-Smirnov test data:  xobs and xsyn D = 0.0502, p-value = 0.924

[R] Re use objects from within a custom made function

2009-10-12 Thread Stropharia
Hi everyone, i'm having a problem extracting objects out of functions i've created, so i can use them for further analysis. Here's a small example: # --- test - function(i, j){ x - i:j y - i*j z - i/j return(x,y,z) } #

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Tony Plate
test$x doesn't evaluate the function, you want something like test(1,2)$x, e.g.: test - function(i, j){ x - i:j y - i*j z - i/j return(list(x=x,y=y,z=z)) } test(1,2)$x [1] 1 2 test(1,2)$y [1] 2 test(1,2)$z [1] 0.5 Or if you want to avoid evaluating your

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Stropharia Sent: Monday, October 12, 2009 4:07 PM To: r-help@r-project.org Subject: [R] Re use objects from within a custom made function Hi everyone, i'm having a

[R] Lattice barchart-reordered

2009-10-12 Thread Veerappa Chetty
Hi,Can I use reorder function with barchart as in dotchart? Here are some codes which do not work for me. Thanks Chetty ___ a1c.cast$bmi.cat.reordered[a1c.cast$eth!=Other] -with(a1c.cast[a1c.cast$eth!=Other,],reorder(bmi.cat.ordered[a1c.cast$eth!=Other], BP.FN.RATE,median

[R] vis.gam() contour plots

2009-10-12 Thread Jason Gasper
Greetings, I have what I hope is a simple question. I would like to change my contour interval on the vis.gam( plot.type=contour) in the mgcv package. Is this a situation where I need to modify the function or is there a default value I can change? Thanks

[R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread wk y
Hi, all, My objective is to split a dataframe named cmbine according to the value of classes. After the split, I will take the first instance from each class and bin them into a new dataframe, df1. In the 2nd iteration, I will take the 2nd available instance and bin them into another new

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread cls59
wk yeo wrote: Hi, all, My objective is to split a dataframe named cmbine according to the value of classes. After the split, I will take the first instance from each class and bin them into a new dataframe, df1. In the 2nd iteration, I will take the 2nd available instance and bin

[R] gee: suppress printout

2009-10-12 Thread joshua wells
I'm using the function gee from the library(gee) gee(Y~X,id=clust.id,corstr=exchangeable,b=tmc$coef,family=binomial(link=logit),silent=T) Every time it runs, it dutifully prints out Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 user's initial regression estimate

[R] variable selection

2009-10-12 Thread Weiwei Shi
Hi there, Can anyone suggest some packages in R doing variable selections in predictive modeling besides randomForest? Faster, better. Any also in clustering analysis? Thanks, Weiwei -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. Did you always know? No, I did not. But I believed...

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread Stropharia
Thanks a lot Tony and Daniel for making that clear. best, Steve Stropharia wrote: Hi everyone, i'm having a problem extracting objects out of functions i've created, so i can use them for further analysis. Here's a small example: # --- test - function(i,

Re: [R] Re use objects from within a custom made function

2009-10-12 Thread David Winsemius
On Oct 12, 2009, at 7:06 PM, Stropharia wrote: Hi everyone, i'm having a problem extracting objects out of functions i've created, so i can use them for further analysis. Here's a small example: # --- test - function(i, j){ x - i:j y - i*j

  1   2   >