[R] Error in La.svd(X) : error code 1 from Lapack routine 'dgesdd'

2007-03-05 Thread Sophie Richier
Dear R helpers, I am working with R 2.4.1 GUI 1.18 (4038) for MacOSX. I have a matrix of 10 000 genes and try to run the following commands: model.mix-makeModel (data=data, formula=~Dye+Array+Sample+Time, random=~Array+Sample) anova.mix-fitmaanova (data, model.mix) test.mix-matest (data,

[R] about find the solution

2007-03-05 Thread EMA_CHO
If I want to find out the soltion of X1,X2 that min(3X1+2X2+X1X2) subject to 20=X1+3X2=50 10=X1 which function or package can I use? Thanks. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread Petr Pikal
Hi you probably know that the second column are dates but your poor PC does not, so you should to tell him. You have several options: Change the column to suitable date format - see chron package or help pages related to date functions e.g. strptime, as.Date, ... and perform your plot.

Re: [R] lattice histogram

2007-03-05 Thread Renaud Lancelot
See argument drop.unused.levels in xyplot. You will also need to manage the case n = 0 for dispalying the mean and stdv. Best, Renaud histogram(~ resp | group, drop.unused.levels = FALSE, panel = function(x, ...){ std - if(length(x) 0) format(round(sd(x), 2), nsmall = 2) else NA n -

[R] Non : Confidence intervals for p**2 ??

2007-03-05 Thread Öhagen Patrik
Dear List, I was asked to calculate a confidence interval for p*p. Is there any standard techniques for calculating such an interval? Delta Method? Thank you in advance! Cheers, Patrik __ R-help@stat.math.ethz.ch mailing list

Re: [R] Scoping issue?

2007-03-05 Thread jim holtman
It is not really an argument to mmatplot; it is an argument to mapply and I am not certain what might be happening in there with respect to lazy evaluation. Yes you can set it up with lapply, but I don't think speed is a concern since most of the time is being spent in the matplot routine. If

[R] Heteroskedastic Time Series

2007-03-05 Thread james
Hi R-helpers, I'm new to time series modelling, but my requirement seems to fall just outside the capabilities of the arima function in R. I'd like to fit an ARMA model where the variance of the disturbances is a function of some exogenous variable. So something like: Y_t = a_0 + a_1 * Y_(t-1)

Re: [R] Non : Confidence intervals for p**2 ??

2007-03-05 Thread Ted Harding
On 05-Mar-07 Öhagen Patrik wrote: Dear List, I was asked to calculate a confidence interval for p*p. Is there any standard techniques for calculating such an interval? Delta Method? Thank you in advance! Cheers, Patrik If p is meant to denote a probability between 0 and 1, then

Re: [R] How to read in this data format?

2007-03-05 Thread Bart Joosen
Hi, Although the solution worked, I'v got some troubles with some data files. These datafiles are very large (600-700 MB), so my computer starts swapping. If I use the code, written below, I get: Error in .Call(R_lazyLoadDBfetch, key, file, compressed, hook, PACKAGE = base) : recursive

[R] Difference between two time series

2007-03-05 Thread Deb Midya
Hi R Users! Thanks in advance. I am using R 2.4.1 on windows XP. I have a series of (x[i,t], y[i,t]), say i = 1, 2, .., n and t = t1, t2, .., tT. The n is large in number. The series y[i,t] is constructed from x[i,t] using moving average of order o (say o = 30

Re: [R] barplot with different color combination for each bar

2007-03-05 Thread Jonne Zutt
Hi, I'd suggest you use ?rect for this. Here's an example (I did not check whether it's correct...) I also improved (but not checked :) your definition of cols. Jonne. X - seq(1:6) Q - matrix(sample(X, 60, replace = T), nrow=6, byrow = T) H - matrix(rep(1,60), nrow=6, byrow=T) color - c(blue,

[R] Error loading a dependency in a package: missing namespace?

2007-03-05 Thread Carlos J. Gil Bellosta
Dear r-helpers, I am building a package that depends on some others. I recently added a new dependency: package outliers. But does not work any more. Let me show some information below: [EMAIL PROTECTED]:pcrAnalysis$ cat DESCRIPTION Package: pcrAnalysis Type: Package Title: pcrAnalysis Version:

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread Alberto Monteiro
Sarthi M. wrote: I want to display dates on my x-axis of the plot. Dates are a problem. There's a standard for dates, but it seems that most users and software didn't catch up :-/ The variable dat is a data frame. The first column has numeric values and second column has date. e.g. dat

Re: [R] function with Multiple Output

2007-03-05 Thread Levent TERLEMEZ
With help of list(), function can return ala of the results. my.fun=function(vector, index){ a=fun.a(vector, index) b=fun.b(vector, index) return(list(a,b)) } Example: R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.1 (2005-12-20 r36812) ISBN

Re: [R] Scoping issue?

2007-03-05 Thread Luke Tierney
In your test function there is no lexically visible definition for the `colnum` variable used in defining main, so that error is what you expect from lexical scoping. Lazy evaluation dictates when (and if) the `main` argument is evaluated, but the environment in which it is evaluated is

[R] RBloomberg

2007-03-05 Thread Shubha Vishwanath Karanth
Hi R, The below are commands used in extracting Bloomberg data. Let T1, T2,...T5 be a set of actual tickers Ticker_list-c(T1, T2, T3, T4, T5) con-blpConnect(show.days=show_day, na.action=na_action, periodicity=periodicity)

[R] background color behind symbols in legend()

2007-03-05 Thread Nicolas Mazziotta
Hello, I try to display coloured rectangles behind symbols in a legend (as a background): plot(10,10) legend(top, c(text,text2), pch=c(21,22), fill=c(red,green), pt.bg=black) On the resulting graph, the symbol is not centered upon the coloured rectangle. Is there a way to adjust their

[R] Identifying points in a plot that have duplicate values

2007-03-05 Thread David Lloyd
I have code like this: - #--- -- x=scan() 0 0 0 0 0 1 2 3 4 y=scan() 1 1 1 2 2 1 3 4 5 plot(x,y) identify(0,1,3) #Allows me to select manually to identify co-ordinate (0,1)

[R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread Rainer M. Krug
Hi I have a plist t which contains size measurements of individual plants, identified by the field plate. It contains, among other, a field year indicating the year in which the individual was measured and the height. The number of measurements range from 1 to 4 measurements in different

Re: [R] Error in La.svd(X) : error code 1 from Lapack routine 'dgesdd'

2007-03-05 Thread Ranjan Maitra
On Mon, 05 Mar 2007 09:14:17 +0100 Sophie Richier [EMAIL PROTECTED] wrote: Dear R helpers, I am working with R 2.4.1 GUI 1.18 (4038) for MacOSX. I have a matrix of 10 000 genes and try to run the following commands: model.mix-makeModel (data=data, formula=~Dye+Array+Sample+Time,

[R] 0 * NA = NA

2007-03-05 Thread Alberto Monteiro
Is there any way to force 0 * NA to be 0 instead of NA? For example, suppose I have a vector with some valid values, while other values are NA. If I matrix-pre-multiply this by a weight row vector, whose weights that correspond to the NAs are zero, the outcome will still be NA: x - c(1, NA, 1)

[R] R CMD CHECK question

2007-03-05 Thread Joerg van den Hoff
hi, second try... I ran into problems when checking one of my packages with R CMD CHECK: I have two packages, the first (named `pkc') depending on the second one (named `roiutils'). The source code and DESCRIPTION files describes the dependency as it should be, I think ('Imports', `require').

[R] [ANN] Static and dynamic graphics course, July 2007, Salt Lake City

2007-03-05 Thread hadley wickham
We're pleased to announce a one day course covering static and dynamic graphics using R, ggplot and GGobi. The course will be held just before the JSM, on Saturday, 28 July 2007, in Salt Lake City. The course will be presented by Dianne Cook and Hadley Wickham. In the course you will learn: *

[R] enumerating non-overlapping pairs of elements from a vector

2007-03-05 Thread Allan Strand
Hi All, I'm trying to come up with a clear and concise (and fast?) solution to the following problem. I would like to take a vector 'v' and enumerate all of the ways in which it can be broken into n sets of length 2 (if the length of the vector is odd, and an additional set of length 1). An

Re: [R] 0 * NA = NA

2007-03-05 Thread Liaw, Andy
From: Alberto Monteiro Is there any way to force 0 * NA to be 0 instead of NA? For example, suppose I have a vector with some valid values, while other values are NA. If I matrix-pre-multiply this by a weight row vector, whose weights that correspond to the NAs are zero, the outcome

Re: [R] 0 * NA = NA

2007-03-05 Thread Petr Klasterecky
Alberto Monteiro napsal(a): Is there any way to force 0 * NA to be 0 instead of NA? No (AFAIK), and it is pretty reasonable to define it this way. If you want to treat the NAs as zeros, use x[is.na(x)] - 0 Petr For example, suppose I have a vector with some valid values, while other values

[R] RJDBC

2007-03-05 Thread Jose Sierra
I need help. I'm trying to connect with an Oracle DBMS and MySQL DBMS, I'm using RJDBC package. My code is the next: library('rJava') library('DBI') library('RJDBC') //Mysql drv - JDBC(com.mysql.jdbc.Driver,C:\\Temporal\\mysql-connector-java-3.0.9-stable-bin.jar,') conn - dbConnect(drv,

Re: [R] 0 * NA = NA

2007-03-05 Thread Ted Harding
On 05-Mar-07 Alberto Monteiro wrote: Is there any way to force 0 * NA to be 0 instead of NA? For example, suppose I have a vector with some valid values, while other values are NA. If I matrix-pre-multiply this by a weight row vector, whose weights that correspond to the NAs are zero, the

Re: [R] enumerating non-overlapping pairs of elements from a vector

2007-03-05 Thread Robin Hankin
Allan the general problem you refer to is set partitions, although I'm not clear whether the order of the sets themselves makes a difference (we in the enumerative combinatorics world refer to indistinguishable boxes). Your application would be set partitions with a specific shape, in this case

Re: [R] Identifying points in a plot that have duplicate values

2007-03-05 Thread Chuck Cleland
David Lloyd wrote: I have code like this: - #--- -- x=scan() 0 0 0 0 0 1 2 3 4 y=scan() 1 1 1 2 2 1 3 4 5 plot(x,y) identify(0,1,3) #Allows me to select

Re: [R] Identifying points in a plot that have duplicate values

2007-03-05 Thread David Barron
Have a look at ?sunflowerplot, which not only produces a scatterplot showing multiple points with the same coordinates using special symbols, but will also produce a list showing the number of points at each coordinate as well. On 05/03/07, David Lloyd [EMAIL PROTECTED] wrote: I have code like

Re: [R] 0 * NA = NA

2007-03-05 Thread Ted Harding
On 05-Mar-07 Petr Klasterecky wrote: Alberto Monteiro napsal(a): Is there any way to force 0 * NA to be 0 instead of NA? No (AFAIK), and it is pretty reasonable to define it this way. If you want to treat the NAs as zeros, use x[is.na(x)] - 0 Doing it in precisely that way would have the

Re: [R] logistic regression on contingency table

2007-03-05 Thread Dieter Menne
Bingshan Li bli1 at bcm.tmc.edu writes: I am wondering if there is a way in R to fit logistic regression on contingency table. If I have original data, I can transform the data into a design matrix and then call glm to fit the regression. But now I have a 2x3 contingency table with

Re: [R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread jim holtman
If you were worried about efficiency and the structure/size of the dataframe was complex/big, then you could work with the indices only which would be more efficient: sapply(split(seq(nrow(t)), t$plate), function(x) t$id[x][which.max (t$year[x])]) 15 20 33 43 44 47

Re: [R] Mitools and lmer

2007-03-05 Thread Thomas Lumley
Doug, It's mitools, not mltools. I wrote it. I think the problem is just that coef() is not the right function for getting the fixed effects. Beth wants betas - MIextract(model0, fun=fixef) -thomas On Sat, 3 Mar 2007, Douglas Bates wrote: On 3/2/07, Beth Gifford [EMAIL

Re: [R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread jim holtman
What is wrong with the method that you have? It looks reasonable efficient. As with other languages, there are always other ways of doing it. Here is another to consider, but it is basically the same: sapply(split(t, t$plate), function(x) x$id[which.max(x$year)]) 15 20 33

Re: [R] How to read in this data format?

2007-03-05 Thread jim holtman
If you want to process 'n' lines from the file, then just setup the file as a connection and read the desired length in a loop like below: f.1 - file('/tempxx.txt', 'r') nlines - 0 # read 1000 lines at a time while (TRUE){ lines - readLines(f.1, n=1000) if (length(lines) == 0) break #

Re: [R] Mitools and lmer

2007-03-05 Thread Beth Gifford
Yes, Thomas' solution fixed my mistake. thank you. On 3/5/07, Thomas Lumley [EMAIL PROTECTED] wrote: Doug, It's mitools, not mltools. I wrote it. I think the problem is just that coef() is not the right function for getting the fixed effects. Beth wants betas - MIextract(model0,

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread jim holtman
You can also do it with the following: plot(as.POSIXct(strptime(as.character(dat[,2]), %Y%m%d)), dat[,1]) On 3/5/07, d. sarthi maheshwari [EMAIL PROTECTED] wrote: Hi, I want to display dates on my x-axis of the plot. I was trying to use plot() command for the same and passing the values

Re: [R] Error loading a dependency in a package: missing namespace?

2007-03-05 Thread Seth Falcon
Carlos J. Gil Bellosta [EMAIL PROTECTED] writes: import(methods, Biobase, outliers) * checking whether the package can be loaded ... ERROR Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, type

Re: [R] 0 * NA = NA

2007-03-05 Thread Alberto Monteiro
Ted Harding wrote: Is there any way to force 0 * NA to be 0 instead of NA? No (AFAIK), and it is pretty reasonable to define it this way. If you want to treat the NAs as zeros, use x[is.na(x)] - 0 Doing it in precisely that way would have the problem that it would not give you NA when

Re: [R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread Chris Stubben
Finally I would like to have a data.frame t2 which only contains the entries of the last measurements. You could also use aggregate to get the max year per plate then join that back to the original dataframe using merge on year and plate (common columns in both dataframes).

[R] Fwd: RFA and nsRFA

2007-03-05 Thread amna khan
-- Forwarded message -- From: amna khan [EMAIL PROTECTED] Date: Feb 25, 2007 8:37 AM Subject: RFA and nsRFA To: [EMAIL PROTECTED], R-help@stat.math.ethz.ch Dear Sir There are two packages of regional frequency analysis RFA and nsRFA. Are both give us same results if not then what

[R] Fwd: nsRFA

2007-03-05 Thread amna khan
-- Forwarded message -- From: amna khan [EMAIL PROTECTED] Date: Feb 25, 2007 8:44 AM Subject: nsRFA To: R-help@stat.math.ethz.ch, [EMAIL PROTECTED] Dear Sir I am not understanding the HOMTESTS in package nsRFA. Is vector x is the data from all sites combined combined in one

[R] Matrix/dataframe indexing

2007-03-05 Thread Guenther, Cameron
Hi all, I am hoping someone can help me out with this: If I have dataframe of years and ages and the first column and first row are filled with leading values: Df-age1age2age3 Yr1 1 0.4 0.16 Yr2 1.5 0 0 Yr3 0.9 0 0

[R] Fwd: RFA

2007-03-05 Thread amna khan
-- Forwarded message -- From: amna khan [EMAIL PROTECTED] Date: Feb 25, 2007 8:51 AM Subject: RFA To: R-help@stat.math.ethz.ch, [EMAIL PROTECTED] Dear Sir in the following example,is the vector lmom a l-moment ratios vector? What is meant by size = northCascades[,1]? And what are

[R] Interface to round robin databases (RRDtool)

2007-03-05 Thread jim holtman
I was wondering if anyone has created an interface to RRDtool which is a round robin database that will store timeseries data and aggregate the data so that the storage footprint stays relatively small (older data summarized into larger segments). -- Jim Holtman Cincinnati, OH +1 513 646 9390

[R] ANNOUNCEMENT: 20% Discount on R books from Chapman Hall/CRC Press

2007-03-05 Thread Calver, Rob
Take advantage of a 20% discount on the most recent R books from Chapman Hall/CRC! Chapman and Hall/CRC is pleased to offer our latest books on R - all available through our website at a 20% discount to users of the software. To take advantage of this permanent offer, that is valid across the

[R] error message when using outer function

2007-03-05 Thread Reinman, Grant
Dear R-users, I have two sets of code that appear to me to be equivalent, shown below, and yet I get the error message Error in dim(robj) - c(dX, dY) : dim- : dims [product 4] do not match the length of object [1] after executing the assignment to logdens2. Both functions post.a1 and post.a2

[R] Help on installing RScaLAPACK on Ubuntu

2007-03-05 Thread Thomas Mangold
I try to install RScaLAPACK on Ubuntu 6.10 and LAM 7.0.x Does anybody know a useful link top some how-to site about RScaLAPACK. Now I manage to get the package compiling, but the linker shows me lots of unsolved references: sudo R CMD INSTALL RScaLAPACK_0.5.1.tar.gz

[R] generate random numbers for regression model

2007-03-05 Thread Fatemah Alqallaf
Hi, please help me coding: model : y = f(x) + e, e ~ N(0, sigma^2) f(x) = 1/1+x^2 generate {(x_i,y_i), i=1,2,...,n} x_i: are ordered H(x_j) = sum_i =1, i neq j-1 y_i+1/x_i+1 - x_j (x_i+1 - x_i ) j = 1, ...,n find {(x_i, H(x_i)), i = 1, ..., n} Then

Re: [R] 0 * NA = NA

2007-03-05 Thread Ted Harding
On 05-Mar-07 Alberto Monteiro wrote: Of course, the problem begins to grow if we want, for example, to use elementary matrices to transform a matrix. The 2x2 matrix that switches two lines, rbind(c(0,1), c(1,0)) will not switch a matrix with NAs: switch - rbind(c(0,1), c(1,0)) testmatrix

Re: [R] logistic regression on contingency table

2007-03-05 Thread Marc Schwartz
On Mon, 2007-03-05 at 15:31 +, Dieter Menne wrote: Bingshan Li bli1 at bcm.tmc.edu writes: I am wondering if there is a way in R to fit logistic regression on contingency table. If I have original data, I can transform the data into a design matrix and then call glm to fit the

Re: [R] error message when using outer function

2007-03-05 Thread Petr Klasterecky
Comments inside. Reinman, Grant napsal(a): Dear R-users, I have two sets of code that appear to me to be equivalent, shown below, and yet I get the error message Error in dim(robj) - c(dX, dY) : dim- : dims [product 4] do not match the length of object [1] after executing the

Re: [R] Non : Confidence intervals for p**2 ??

2007-03-05 Thread Ben Bolker
Öhagen Patrik Patrik.Ohagen at mpa.se writes: Dear List, I was asked to calculate a confidence interval for p*p. Is there any standard techniques for calculating such an interval? Delta Method? Thank you in advance! if p is a generic value (i.e. not a probability) and you know

[R] Scoping issue? [SUMMARY]

2007-03-05 Thread Thaden, John J
A BIG thanks to Luke Tierney and Jim Holtman (and perhaps others? I haven't seen the latest digest) for pointing out two fixes to some code that was troubling me. I since found a third problem, and with that, have good code. Their comments are summarized below this fixed version of the code.

[R] factor analysis and pattern matrix

2007-03-05 Thread Steven Lacey
Hi, In a discussion of factor analysis in Using Multivariate Statistics by Tabachnick and Fidell, two matrices are singled out as important for interpreting an exploratory factor analysis (EFA) with an oblique promax rotation. One is the structure matrix. The structure matrix contains the

[R] Rbind with data frames -- column names question

2007-03-05 Thread Gregg Lind
As part of my work, I am trying to append matrices onto data frames. Naively I assumed that when rbinding a data.frame and matrix, the matrix would be coerced and appended, keeping the names from the data frame. Clearly, I am not fully understanding the process by which rbind works.

[R] Rbind with data frames -- column names question

2007-03-05 Thread Cody_Hamilton
Gregg, What about A-data.frame(1,1,1); names(A)=letters[1:3] ; B-matrix(0,2,3) B-as.data.frame(B) names(B)-names(A) rbind(A,B) -Cody Gregg Lind

Re: [R] Rbind with data frames -- column names question

2007-03-05 Thread Gregg Lind
This takes care of things quite nicely. The other solutions (explicitly coercing things) work as well, but this seems to me the minimum necessary solution for my particular problem. (P.s.: I hope I responded in the correct way to ensure threading... to the main list address.) A-

Re: [R] Rbind with data frames -- column names question

2007-03-05 Thread David Barron
I don't know if this is the right way, but I think this would work (I'm assuming you want the result to be a data frame): data.frame(rbind(as.matrix(A),B)) You might get a warning about row names, but I think it works OK. On 05/03/07, Gregg Lind [EMAIL PROTECTED] wrote: As part of my work, I

[R] Linear programming with sparse matrix input format?

2007-03-05 Thread Talbot Katz
Hi. I am aware of three different R packages for linear programming: glpk, linprog, lpSolve. From what I can tell, if there are N variables and M constraints, all these solvers require the full NxM constraint matrix. Some linear solvers I know of (not in R) have a sparse matrix input format.

[R] Mixed effects multinomial regression and meta-analysis

2007-03-05 Thread Inman, Brant A. M.D.
R Experts: I am conducting a meta-analysis where the effect measures to be pooled are simple proportions. For example, consider this data from Fleiss/Levin/Paik's Statistical methods for rates and proportions (2003, p189) on smokers: Study N Event P(Event) 1 86 83

[R] Document classes with tm

2007-03-05 Thread Alan Gibson
does anyone have any tips for using the tm package for supporting autoclassifying textual documents? while tm works very well for parsing text documents and creating term-document matrices, it doesnt seem to support tracking document classes by default. without a way to know the classes of your

Re: [R] How to override ordering of panels in xyplot()

2007-03-05 Thread Michael Kubovy
On Mar 3, 2007, at 3:19 PM, Deepayan Sarkar wrote: On 3/3/07, Michael Kubovy [EMAIL PROTECTED] wrote: Dear r-helpers, I'm conditioning an xyplot on a variable whose levels are'low', 'med', 'high'. How do I override the alphabetical ordering for the panels of the plot? This has less to

Re: [R] Linear programming with sparse matrix input format?

2007-03-05 Thread roger koenker
If you can reformulate your LP as an L1 problem, which is known to be possible without loss of generality, but perhaps not without loss of sleep, then you could use the sparse quantile regression functions in the quantreg package. url:www.econ.uiuc.edu/~rogerRoger Koenker

Re: [R] Heteroskedastic Time Series

2007-03-05 Thread Wensui Liu
check fseris library. On 3/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi R-helpers, I'm new to time series modelling, but my requirement seems to fall just outside the capabilities of the arima function in R. I'd like to fit an ARMA model where the variance of the disturbances is a

[R] different random effects for each level of a factor in lme

2007-03-05 Thread José Rafael Ferrer Paris
I have an interesting lme - problem. The data is part of the Master Thesis of my friend, and she had some problems analysing this data, until one of her Jurors proposed to use linear mixed-effect models. I'm trying to help her since she has no experience with R. I'm very used to R but have very

Re: [R] tournaments to dendrograms

2007-03-05 Thread roger koenker
I've had no response to the enquiry below, so I made a rather half-baked version in grid -- code and pdf are available here: http://www.econ.uiuc.edu/~roger/research/ncaa comments would be welcome. This is _the_ ubiquitous graphic this time of year in the US, so R should take a

Re: [R] Linear programming with sparse matrix input format?

2007-03-05 Thread Talbot Michael Katz
Thank you for the tip. Can quantreg actually handle mixed / integer programs? -- TMK -- 212-460-5430home 917-656-5351cell - Original Message - From: roger koenker [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] Cc: r-help R-help@stat.math.ethz.ch Sent: Monday, March 05,

Re: [R] Mixed effects multinomial regression and meta-analysis

2007-03-05 Thread Inman, Brant A. M.D.
R-Experts: I just realized that the example I used in my previous posting today is incorrect because it is a binary response, not a multilevel response (small, medium, large) such as my real life problem has. I apologize for the confusion. The example is incorrect, but the multinomial

Re: [R] How to override ordering of panels in xyplot()

2007-03-05 Thread Deepayan Sarkar
On 3/5/07, Michael Kubovy [EMAIL PROTECTED] wrote: Unless one makes the factor ordered, reordering the levels of a factor does not seem to be a trivial matter. The only R function I've found that makes it easy is reorder_factor() (package:reshape). Or am I missing something? Don't think in

[R] Is there a quick way to count the number of times each element in a vector appears?

2007-03-05 Thread Dylan Arena
Hi there, I'm writing a function that calculates the probability of different outcomes of dice rolls (e.g., the sum of the highest three rolls of five six-sided dice). I'm using the combinations function from the gtools package, which is great: it gives me a matrix with all of the possible

Re: [R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread Rainer M. Krug
Hi jim holtman wrote: What is wrong with the method that you have? It looks reasonable Actually there is nothing wrong with the approach I am using - it just seemed to be quite complicated and I assumed that there is an easier approach around. The dataset is not that large that I really have

Re: [R] Identifying last record in individual growth data over different time intervalls

2007-03-05 Thread Rainer M. Krug
Hi Chris Chris Stubben wrote: Finally I would like to have a data.frame t2 which only contains the entries of the last measurements. You could also use aggregate to get the max year per plate then join that back to the original dataframe using merge on year and plate (common columns in

Re: [R] Is there a quick way to count the number of times each element in a vector appears?

2007-03-05 Thread Benilton Carvalho
is this what you mean? tmp - combinations(3, 3, rep=TRUE) colSums(apply(tmp, 1, duplicated))+1 b On Mar 6, 2007, at 1:16 AM, Dylan Arena wrote: Hi there, I'm writing a function that calculates the probability of different outcomes of dice rolls (e.g., the sum of the highest three rolls of

Re: [R] Is there a quick way to count the number of times each element in a vector appears?

2007-03-05 Thread Benilton Carvalho
sorry, i forgot to mention that you will need an extra test |-) tmp - combinations(3, 3, rep=TRUE) out - colSums(apply(tmp, 1, duplicated))+1 out[out == 1] - 0 but now, re-reading your message, you say (..) want to count the number of times each element appears in each arrangement (...)

[R] optima setting of multiple response

2007-03-05 Thread EMA_CHO
Dears: I have a question about multiple response and find the optima setting. There are 7 responses(y1,y2,y3,y4,y5,y7,y8) and 5 variables(x1-x5). y1=0.3567+ 0.0154*x1-0.0003*x2+ 0.2295*x3-0.0082*x4 y2=278.6814-4.3832*x1+0.0831*x2-24.3953*x3+8.1404*x4 y3=8.9813-0.0025*x2-0.1746*x3+ 0.0560*x4+

Re: [R] delete selecting rows and columns

2007-03-05 Thread jastar
I mean something like in MATLAB matrix(sel_r,:)=[] jastar wrote: Hi, I'm working with a big square matrix (15k x 15k) and I have some trouble. I want to delete selecting rows and columns. I'm using something like this: sel_r=c(15,34,384,985,4302,6213)