[R] Hidden environment

2011-02-01 Thread Joel
Hi I wondering if its possible to make a hidden environment for a package, so the user cant see whats in it but the diffrent functions inside the package can use the variables in the environment. Hope you can understand what Im after. Joel -- View this message in context: http://r.789695.n4.n

Re: [R] "each" argument in rep (Bug?)

2011-02-01 Thread Waclaw Kusnierczyk
On 02/01/2011 05:16 PM, Phil Spector wrote: > In what way is the behavior non-consistent? Quoting from > the help page for rep: > > ¡times¢ A vector giving the number of times to repeat each > element if of length ¡length(x)¢, or to repeat the whole > vector if of lengt

Re: [R] time bin sum

2011-02-01 Thread Pete Brecknock
Jessica Any good? lines <-"DateTime, Q 2004-12-09 15:30:01, 2 2004-12-09 15:30:01, 1 2004-12-09 15:30:06, 1 2004-12-09 15:30:14, 5 2004-12-09 15:30:21, 1 2004-12-09 15:30:22, 11 2004-12-09 15:30:24, 4 2004-12-09 15:30:32, 1 2004-12-09 15:30:32, 1 2004-12-09 15:30:32, 3 2004-12-09 15:30:41, 4" d

Re: [R] help

2011-02-01 Thread Waclaw Kusnierczyk
On 02/01/2011 05:12 PM, David Winsemius wrote: On Feb 1, 2011, at 3:51 PM, Kiogou Lydie wrote: Yet, j! will stop at 170 and Π (i-1-d) at 172; so, a[j] will not exceed 170. I would like to have at least 200 a[j]. > factorial(200) [1] Inf Warning message: In factorial(200) : value out of rang

Re: [R] automatic coercion to character

2011-02-01 Thread Peter Alspach
Tena koe Lorenz c() combines the elements to form a vector and all elements of a vector must be of the same type. If you elements of different types you need to use a list. Note, a data.frame is a special type of list. HTH Peter Alspach > -Original Message- > From: r-help-boun.

Re: [R] automatic coercion to character

2011-02-01 Thread David Winsemius
On Feb 1, 2011, at 9:40 PM, Lorenzo Cattarino wrote: Hi R users I am wondering how I can avoid automatic coercion of my numeric vector elements to character Stop giving character arguments . init <- c(age='N', R=as.numeric(0.5), S=as.numeric(0.8)) If you want a multi-mode object, use a

[R] automatic coercion to character

2011-02-01 Thread Lorenzo Cattarino
Hi R users I am wondering how I can avoid automatic coercion of my numeric vector elements to character init <- c(age='N', R=as.numeric(0.5), S=as.numeric(0.8)) I have used as.numeric() but it does not seem to work Thank you Lorenzo [[alternative HTML version deleted]]

Re: [R] superscript

2011-02-01 Thread fgg
This works: as.expression(c(bquote(...),bquote(...))) -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3253145.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list http

[R] Function to locate points in 3d octants or points on two axes

2011-02-01 Thread Bryan Hanson
[Sorry, resending with a proper subject line!] Hi Guru's... I have a set of points that may lie along any of the x, y and z axes in a Cartesian coordinate system. I am hoping that a function exists which will determine if any two selected points are on different axes, i.e, if the one of t

[R] Function to

2011-02-01 Thread Bryan Hanson
Hi Guru's... I have a set of points that may lie along any of the x, y and z axes in a Cartesian coordinate system. I am hoping that a function exists which will determine if any two selected points are on different axes, i.e, if the one of the points is on x and the other on y or z, not

Re: [R] (no subject)

2011-02-01 Thread Dennis Murphy
Hi: Here are three more 'solutions' using packages doBy, plyr and data.table. ### For illustration: maxima for all mouce/GPR* conditions (1) doBy: library(doBy) dfsub <- subsetBy( ~ 1, subset = condition != 'con', data = df) summaryBy(responce ~ mouce + condition, data = dfsub, FUN = max) mou

Re: [R] Preparing dataset for glmnet: factors to dummies

2011-02-01 Thread Frank Harrell
I believe that glmnet scales variables by their standard deviations. This would not be appropriate for categorical predictors. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Preparing-dataset-for-glm

Re: [R] Sweave

2011-02-01 Thread Ista Zahn
Hi Francesco, If you're running Sweave from within R, you can pass the eval argument to RWeaveLatex, e.g. Sweave(file="test.Rnw", eval=FALSE) Best, Ista On Tue, Feb 1, 2011 at 2:57 PM, Francesco Petrogalli wrote: > Hello everybody, > is there a way to tell Sweave to skip the R code and process

Re: [R] "each" argument in rep (Bug?)

2011-02-01 Thread Peter Alspach
Tena koe ?rep states that each is a non-negative integer. Note, integer not a vector. Thus, rep(1:3, each=c(2,1,2)) only uses the first element in each and is equivalent to rep(1:3, each=2). One could argue there should be a warning (as there is for some functions is similar situations), but

Re: [R] lower.tri/upper.tri functions unable to make a matrix symmetric!

2011-02-01 Thread William Dunlap
Try replacing MyMatrix[lower.tri(MyMatrix)] <- MyMatrix[upper.tri(MyMatrix)] with MyMatrix[lower.tri(MyMatrix)] <- t(MyMatrix[upper.tri(MyMatrix)]) so it puts the transponse of the upper triangle into the lower. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Mess

Re: [R] "each" argument in rep (Bug?)

2011-02-01 Thread Phil Spector
In what way is the behavior non-consistent? Quoting from the help page for rep: ‘times’ A vector giving the number of times to repeat each element if of length ‘length(x)’, or to repeat the whole vector if of length 1. ‘each’ non-negative integer. Each element of ‘x

Re: [R] help

2011-02-01 Thread David Winsemius
On Feb 1, 2011, at 3:51 PM, Kiogou Lydie wrote: I actually want to do the following: a[j] = (1/(j!))*Π (i-1-d), j = 500, Π means product i = 1 to j What is the purpose of this effort? Yet, j! will stop at 170 and Π (i-1-d) at 172; so, a[j] will not exceed 170. I would like to have at lea

Re: [R] Matching patients

2011-02-01 Thread Carrie Li
Here is a paper that gives an review of matching Elizabeth A. Stuart. (2010) Matching Methods for Causal Inference: A Review and a Look Forward. Statistical Science; 25(1):1-21. In the paper, there is a list of R packages that does matching. hope this helps. On Tue, Feb 1, 2011 at 2:01 PM, Bi

Re: [R] (no subject)

2011-02-01 Thread Ista Zahn
max(dat[dat$condition=="GPR119a", "responce"]) aggregate(dat$responce, by=list(dat$condition), max) see ?"[" and ?aggregate -Ista On Tue, Feb 1, 2011 at 2:05 PM, A. Ramzan wrote: > Hello > > I am trying to find a way to find the max value, for only a subset of a > dataframe, depending on how th

Re: [R] (no subject)

2011-02-01 Thread Dario Strbenac
If your data frame is called myDF, max(myDF[myDF[, condition] == "GPR119a", "responce"]) Original message >Date: 01 Feb 2011 19:05:46 + >From: r-help-boun...@r-project.org (on behalf of "A. Ramzan" ) >Subject: [R] (no subject) >To: r-help@r-project.org > >Hello > >I am trying to f

[R] "each" argument in rep (Bug?)

2011-02-01 Thread T.D. Rudolph
I have a vector of unique elements that I want to replicate a variable number of times depending on the element (lengths all > 800). However I noticed that the resulting length was not the sum of the each argument. The following example demonstrates this. I am confused as to why this works:

Re: [R] (no subject)

2011-02-01 Thread Den
max(subset(dataName, condition=="GPR119a")$responce) У Аўт, 01/02/2011 у 19:05 +, A. Ramzan піша: > Hello > > I am trying to find a way to find the max value, for only a subset of a > dataframe, depending on how the data is grouped for example, > > How would I find the maxmium responce, for

Re: [R] (no subject)

2011-02-01 Thread Erik Iverson
?tapply would be one way to get the max for all conditions at once. Your example is not reproducible, so I cannot give you a reproducible answer, but adapt the following: tapply(df$responce, df$condition, max) A. Ramzan wrote: Hello I am trying to find a way to find the max value, for only

Re: [R] superscript

2011-02-01 Thread fgg
Thanks, jthetzel. That works. Can you plot a legend with 2 lines using bquote? e.g. r^2 = x rmse = y "," and "\n" don't seem to work. -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3253088.html Sent from the R help mailing list archive at Nabble.com.

[R] using SNOW and clusterApplyLB to run jobs parallel

2011-02-01 Thread kparamas
I have this function and want to run it parallel with different sets of data. Using SNOW and clusterApplyLB. system.time(out <- mclapply(cData, plotGraph)) #each cData contains 100X6000 doubles system.time(out <- mclapply(cData2, plotGraph)) system.time(out <- mclapply(cData3, plotGraph)) system.

[R] lower.tri/upper.tri functions unable to make a matrix symmetric!

2011-02-01 Thread Ron Michael
Dear all, I have having a strange problem with upper.tri()/lower.tri() functions which I used to use to make a matrix symmetric. However for a specific large matrix, they seem not working. Initial I had following matrix: > MyMatrix [,1] [,2] [,3] [,4]

[R] help

2011-02-01 Thread Kiogou Lydie
PLEASE HELP I actually want to do the following: a[j] = (1/(j!))*Π (i-1-d), j = 500, Π means product i = 1 to j   Yet, j! will stop at 170 and Π (i-1-d) at 172; so, a[j] will not exceed 170. I would like to have at least 200 a[j].   WHAT SHOULD I DO?   PLEASE SEE MY CODE FOR DETAI

[R] superscript

2011-02-01 Thread fgg
Hi there, How can I superscript the "2" of "r2 =..." in the legend below? legend(210, 110, paste("r2 = ", format(summary(regression)$adj.r.squared,digits=3), sep="")) I usually use "expression(paste(...", but it won't work this time because "format(summary(..." needs to be evaluated. Thank

[R] Sweave

2011-02-01 Thread Francesco Petrogalli
Hello everybody, is there a way to tell Sweave to skip the R code and process only the LaTeX part? I know it sounds a little bit weird, but the R code of my document is complete and _slow_ and I need to add the LaTeX part. Thanks, franZ __ R-help@r-p

Re: [R] superscript

2011-02-01 Thread jthetzel
Correction, I forgot the caret: legend(210, 110, bquote(r^2 == .(format(summary(regression)$adj.r.squared,digits=3 -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3252924.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] superscript

2011-02-01 Thread jthetzel
Would the following work? legend(210, 110, bquote(r2 == .(format(summary(regression)$adj.r.squared,digits=3 See ?plotmath and ?bquote Jeremy Jeremy Hetzel Boston University -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3252921.html Sent from the R h

Re: [R] Fitting ELISA measurements

2011-02-01 Thread Allen Liu
Christopher Anderson channing.harvard.edu> writes: > > Hello, > > I am trying to fit my Elisa results (absorbance readings) to a standard > curve. To create the standard curve model, I performed a 4-parameter > logistic fit using the 'drc' package (ExpectedConc~Absorbance). This gave me > the

Re: [R] Fitting ELISA measurements "unknowns" to 4 parameter logistic model

2011-02-01 Thread Hugo Mildenberger
Hello Chris, You may also use the R-package "calib". Hugo On Tuesday 01 February 2011 17:08:13 Christopher Anderson wrote: > Hello, > > I am trying to fit my Elisa results (absorbance readings) to a standard > curve. To create the standard curve model, I performed a 4-parameter > logistic fi

[R] (no subject)

2011-02-01 Thread A. Ramzan
Hello I am trying to find a way to find the max value, for only a subset of a dataframe, depending on how the data is grouped for example, How would I find the maxmium responce, for all the GPR119a condition below: responce,mouce,condition 0.105902,KO,con 0.232018561,KO,con 0.335008375,KO,con

Re: [R] p value for joint probability

2011-02-01 Thread moleps
Allright.. Appreciate the input on non-zero terminology (:-). What I wanted was: rr<-data.frame(r1=rnorm(1000,10,5),r2=rnorm(1000,220,5)) with(rr,plot(r1,r2)) r3<-kde2d(r1,r2,lims=c(2,18,200,240)) filled.contour(r3) //M On 1. feb. 2011, at 21.26, David Winsemius wrote: > > On Feb 1, 2011, a

Re: [R] Regression type 2, x measured with error

2011-02-01 Thread Michael Bedward
Another search term is "geometric mean regression". For simple models you can try the lmodel2 package. Michael On 2 February 2011 04:31, David Winsemius wrote: > > On Feb 1, 2011, at 10:41 AM, misil wrote: > >> >> I wanna to do a Regression type 2 or Regression with X measured with >> error

Re: [R] p value for joint probability

2011-02-01 Thread Petr Savicky
On Tue, Feb 01, 2011 at 08:31:57PM +0100, moleps wrote: > > My terminology is probably way off. I´ll try again in plain english. > > I´d like to generate a scatter plot of r1 & r2 and color code each pair > according to the probability of observing the pair given that the two samples > (r1 &

Re: [R] p value for joint probability

2011-02-01 Thread David Winsemius
On Feb 1, 2011, at 2:31 PM, moleps wrote: My terminology is probably way off. I´ll try again in plain english. I´d like to generate a scatter plot of r1 & r2 and color code each pair according to the probability of observing the pair given that the two samples (r1 & r2) are drawn from tw

Re: [R] Matching patients

2011-02-01 Thread Ravi Varadhan
Look at the "optmatch" package. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original

Re: [R] p value for joint probability

2011-02-01 Thread Mike Marchywka
> Date: Tue, 1 Feb 2011 12:10:31 -0800 > From: nord...@dshs.wa.gov > To: r-help@r-project.org > Subject: Re: [R] p value for joint probability > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of moleps > > Sent: Tue

Re: [R] p value for joint probability

2011-02-01 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of moleps > Sent: Tuesday, February 01, 2011 11:32 AM > To: Peter Ehlers > Cc: r-help@r-project.org > Subject: Re: [R] p value for joint probability > > > My terminology is probabl

Re: [R] p value for joint probability

2011-02-01 Thread moleps
My terminology is probably way off. I´ll try again in plain english. I´d like to generate a scatter plot of r1 & r2 and color code each pair according to the probability of observing the pair given that the two samples (r1 & r2) are drawn from two independent normal distributions. rr<-data.f

Re: [R] dotchart {graphics} 2.11.1 vs. 2.12.1

2011-02-01 Thread Joshua Wiley
On Tue, Feb 1, 2011 at 9:23 AM, Peter Ehlers wrote: > Will this suffice: > >  dotchart(c(table(infert$education))) That is probably the cleanest answer for now (I tried something like that with as.vector(), but lost the names). Another reasonable option would be: dotchart(unclass(table(infert$ed

[R] kmeans: number of cluster centres must lie between 1 and nrow(x)

2011-02-01 Thread Feng Li
Dear R, Can't I cluster a dataset into k clusters where k is exactly the number of observations? I have version 12.2 installed. See this example > a <- matrix(1:100, 20) > kmeans(a, 20) Error: number of cluster centres must lie between 1 and nrow(x) This is a bit ad-hoc but I known R from versio

[R] Matching patients

2011-02-01 Thread Bill Hyman
May I ask a clinical question? For a trial, we have a treatment group of small size, say 30 patients. We want to selectmatching control patients from a bigger group (100 patients) in terms of several clinical variables, such as age, tumor stage etc. This practice is to select the closest matchin

[R] Now available: "25 Recipes for Getting Started with R"

2011-02-01 Thread Paul Teetor
R-help readers: A new e-book entitled "25 Recipes for Getting Started with R" is now available from O'Reilly Media: http://oreilly.com/catalog/9781449303235 This collection of how-to recipes will get new R users up-and-running quickly with basic statistics, graphics, and regression. The r

Re: [R] Lmer binomial distribution x HLM Bernoulli distribution

2011-02-01 Thread Douglas Bates
On Tue, Feb 1, 2011 at 10:51 AM, Luana Marotta wrote: > Dear R-users, > I'm running a lmer model using the lme4 package. My dependent variable is > dichotomous and I'm using the "binomial" family. The results > are slightly different from the HLM results based on a Bernoulli > distribution. I rea

Re: [R] Positive Definite Matrix

2011-02-01 Thread Kjetil Halvorsen
see inline below. On Tue, Feb 1, 2011 at 2:25 PM, Mike Marchywka wrote: > > > > >>Date: Tue, 1 Feb 2011 15:41:01 + >>From: alex.sm...@gmail.com >>To: spencer.gra...@structuremonitoring.com >>CC: r-help@r-project.org; maech...@stat.math.ethz.ch >>Subject: Re: [R] Positive Definite Matrix > > >

Re: [R] Positive Definite Matrix

2011-02-01 Thread Alex Smith
I am new to R. So I posted the program I wrote so I can get help on where it is going wrong and if I could approach it using the Sylvesters criterion and why it comes up with an error when I use the eigenvalues. The matrices I provided are generated randomly the purpose of my question is not any in

Re: [R] R string help

2011-02-01 Thread Gabor Grothendieck
On Tue, Feb 1, 2011 at 12:42 PM, Yan Jiao wrote: > Dear R guru: > > > > If I got a variable > > aaa<- "up.6.11(16)" > > > > how can I extract 16 out of the bracket? > > I could use substr, e.g. > > substr(aaa, start=1, stop=2) > > [1] "up" > > > > But it needs start and stop, what if my start or s

Re: [R] Positive Definite Matrix

2011-02-01 Thread Mike Marchywka
>Date: Tue, 1 Feb 2011 15:41:01 + >From: alex.sm...@gmail.com >To: spencer.gra...@structuremonitoring.com >CC: r-help@r-project.org; maech...@stat.math.ethz.ch >Subject: Re: [R] Positive Definite Matrix >Hello thank you for so much input. I am afraid that I am fairly new to this and some

Re: [R] R string help

2011-02-01 Thread Phil Spector
Yan - Here's one way. It assumes there's exactly one set of brackets in the string, and they can be anywhere: aaa<- "up.6.11(16)" sub('^.*?\\((.*)\\).*$','\\1',aaa) [1] "16" - Phil Spector Statistical Computi

Re: [R] R string help

2011-02-01 Thread Henrique Dallazuanna
Try this: gsub(".*\\((\\d+)\\).*", "\\1", aaa) On Tue, Feb 1, 2011 at 3:42 PM, Yan Jiao wrote: > Dear R guru: > > > > If I got a variable > > aaa<- "up.6.11(16)" > > > > how can I extract 16 out of the bracket? > > I could use substr, e.g. > > substr(aaa, start=1, stop=2) > > [1] "up" > > > >

Re: [R] Help need to define method of an s4 class

2011-02-01 Thread Martin Morgan
On 02/01/2011 07:31 AM, Megh Dal wrote: > I need some help in defining a "print" method for my new S4 class > definition. So fer I have worked like this: > > setClass("MyClass", sealed=F, representation(slot1 = "list",#create a > new class > slot2= "vector", > s

[R] R string help

2011-02-01 Thread Yan Jiao
Dear R guru: If I got a variable aaa<- "up.6.11(16)" how can I extract 16 out of the bracket? I could use substr, e.g. substr(aaa, start=1, stop=2) [1] "up" But it needs start and stop, what if my start or stop is not fixed, I just want the number inside the bracket, how can I achi

Re: [R] Fitting ELISA measurements "unknowns" to 4 parameter logistic model

2011-02-01 Thread David Winsemius
On Feb 1, 2011, at 11:08 AM, Christopher Anderson wrote: Hello, I am trying to fit my Elisa results (absorbance readings) to a standard curve. To create the standard curve model, I performed a 4-parameter logistic fit using the 'drc' package (ExpectedConc~Absorbance). This gave me the f

Re: [R] Problems with sample means and standard deviations

2011-02-01 Thread Dennis Murphy
Hi: Here are a few ways to do this. A useful approach is to use replicate() to generate the samples, flatten the resulting matrix into a data frame and call one or more packages that are well capable of handling multiple outputs per data subset. Step 1: Generate the samples and rearrange into a

Re: [R] Regression type 2, x measured with error

2011-02-01 Thread David Winsemius
On Feb 1, 2011, at 10:41 AM, misil wrote: I wanna to do a Regression type 2 or Regression with X measured with erroranybody knows how can i make it in R?? thanks! There are several prior posts in the archives ... although perhaps not the Nabble archives since they start throwing away s

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Martin Maechler
> "EV" == Eik Vettorazzi > on Tue, 1 Feb 2011 18:02:42 +0100 writes: EV> yes there are. But Christofer doesn't need exp(A), but EV> A^n. EV> But there is a matpow-function %^% in this package, which is a little EV> bit slower, I think: EV> library(expm) EV> s

Re: [R] dotchart {graphics} 2.11.1 vs. 2.12.1

2011-02-01 Thread Peter Ehlers
On 2011-02-01 07:09, Joshua Wiley wrote: Hi, Its a bit messy, but here is a quick work around: dotchart(as.matrix(table(infert$education))[,1]) I wonder if this has something to do with the addition of table methods for points() and lines(). I'll post back if I find anything more out. Will

[R] Fitting ELISA measurements "unknowns" to 4 parameter logistic model

2011-02-01 Thread Christopher Anderson
Hello, I am trying to fit my Elisa results (absorbance readings) to a standard curve. To create the standard curve model, I performed a 4-parameter logistic fit using the 'drc' package (ExpectedConc~Absorbance). This gave me the following: > FourP A 'drc' model. Call: drm(formula = Response ~ E

Re: [R] Comparing decimal numbers

2011-02-01 Thread Stephan Kolassa
Hi, this is R FAQ 7.31. http://cran.r-project.org/doc/FAQ/R-FAQ.html HTH, Stephan Am 01.02.2011 14:49, schrieb mlancee: Hi, I have a seemingly easy question that has been keeping be busy for quite a while. The problem is the following: 0.1 + 0.1 + 0.1 == 0.3 [1] FALSE Why is this false? A

Re: [R] Comparing decimal numbers

2011-02-01 Thread Petr Savicky
On Tue, Feb 01, 2011 at 05:49:10AM -0800, mlancee wrote: > > Hi, > > I have a seemingly easy question that has been keeping be busy for quite a > while. The problem is the following: > > 0.1 + 0.1 + 0.1 == 0.3 > [1] FALSE > > Why is this false? Another example is > > 0.2 + 0.1 == 0.3 > [1] FAL

[R] Help need to define method of an s4 class

2011-02-01 Thread Megh Dal
I need some help in defining a "print" method for my new S4 class definition. So fer I have worked like this: setClass("MyClass", sealed=F, representation(slot1 = "list",#create a new class slot2= "vector", slot3 = "vector", slot4 = "vector"))

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Eik Vettorazzi
yes there are. But Christofer doesn't need exp(A), but A^n. But there is a matpow-function %^% in this package, which is a little bit slower, I think: library(expm) states<-1000 tm <- matrix(runif(states^2),nrow=states) # random transition matrix for illustration tm <- t(apply(tm,1,function (x) x

Re: [R] Comparing decimal numbers

2011-02-01 Thread mlancee
Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Comparing-decimal-numbers-tp3251437p3251804.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

[R] Regression type 2, x measured with error

2011-02-01 Thread misil
I wanna to do a Regression type 2 or Regression with X measured with erroranybody knows how can i make it in R?? thanks! -- View this message in context: http://r.789695.n4.nabble.com/Regression-type-2-x-measured-with-error-tp3251875p3251875.html Sent from the R help mailing list archive at

Re: [R] Positive Definite Matrix

2011-02-01 Thread Alex Smith
Hello thank you for so much input. I am afraid that I am fairly new to this and some of the material is above my understanding for the time being and I am not looking at anything very complex as you will see from the program I will include. I have been talking to a fellow colleague I am working wit

[R] Lmer binomial distribution x HLM Bernoulli distribution

2011-02-01 Thread Luana Marotta
Dear R-users, I'm running a lmer model using the lme4 package. My dependent variable is dichotomous and I'm using the "binomial" family. The results are slightly different from the HLM results based on a Bernoulli distribution. I read that a Bernoulli distribution is an extension of a binomial dis

Re: [R] Working with additional input for user defined function

2011-02-01 Thread Eik Vettorazzi
almost there fn1 <- function(x, y, ...) { x1 <- x+y if(is.null(names(list(... res <- x1 else { res <- list(...) #further operations on res$aa res$zz, e.g. #res<-res$zz+res$aa #or #for (a in res) { #do something #} } res } fn1(-2,2) fn1(-2,2, zz=3:5,aa=6:8) see

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Ben Bolker
Eik Vettorazzi uke.uni-hamburg.de> writes: > > if you have a homogeneous mc (= a constant transition matrix), your > state at time 10 is given by (chapman-kolmogorov) > p10=p0 %*% tm^(10) > so you need a matrix power function. There are matrix exponential functions in the Matrix and expm pack

Re: [R] Scatterplot Question

2011-02-01 Thread Dennis Murphy
Hi: Not sure, but perhaps you had something like this in mind: y <- runif(100) w <- matrix(y, nrow = 10) # fills in column-wise v <- apply(w, 2, cumsum) plot(1:100, y, type = 'l', col = 'blue') lines(1:100, as.vector(v), type = 'l', col = 'red') Reshaping into a matrix and using apply() to

Re: [R] Working with additional input for user defined function

2011-02-01 Thread Bogaso Christofer
Thanks Eik for your help. So far I am able to do following things: > fn1 = function(x, y, ...) { + x1 <- x+y + if(is.null(names(list(... + res <- x1 + else + res <- get(names(list(...))) + return(res) + + } ; > fn1(-2,2) [1] 0 > fn1(-2,2, zz=3:5) Error in get(

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Eik Vettorazzi
if you have a homogeneous mc (= a constant transition matrix), your state at time 10 is given by (chapman-kolmogorov) p10=p0 %*% tm^(10) so you need a matrix power function. You can use the eigendecomposition and some linear algebra A^n=(VDV^{-1})^n)=VD^nV^{-1} dd<-eigen(tm,symmetric=F) as.real(

[R] Rmpi; sample code not running, the slaves won't execute commands

2011-02-01 Thread Chris Carleton
Hi All, I'm trying to parallelize some code using Rmpi and I've started with a sample 'hello world' program that's available at http://math.acadiau.ca/ACMMaC/Rmpi/sample.html. The code is as follows; # Load the R MPI package if it is not already loaded. if (!is.loaded("mpi_initialize")) {

Re: [R] Finding non-ASCII characters in R code using R

2011-02-01 Thread Prof Brian Ripley
See 'Writing R Extensions' ... 'Function showNonASCII in package tools can help in finding non-ASCII bytes in files.' On Tue, 1 Feb 2011, Mark Heckmann wrote: During R CMD check I get the following note: * checking data for non-ASCII characters ... NOTE Note: found 9 marked UTF-8 string(s

Re: [R] multi-Operations on a matrix

2011-02-01 Thread Dennis Murphy
Hi: Try this: > d <- read.table(textConnection(" + procedure property sensor_data sensor_date + 1S_10 nord626821.0 2002-09-30T00:00:00+0200 + 2 S_10 nord626821.0 2002-12-05T00:00:00+0100 + 3S_10 nord626821.1 2008-07-31T00:00:00+0200 + 4 S

Re: [R] better way to iterate matrix multiplication?

2011-02-01 Thread Martyn Byng
Hi, If you only want the final matrix, i.e. in this case the pm at 10 months, then you might be better off looking at something like the square-and-multiply algorithm (http://en.wikipedia.org/wiki/Exponentiation_by_squaring) rather than a brute force multiplication. Martyn -Original Message-

Re: [R] Comparing decimal numbers

2011-02-01 Thread Eik Vettorazzi
Hi Michael, this is R-FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f cheers. Am 01.02.2011 14:49, schrieb mlancee: > > Hi, > > I have a seemingly easy question that has been keeping be busy for quite a > while. The problem is the follo

[R] Setting maximum value of the legend on an image.plot and animation

2011-02-01 Thread Steve_Friedman
Hello, I'm doing the following: library(ncdf) library(fields) library(animation) saline <- open.ncdf("salinity_1990.nc") salt = get.var.ncdf(nc=saline, varid="Salinity") # create an animation of the complete temporal domain in the ncdf file. saveHTML({ for (i in 1:364) { im

[R] general question on approaches to getting data from data providers

2011-02-01 Thread Mike Marchywka
My question, buried in this rant, is " is there a mail list or other means for identifying sites with information likely to be important to many R users but the data is difficult to obtain due to the site's choice of technology?" Quite often, people here ask questions about scraping html to get

Re: [R] dotchart {graphics} 2.11.1 vs. 2.12.1

2011-02-01 Thread Joshua Wiley
Hi, Its a bit messy, but here is a quick work around: dotchart(as.matrix(table(infert$education))[,1]) I wonder if this has something to do with the addition of table methods for points() and lines(). I'll post back if I find anything more out. Cheers, Josh On Tue, Feb 1, 2011 at 6:52 AM, V

[R] better way to iterate matrix multiplication?

2011-02-01 Thread Jonathan Knibb
I'm simulating a Markov process using a vector of proportions. Each value in the vector represents the proportion of the population who are in a particular state (so the vector sums to 1). I have a square matrix of transition probabilities, and for each tick of the Markov clock the vector is mu

[R] dotchart {graphics} 2.11.1 vs. 2.12.1

2011-02-01 Thread Van Patten, Isaac T
I have a factor vector of subject races (Asian, Black, Hispanic, White; n=30) that I want to plot with a Cleveland dotplot or dotchart. I tried the following in R2.12.1 : > dotchart(table(school$Race)) Error in plot.xy(xy.coords(x, y), type = type, ...) : invalid plot type Using the same data

[R] Comparing decimal numbers

2011-02-01 Thread mlancee
Hi, I have a seemingly easy question that has been keeping be busy for quite a while. The problem is the following: 0.1 + 0.1 + 0.1 == 0.3 [1] FALSE Why is this false? Another example is 0.2 + 0.1 == 0.3 [1] FALSE or 0.25 + 0.05 == 0.20 + 0.10 [1] FALSE However, I do get TRUE if I use integ

[R] sqlsave and mysql database with autoincremental column

2011-02-01 Thread PtitBleu
Hello, I'm trying to modify my r-script to use RODBC instead of DBI/RMySQL (no more ready-to-use package for windows). I would like to copy a data.frame of 44 columns to a table of 45 columns (the 45th is an autoincremental column). With the following commands, colnames(df)<- a vector with th

[R] Finding non-ASCII characters in R code using R

2011-02-01 Thread Mark Heckmann
During R CMD check I get the following note: * checking data for non-ASCII characters ... NOTE Note: found 9 marked UTF-8 string(s) How can I search my code files for non ASCII chars using R? Thanks, Mark -- Mark Heckmann (Dipl. Wirt.-Ing.) phone +49 (0) 421/1614618 Empfehlen Sie GMX DSL I

[R] Hidden variables

2011-02-01 Thread Joel
Hi Im trying to make a package in R just to learn how it works. One thing I dont manage to do is to make a hidden environment or variable so to say. I want a "hash list" that I create my useing: TestEnv<-new.env() assign("Key1","Ans1",envir=TestEnv) assign("Key2","Ans2",envir=TestEnv) Then I j

Re: [R] Problems with sample means and standard deviations

2011-02-01 Thread Henrique Dallazuanna
Try this: vapply(replicate(y, sample(listMV, 5), simplify = FALSE), function(x)c(mean(x), sd(x)), c(Mean = 0, Sd = 0)) On Tue, Feb 1, 2011 at 7:56 AM, Titta wrote: > Hi, > > I am doing program that takes samples y times from listMV and saves the > result to list MVdata. The problem is that I n

Re: [R] Working with additional input for user defined function

2011-02-01 Thread Eik Vettorazzi
Hi Christofer, just have a look at how other functions deal with this, e.g. > plot function (x, y, ...) { #*snip* hasylab <- function(...) !all(is.na(pmatch(names(list(...)), "ylab"))) #*snip* got it? cheers Am 01.02.2011 11:29, schrieb Bogaso Christofer: > Hi all, suppose I

Re: [R] How to change size of xlab inplot?

2011-02-01 Thread jthetzel
Rainer, Take a look at this thread: http://www.mail-archive.com/r-help@r-project.org/msg64936.html Jeremy Jeremy Hetzel Boston University -- View this message in context: http://r.789695.n4.nabble.com/How-to-change-size-of-xlab-inplot-tp3250762p3250960.html Sent from the R help mailing list

[R] Problems with sample means and standard deviations

2011-02-01 Thread Titta
Hi, I am doing program that takes samples y times from listMV and saves the result to list MVdata. The problem is that I need sample mean or standard deviation for each sample (times y) and for all samples together. How can I do that? Mean() and sd() won´t work. Thanks allready, Titta > listMV<-

Re: [R] Scatterplot Question

2011-02-01 Thread Petr Savicky
On Tue, Feb 01, 2011 at 10:51:12PM +1300, Surrey Jackson wrote: > Hello, > > I have some data where a number of events (the total amount varies) > occur at cumulating times, I would like to create a scatterplot > (easily achieved using plot etc) of these events (the events can > either be times u

[R] multi-Operations on a matrix

2011-02-01 Thread alcesgabbo
Hello everybody. I have this object procedure property sensor_data sensor_date 1S_10 nord626821.0 2002-09-30T00:00:00+0200 2 S_10 nord626821.0 2002-12-05T00:00:00+0100 3S_10 nord626821.1 2008-07-31T00:00:00+0200 4 S_1000 nord626

Re: [R] Latent Class Logit Models in discrete choice experiments

2011-02-01 Thread Daniel Vecchiato
Thanks to all for your answers! The ppt file should be here: http://bit.ly/gi15gh I also uploaded some model specifications and the results I want to replicate + the random dataset (long format) I'm using. The zip file is here: https://docs.google.com/leaf?id=0B09M2qtL2eXjNmE3ZGM4NGQtZjE4Ny00

[R] SOLVED: How to change size of xlab inplot?

2011-02-01 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/01/2011 12:12 PM, Henrique Dallazuanna wrote: > Try cex.lab: > > plot(1,1, xlab="Label", cex.lab = 2) Thanks - that is what I was looking for. Cheers, Rainer > > On Tue, Feb 1, 2011 at 7:31 AM, Rainer M Krug > wr

Re: [R] Subset of Data Frame using the date

2011-02-01 Thread Henrique Dallazuanna
Try this: DF <- data.frame( "Date" = c("2009-09-01","2009-09-02","2009-09-03","2009-09-04", "2009-09-05"), "Data" = c( 10:14 ) ) subset(DF, as.Date(Date) >= '2009-09-02' & as.Date(Date) <= '2009-09-04') On Tue, Feb 1, 2011 at 11:09 AM, Usuario R wrote: > Hello, > > I have a data frame with one

[R] Subset of Data Frame using the date

2011-02-01 Thread Usuario R
Hello, I have a data frame with one column set as the date with function as.Date. In example: data.frame( "Date" = c("2009-09-01","2009-09-02","2009-09-03","2009-09-04", "2009-09-05"), "Data" = c( 10:14 ) ) Date Data 2009-09-01 10 2009-09-02 11 2009-09-03 12 2009-09-04 13 Is there

Re: [R] Rserve

2011-02-01 Thread Joel
Can add that if it dossent split up the processes by default is there anyway I can do it by myself? //Joel -- View this message in context: http://r.789695.n4.nabble.com/Rserve-tp3251032p3251138.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] How many nested function calls?

2011-02-01 Thread Uwe Ligges
On 31.01.2011 23:23, muchad...@gmail.com wrote: Is there a limit to how many nested function calls R will tolerate? I mean, if I have a function that calls another function that calls another function, etc., is there a limit to how deep I can go? I am getting an error that says a variable is n

  1   2   >