[R] cex.axis for the x axis

2008-07-08 Thread Pavel77
Hello, I would like to change the font size of the x axis annotations. cex.axis changes the y axis annotations only. Does anyone know how to change the x axis annotations? With thanks, Pavel. -- View this message in context: http://www.nabble.com/cex.axis-for-the-x-axis-tp18353453p18353453.html

[R] Installing R package but got Fortran 90 error

2008-07-08 Thread Daren Tan
I am installing a package but got the following error. How can I install this package ? R_HOME is /home/daren/MyHome/lib64/RAttempting to determine R_ARCH...R_ARCH isAttempting to detect how R was configured for Fortran 90Unsupported Fortran 90 compiler or Fortran 90compilers unav

[R] Loglikelihood for x factorial?

2008-07-08 Thread ctu
Hi Rers, I have a silly question. I don't know how to express the loglikelihood function of 1/(x!) where x=x1,x2,xn in R. Could anyone give me a hint? Thank you in advance. Chunhao Tu __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] sorting a data frame by rownames

2008-07-08 Thread Jorge Ivan Velez
Dear Michael, Is this what you are looking for? ex.dat$rn=as.numeric(rownames(ex.dat)) ex.dat # Are new3 and ex.dat equals? all.equal(new3,ex.dat) [1] TRUE HTH, Jorge On Tue, Jul 8, 2008 at 10:58 PM, Michael Rennie <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm sure there's an easy answer to

Re: [R] sorting a data frame by rownames

2008-07-08 Thread Rolf Turner
Can't you just do newdat <- newdat[order(row.names(newdat)),] Or am I missing something? cheers, Rolf Turner On 9/07/2008, at 2:58 PM, Michael Rennie wrote: Hi there, I'm sure there's an easy answer to this, and I can't wait to see it. The question: is the

[R] sorting a data frame by rownames

2008-07-08 Thread Michael Rennie
Hi there, I'm sure there's an easy answer to this, and I can't wait to see it. The question: is there an easy way to sort a data frame by it's row names? My dilemma: I've had to pull apart a data frame, run it through a loop to do some calculations and generate new variables, and then re-constr

Re: [R] Can I do regression by steps?

2008-07-08 Thread John Sorkin
Can you perform regression by steps, yes. Will results be the same as those you would obtain from a multiple variable regression? No not if the independent variables are non-orthogonal and you don't take into consideration the correlation of the independent variables. Should you take into consid

Re: [R] Can I do regression by steps?

2008-07-08 Thread markleeds
someone else can blast me if this is not correct but i think that 2 step procedure only gives the same answer as the regular regression if X1 and X2 perfectly uncorrelated. If they are at all correlated, then what john pointed out messes the procedure up. i was asked that question on an intervi

Re: [R] Can I do regression by steps?

2008-07-08 Thread rlearner309
Thanks for the reply. I am awared of the difference, but can I do regression by steps at all? I am not feeling comfortable about it. John Sorkin wrote: > > Be very careful! > When regression is performed by steps, you often will not get the same > results as you would get from a single multiv

Re: [R] question on lm or glm matrix of coeficients X test data terms

2008-07-08 Thread DS
thanks Jorge. This is great! regards, Dhruv --- On Tue 07/08, Jorge Ivan Velez < [EMAIL PROTECTED] > wrote: From: Jorge Ivan Velez [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Tue, 8 Jul 2008 20:45:06 -0400 Subject: Re: [R] question on lm or glm matrix of coeficients X tes

Re: [R] extracting index list when using tapply()

2008-07-08 Thread jim holtman
Working code would help. I would probably use 'lapply' since it appears that you want to return a variable number of items for each condition. On Tue, Jul 8, 2008 at 2:23 PM, hesicaia <[EMAIL PROTECTED]> wrote: > > Hello, > The quick version of my question is how can I extract a matrix instead o

Re: [R] extracting index list when using tapply()

2008-07-08 Thread Charles C. Berry
On Tue, 8 Jul 2008, hesicaia wrote: Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to be able to access both the results of tapply() and also the index variables. In case further explanation would help: I am analyzing a

Re: [R] question on lm or glm matrix of coeficients X test data terms

2008-07-08 Thread DS
Hi, I found some of what I was looking for. using the following I can get a matrix of regression coefficient multiplied out by the variable data. g<-predict(comodel,type='terms',data4) m<-cbind(data4,g) What remains is how do I pick the 3-4 rows for each data row with the highest va

Re: [R] Change in behaviour of sd()

2008-07-08 Thread Peter Dalgaard
Duncan Murdoch wrote: On 08/07/2008 5:01 PM, Rolf Turner wrote: On 8/07/2008, at 7:38 PM, Fiona Johnson wrote: Hi I have just upgraded from R2.6.0 to R2.7.1 (running on Windows) and a part of my code that previously ran ok now gives an error. The following is a simple example to demonstr

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Giovanni Petris
Hi Daniela, There may be other more elegant ways of doing it, but here is one: > myD <- data.frame(code = sample(3, 10, rep = T), prev = rnorm(10), Pr_mean = > 0) > myD codeprev Pr_mean 1 3 -0.06710968 0 2 2 -1.43422034 0 3 1 0.22717580 0 4 3 0.32

Re: [R] Can I do regression by steps?

2008-07-08 Thread John Sorkin
Be very careful! When regression is performed by steps, you often will not get the same results as you would get from a single multivariable regression. The explanation for this is not simple, but a simplified explanation is that when you do your first regression, y=f(x1) all the total variance

Re: [R] aggregate() function and na.rm = TRUE

2008-07-08 Thread Daniel Malter
That may have something to do with that you have "empty" groups. In your example, ALL Hour=0 have Y2=NA. The following example may illustrate the point. The first 2 aggregate commands perform the function on data that contain NAs. However, the NAs are not perfectly collinear with any level by which

Re: [R] Change in behaviour of sd()

2008-07-08 Thread Duncan Murdoch
On 08/07/2008 5:01 PM, Rolf Turner wrote: On 8/07/2008, at 7:38 PM, Fiona Johnson wrote: Hi I have just upgraded from R2.6.0 to R2.7.1 (running on Windows) and a part of my code that previously ran ok now gives an error. The following is a simple example to demonstrate my problem. a <-

Re: [R] Change in behaviour of sd()

2008-07-08 Thread Henrik Bengtsson
Hi, FYI, *the* NEWS file containing updates for all R versions is available at http://cran.r-project.org/ - see the link 'new features and bug fixes'. This links to the URL (which I think is rather stable): https://svn.r-project.org/R/trunk/NEWS The NEWS file also comes with your R installati

Re: [R] Sum(Random Numbers)=100

2008-07-08 Thread Carl Witthoft
quote: In the present case use rmultinom(1, 100, rep(1/50,50)) At least in my version, rmultinom normalizes the last argument, so rep(1,50) works just as well. Back to the original problem: either assign 49 randoms and give the remainder to the 50th slot, or do the right thing :-) : You hav

Re: [R] calculation of entropy in R???

2008-07-08 Thread David Reinke
I've usually done my own calculations of entropy. Suppose p is a vector of values (counts of outcomes, probabilities, etc.). Here's a simple function to compute Shannon entropy: shannon.entropy <- function(p) { if (min(p) < 0 || sum(p) <= 0) return(NA) p.norm <- p[p

Re: [R] Automatic placement of Legends

2008-07-08 Thread Gregor Gorjanc
jpmorgan.com> writes: > I am looking for a way to get legends placed automagically in an empty > spot on a graph. Additional complication comes through my useage of > multiple graphs on the same plot through mfrow. Take a look in Hmisc package. There is function for this task. Gregor _

Re: [R] shading an area in a edf

2008-07-08 Thread Ray Brownrigg
On Tue, 08 Jul 2008, squall44 wrote: > Hi, > > I've got the following edf: > > *** > > x = c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2) > F2.5 <- ecdf(x) > plot(F2.5, > verticals= TRUE, > do.p = TRUE, > lwd=3, > ylab = "", > xlab = "", > xlim = c(1,5.5)) > abline(h= (0:5)*

Re: [R] Sum(Random Numbers)=100

2008-07-08 Thread Kenn Konstabel
On Tue, Jul 8, 2008 at 9:53 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > ...actually I need to allocate certain amount of money (here I mentioned > it as 100) to a randomly selected stocks(50 stocks)... i.e., 100 being > divided among 50 stocks and preferably all are integer allocat

Re: [R] Change in behaviour of sd()

2008-07-08 Thread Rolf Turner
On 8/07/2008, at 7:38 PM, Fiona Johnson wrote: Hi I have just upgraded from R2.6.0 to R2.7.1 (running on Windows) and a part of my code that previously ran ok now gives an error. The following is a simple example to demonstrate my problem. a <- array(c(1,2,3,4,5,6,rep(NA,6)),dim=c(6,2))

[R] aggregate() function and na.rm = TRUE

2008-07-08 Thread David Afshartous
All, I've been using aggregate() to compute means and standard deviations at time/treatment combinations for a longitudinal dataset, using na.rm = TRUE for missing data. This was working fine before, but now when I re-run some old code it isn't. I've backtracked my steps and can't seem to find

Re: [R] Automatic placement of Legends

2008-07-08 Thread dogle
You may be able to use the coordinates returned from emptyspace() in plotrix package as coordinates for the legend in legend(). tolga.i.uzuner wrote: > > ... > I am looking for a way to get legends placed automagically in an empty > spot on a graph. Additional complication comes through my use

Re: [R] nls and "plinear" algorithm

2008-07-08 Thread Peter Dalgaard
Allan Clark wrote: hello all i havnt had a chance to read through the references provided for the "nls" function (since the libraries are closed now). can anyone shed some light on how the "plinear" algorithm works? also, how are the fitted values obtained? also, WHAT DOES THE ".lin" below REP

Re: [R] nls and "plinear" algorithm

2008-07-08 Thread Duncan Murdoch
On 7/8/2008 2:33 PM, Allan Clark wrote: hello all i havnt had a chance to read through the references provided for the "nls" function (since the libraries are closed now). can anyone shed some light on how the "plinear" algorithm works? Nonlinear regression is least squares. There are stan

[R] Fwd: Re: extracting index list when using tapply()

2008-07-08 Thread ctu
The following message is provided by Erik Please provide the reproducible code to do this. Generate a sample data set using the random data generating functions and show us what you'd like, we can then more easily help. [EMAIL PROTECTED] wrote: Hi, How about using "subset"? x1<-tapply(subs

[R] calculation of entropy in R???

2008-07-08 Thread muhammad faisal
i want to calculate shannon entropy which is H1,H2,H3upto H7? if there is any function or any package in which i can find this entropy directly. do you have any information please share this and i will be very thankful to you. Regards, +

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread Gabor Grothendieck
Its a bug in axis.zoo. I have just fixed it in the svn repository so try this: source("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/yearmon.R?rev=485&root=zoo";) plot(x.zoo[, 25]) axis.zoo uses the same algorithm as axis.Date in R and so it gives similar results: # u

[R] fisher.test

2008-07-08 Thread Marta Colombo
Hi! I am Marta Colombo, student in Mathematical Engineering at "Politecnico di Milano". For my master degree thesis I have to analyze some categorical data. My dataset is composed by 327 individuals and 16 variables. I am using Fisher exact test to test independence on IxJ contingency tables, bu

Re: [R] Automatic placement of Legends

2008-07-08 Thread Boks, M.P.M.
You may want to look at locator(1) for manual placements; legend(locator(),...) BW Marco -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] namens [EMAIL PROTECTED] Verzonden: di 8-7-2008 20:31 Aan: r-help@r-project.org Onderwerp: [R] Automatic placement of Legends Dear R-Us

[R] nls and "plinear" algorithm

2008-07-08 Thread Allan Clark
hello all i havnt had a chance to read through the references provided for the "nls" function (since the libraries are closed now). can anyone shed some light on how the "plinear" algorithm works? also, how are the fitted values obtained? also, WHAT DOES THE ".lin" below REPRESENT? thanking you

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread Gabor Grothendieck
On Tue, Jul 8, 2008 at 2:59 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > x.zoo <- zoo(x,as.yearmon(as.character(x$Yearmonth), "%Y-%m")) > plot(x.zoo[,25]) 1. You are trying to pass data frame to zoo whereas it must be a numeric vector, matrix or a factor. See ?zoo and try this: x.zoo <- zoo(

Re: [R] extracting index list when using tapply()

2008-07-08 Thread ctu
Hi, How about using "subset"? x1<-tapply(subset(years, length(area)>20), function(x) length(unique(x))) I hope this works Chunhao Quoting hesicaia <[EMAIL PROTECTED]>: Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread stephen sefick
That worked fine- now one more question- plot(x.zoo[,25]) produces a graph with True as the first label on the x-axis 1. why? 2. is it wrong to assume this is february 2006? thanks stephen R2.7.1 Windows XP (I updated zoo last week when I installed 2.7.1) On Tue, Jul 8, 2008 at 3:17 PM, Gabor Gr

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread stephen sefick
x.zoo <- zoo(x,as.yearmon(as.character(x$Yearmonth), "%Y-%m")) plot(x.zoo[,25]) #Error in plot.window(...) : invalid 'ylim' value #there are values On Tue, Jul 8, 2008 at 2:55 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 2:43 PM, Gabor Grothendieck > <[EMAIL PROTECT

Re: [R] Automatic placement of Legends

2008-07-08 Thread stephen sefick
legend will accept locator() which would not automate it but would get closer On Tue, Jul 8, 2008 at 2:31 PM, <[EMAIL PROTECTED]> wrote: > Dear R-Users, > > I am looking for a way to get legends placed automagically in an empty > spot on a graph. Additional complication comes through my useage of

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread stephen sefick
#this is the whole data frame and I tried the suggested and it looks like it is working but will not plot. thanks agian x <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L, 3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L, 10L, 22L, 11L, 23L), .Label = c("2006-02", "200

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread Gabor Grothendieck
On Tue, Jul 8, 2008 at 2:43 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > There is no data in your data frame, just index info, so I assume you > want a zero width time series: > > zoo(, as.yearmon(x$Yearmonth, "%Y-%m")) > > This also works but then you are left with a character date which yo

Re: [R] making zoo objects with zoo without format argument?

2008-07-08 Thread Gabor Grothendieck
There is no data in your data frame, just index info, so I assume you want a zero width time series: zoo(, as.yearmon(x$Yearmonth, "%Y-%m")) This also works but then you are left with a character date which you may not want: zoo(, x$Yearmonth) On Tue, Jul 8, 2008 at 1:43 PM, stephen sefick <[E

Re: [R] time series by calendar week

2008-07-08 Thread Gabor Grothendieck
On Tue, Jul 8, 2008 at 10:25 AM, collonil <[EMAIL PROTECTED]> wrote: > > hello, > > i cant find a solution on this (might be) easy problem: > > i have a time serie by carlandar weeks, so for every carlendar week i have a > value. now i would like to use the functions for time series, so i change >

[R] Automatic placement of Legends

2008-07-08 Thread tolga . i . uzuner
Dear R-Users, I am looking for a way to get legends placed automagically in an empty spot on a graph. Additional complication comes through my useage of multiple graphs on the same plot through mfrow. Is there a way to achieve this in R ? I have legends for each of the sub-plots. Many thanks

[R] extracting index list when using tapply()

2008-07-08 Thread hesicaia
Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to be able to access both the results of tapply() and also the index variables. In case further explanation would help: I am analyzing a large (3million rows x 9 columns) spa

Re: [R] Plot

2008-07-08 Thread stephen sefick
are any of the subsets all NA? On Tue, Jul 8, 2008 at 1:39 PM, Paul Adams <[EMAIL PROTECTED]> wrote: > Hello everyone, > I am trying to plot an MvA plot with the following code: > dat<-read.table(file="C:\\Documents and Settings\\.txt",header=T) > file.show(file="C:\\Documents and Settings\\O

[R] making zoo objects with zoo without format argument?

2008-07-08 Thread stephen sefick
#this is a subset of a larger data frame and I am okay with subsetting it as there are redundant time stamps, but I would like to create a zoo object out of this and I am having a hard #time figuring out how to do this the date structure is year and then month x <- structure(list(Yearmonth = str

Re: [R] How I count the all possible samples??

2008-07-08 Thread John Kane
?unique --- On Tue, 7/8/08, muhammad faisal <[EMAIL PROTECTED]> wrote: > From: muhammad faisal <[EMAIL PROTECTED]> > Subject: [R] How I count the all possible samples?? > To: r-help@r-project.org > Received: Tuesday, July 8, 2008, 1:23 PM > Dear Members, > > I am facing a problem during countin

[R] Plot

2008-07-08 Thread Paul Adams
Hello everyone, I am trying to plot an MvA plot with the following code: dat<-read.table(file="C:\\Documents and Settings\\.txt",header=T) file.show(file="C:\\Documents and Settings\\Ow...txt") library(sma) data(MouseArray) dat.o<-as.list(dat) dat.o$R.2<-as.matrix(dat[,c(1:5)]) dat.o$G.2<-a

Re: [R] How I count the all possible samples??

2008-07-08 Thread Jorge Ivan Velez
Dear Muhammad, Does it work for you? x=scan() 41 12 22 23 32 22 23 32 22 21 12 22 23 31 12 21 11 11 14 43 32 22 23 34 41 13 33 32 21 12 22 24 44 42 21 12 23 31 12 23 33 32 22 22 21 13 31 11 12 22 21 14 43 33 32 23 34 43 32 23 33 34 41 13 34 44 42 23 33 32 24 44 44 43 33 31 14 43 32 22 22 21 12 22

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Jorge Ivan Velez
Dear Daniela, Try this: set.seed(123) myD<-data.frame(code=sample(letters[1:5],200,replace=T),value=rnorm(200)) tapply(myD$value,myD$code,mean) a b c d e 0.04401465 0.07813648 0.07018791 -0.14508544 -0.02369875 See ?tapply for more information

[R] How I count the all possible samples??

2008-07-08 Thread muhammad faisal
Dear Members, I am facing a problem during counting a sample. I have 4 characters i.e. A,C,G,T of DNA sequence and code this sequence by 1,2,3,4 respectively.  [1] "41" "12" "22" "23" "32" "22" "23" "32" "22" "21" "12" "22" "23" "31" "12"  [16] "21" "11" "11" "14" "43" "32" "22" "23" "34" "41"

[R] Gage R & R

2008-07-08 Thread Isabella Ghement
Hello, Could you let me know if there any R packages available for performing Gage R & R studies. Thank you! Sincerely, Isabella Isabella R. Ghement, Ph.D. Ghement Statistical Consulting Company 301-7031 Blundell Road, Richmond, B.C., Canada, V6Y 1J5 Tel: 604-767-1250 Fax: 604-270-3922 E-mail:

[R] R crash with ATLAS precompiled Rblas.dll on Windows XP Core2 Duo

2008-07-08 Thread Law, Jason
I noticed a problem using R 2.7.1 on Windows XP SP2 with the precompiled Atlas Rblas.dll. Running the code below causes R to crash. I started R using Rgui --vanilla and am using the precompiled Atlas Rblas.dll from cran.fhcrc.org dated 17-Jul-2007 05:04 for Core2 Duo. The code that causes the cr

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Rashid Nassar
Would ave() do what you want? Rashid On Tue, 8 Jul 2008, Daniela Ottaviani wrote: > Dear All, > > I have a database of 200 observations named myD. > In the dataframe there are a column named code (with codes varying from 1 to > 77), a column named "prevalence" with some quantitative measur

[R] fisher.test

2008-07-08 Thread Marta Colombo
Hi! I am Marta Colombo, student in Mathematical Engineering at "Politecnico di Milano". For my master degree thesis I have to analyze some categorical data. My dataset is composed by 327 individuals and 16 variables. I am using Fisher exact test to test independence on IxJ contingency tables, bu

Re: [R] time series by calendar week

2008-07-08 Thread Jeffrey J. Hallman
Or look at the fame package, which has ti (TimeIndex) and tis (TimeIndexedSeries) classes that handle this kind of problem. I think it's simpler and faster than the zoo stuff, but then I would say that, since I wrote it. Jeff "stephen sefick" <[EMAIL PROTECTED]> writes: > I don't know if this wi

Re: [R] Constrained optimization

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 11:28 AM, Kanak Choudhury <[EMAIL PROTECTED]> wrote: > i have a function like > > 1+sin(a+bx) where -pi/2<=a+bx<=pi/2 > > i made a progrom using constrOptim() function but it is not giving good > result. it depends on the initial value. but when i am doing simulation it > is

Re: [R] time series by calendar week

2008-07-08 Thread stephen sefick
I don't know if this will help, but look at the zoo, chron, and Posix Date Time packages/classes. On Tue, Jul 8, 2008 at 10:25 AM, collonil <[EMAIL PROTECTED]> wrote: > > hello, > > i cant find a solution on this (might be) easy problem: > > i have a time serie by carlandar weeks, so for every ca

[R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Gustaf Rydevik
On Tue, Jul 8, 2008 at 3:18 PM, Daniela Ottaviani <[EMAIL PROTECTED]> wrote: > Dear All, > > I have a database of 200 observations named myD. > In the dataframe there are a column named code (with codes varying from 1 to > 77), a column named "prevalence" with some quantitative measurements are >

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Ted Harding
On 08-Jul-08 13:18:13, Daniela Ottaviani wrote: > Dear All, > I have a database of 200 observations named myD. > In the dataframe there are a column named code (with codes varying > from 1 to 77), a column named "prevalence" with some quantitative > measurements are given and an column named Pr_mea

Re: [R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Greg Snow
Try: > myD <- transform(myD, Pr_mean = ave(prevalence, codes)) See ?ave and ?transform for details. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTEC

[R] How to draw dot plots for 2 vectors seperately

2008-07-08 Thread ss
Hi all, I want to draw dot plots for 2 rows in a matrix separately but want to have them close to each other. For example, I have a matrix a: > dim(a) [1] 319 2 and then transpose it to matrix b > b<-t(a) > dim(b) [1] 2 319 So I want to draw dot plots for these two rows separately but wan

Re: [R] Change language in Rcmdr

2008-07-08 Thread Adrian Dusa
On Monday 07 July 2008, Philippe Grosjean wrote: > Hello, > > As far as I know, Rcmdr is already translated in French. It is thus just > a question of switching R to French. Alternatively, you could switch the language after R starts: Sys.putenv(LANGUAGE="fr") After this, Rcmdr will be opened in

[R] simulate data for lme

2008-07-08 Thread melanie.r
hi. i did some research first, but didn't find what i was looking for... the thing is: i generated data with correlated errors and simulated the power with using aov(). what i wanna do now is something similar while using lme(), so that the corr-structure will be paid attention to. i'm not quite

[R] time series by calendar week

2008-07-08 Thread collonil
hello, i cant find a solution on this (might be) easy problem: i have a time serie by carlandar weeks, so for every carlendar week i have a value. now i would like to use the functions for time series, so i change structur to a time serie with cam <- ts(number,start=c(2001,1),deltat=7/365) or

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

2008-07-08 Thread Thomas Fröjd
Hi thanks for your answer. > ii) hist() will not show the same frequencies as density() unless hist has > unit bin sizes. density*length is showing number per unit change in Weight; > hist shows number per bin width. I belive this is what is confounding me. I have a bin width of 0.1 in the hist

[R] Question: Beginner stuck in a R cycle

2008-07-08 Thread Daniela Ottaviani
Dear All, I have a database of 200 observations named myD. In the dataframe there are a column named code (with codes varying from 1 to 77), a column named "prevalence" with some quantitative measurements are given and an column named Pr_mean, with no values. I would like to set a cycle to comp

Re: [R] attributing values to dataframe positions following eval

2008-07-08 Thread Greg Snow
In the long run it will probably be easier/simpler to work in a list (or a new environment) rather than doing everything in the global environment. For example you can do some of what you are trying below with code like: > polyList <- c("rs123", "rs124", "rs555", "rs000") > mylist <- sapply( pol

[R] Can I do regression by steps?

2008-07-08 Thread rlearner309
I saw this type of models in some of my company projects. To simplify: Y is regressed on X1 and X2. But the regression is done by two steps: First Y is regressed on X1 with intercept, and the residuals from the first step are used to regress on X2, without the constant. The reason to do so i

[R] workspace platform potabillity

2008-07-08 Thread Benjamin Otto
Hi, Can I save a workspace under a 64bit machine in a way that allows reading it correctly on a 32bit machine? Will the normal procedure of save.image() or save(#object#) produce errors here, because the data is stored in a binary mode? Regards, Benjamin ==

Re: [R] R package

2008-07-08 Thread Duncan Murdoch
On 7/8/2008 10:53 AM, Sergi M.Garrido wrote: Hello, I have tried to create a package, and I have got it. I checked the files and I built the package. Nevertheless, I want a .pdf file with the package's documentation. Anyone know what I have to do? In a shell in Windows, R CMD Rd2dvi.sh --p

Re: [R] Manipulate Data (with regular expressions)

2008-07-08 Thread Gabor Grothendieck
Try this: x <- factor(c("220", "220a", "221", "221b", "B221")) pat <- "[^0-9]+" # match non-digits nums <- as.numeric(gsub(pat, "", x)) has.lets <- as.numeric(regexpr(pat, x) > 0) On Tue, Jul 8, 2008 at 7:11 AM, Kunzler, Andreas <[EMAIL PROTECTED]> wrote: > Dear Everyone, > > > > I try to automa

Re: [R] Manipulate Data (with regular expressions)

2008-07-08 Thread oscar Linares
Check out sedit() in the Hmisc package Cheers! --- On Tue, 7/8/08, Kunzler, Andreas <[EMAIL PROTECTED]> wrote: > From: Kunzler, Andreas <[EMAIL PROTECTED]> > Subject: [R] Manipulate Data (with regular expressions) > To: r-help@r-project.org > Date: Tuesday, July 8, 2008, 7:11 AM > Dear Everyon

[R] R package

2008-07-08 Thread Sergi M.Garrido
Hello, I have tried to create a package, and I have got it. I checked the files and I built the package. Nevertheless, I want a .pdf file with the package's documentation. Anyone know what I have to do? Thanks in advance, Sergi Martínez [[alternative HTML version deleted]] ___

Re: [R] about EM algorithm

2008-07-08 Thread Patrick Burns
I don't think there can be. The EM algorithm isn't really an algorithm -- it's an outline for an algorithm. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Peng Jiang wrote: Hi, dear R experts . is there

Re: [R] attributing values to dataframe positions following eval

2008-07-08 Thread John Kane
Does not just polyList[[1]])[1, 1] <- 5 work? --- On Tue, 7/8/08, Stephane Bourgeois <[EMAIL PROTECTED]> wrote: > From: Stephane Bourgeois <[EMAIL PROTECTED]> > Subject: [R] attributing values to dataframe positions following eval > To: r-help@r-project.org > Received: Tuesday, July 8, 2008,

Re: [R] Histogram with colors according to factor

2008-07-08 Thread hadley wickham
> Given a data frame with a continuous variable and a factor. I would like to > generate a histogram of the continuous variable, where each bar is filled > with different colors according to the percentage of factor values falling > into this region of the continuous variable. How exactly do you w

[R] Specific question on LDheatmap

2008-07-08 Thread Boks, M.P.M.
Dear R-friends, I am stuck making an LD plot of a small genotype set: An exert of my data (genotypes) >tempped.exert V27/V28 V33/V34 V39/V40 V41/V42 1 B/B B/B A/A B/B 2 B/A B/B A/B B/B 3 B/B B/B A/A B/B 4 B/A B/A A/B B/A 5

[R] about EM algorithm

2008-07-08 Thread Peng Jiang
Hi, dear R experts . is there any package contain an universal EM procedure, that is , for arbitrary d.f. , not just the one in mclust . thanks in advance best regards --- Peng Jiang 江鹏 ,Ph.D. Candidate Antai College of Economics & Management 安泰经济管理

[R] help for xvalid with external data

2008-07-08 Thread Giovanni Bacaro
Hi, as usual I have a problem with R functions! I formulated a geostatistical model with geoR. I decided to include some covariates in my model, and I estimated all the parameters (linear model and covariance function parameters) by the likfit function as follows: mod1<-likfit(geodata, ini=va

Re: [R] one-site competition data // curve fitting

2008-07-08 Thread Ben Bolker
Joerg van den Hoff fzd.de> writes: > > > res <- nls( y ~ (x * Bmax) / (x + Kd), start = list(Bmax=, Kd=)) > > (providing some sensible start values for the free parameters , of course) > > cf. `nls' manpage for details There are also "self-starting" models -- SSmicmen I think? Maybe in nlm

Re: [R] one-site competition data // curve fitting

2008-07-08 Thread Gabor Grothendieck
Check out the drc package. On Mon, Jul 7, 2008 at 5:15 AM, Thiemo Schreiber <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I have biological data from a competition experiment where a free ligand is > titrated against the binding of a protein. > > Now, I would like to fit a standard on-site bin

Re: [R] Histogram with colors according to factor

2008-07-08 Thread ONKELINX, Thierry
After reading your question again I came up with these plots. dataset <- data.frame(x = c(rnorm(1000), rnorm(200, mean = 1)), y = gl(2, 100, labels = LETTERS[1:2])) ggplot(dataset, aes(x = x, group = y)) + stat_bin(aes(fill = ..count..), width = 0.2) + scale_fill_gradient(low = "red", high = "gree

Re: [R] Help with eigenvectors

2008-07-08 Thread Ben Bolker
Francisco Javier Santos Alamillos ujaen.es> writes: > > Hi everybody, > > I have some problems with the function eigen. I have a square matrix and I > want to calculate the eigenvalues and eigenvectors. I apply the function > eigen and I get it, however when I solve the same problem in Statisti

Re: [R] Histogram with colors according to factor

2008-07-08 Thread Hans W. Borchers
No; thanks for your try, but this is not what I want. Here each bar has one single color. I would like to render each bar with several colors according to the distribution of a factor. I now learned that this is called "stacked histogram" (damned Excel). In the following entry https://stat

[R] RES: Sum(Random Numbers)=100

2008-07-08 Thread Leandro Marino
One of possible solutions is: generate all the numbers. num <- rpois(...) num <- round(num/sum(num)*100,0) sum(num) I don't know if it is the best solution, but is one! Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Peter Dalgaard Enviada e

Re: [R] Sum(Random Numbers)=100

2008-07-08 Thread Hanke, Alex
Hi Peng, Does this help? sum(diff(c(0,sort(sample(seq(1,99,1),50,replace=T)),100))) Regards Alex -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peng Jiang Sent: July 8, 2008 3:57 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] Sum(Random N

[R] Help with eigenvectors

2008-07-08 Thread Francisco Javier Santos Alamillos
Hi everybody, I have some problems with the function eigen. I have a square matrix and I want to calculate the eigenvalues and eigenvectors. I apply the function eigen and I get it, however when I solve the same problem in Statistica software, I realise that some eigenvectors are the opposite. How

Re: [R] How to change labels in a histogram

2008-07-08 Thread S Ellison
>>> Lord Yo <[EMAIL PROTECTED]> 07/08/08 9:00 AM >>> >I am trying to add a percent sign to my labels in a hist() plot. ?hist says "labels: logical or character. " This should be a clue; labels could be a character vector. Try x<-rlnorm(128, 1) h<-hist(x, plot=F) plot(h, labels=paste(round(100*

Re: [R] Histogram with colors according to factor

2008-07-08 Thread ONKELINX, Thierry
Is this what you want? dataset <- data.frame(x = c(rnorm(100), runif(100), rchisq(100, 1)), y = gl(3, 100, labels = LETTERS[1:3])) ggplot(dataset, aes(x = x, fill = y)) + geom_histogram() ggplot(dataset, aes(x = x, fill = y)) + geom_histogram(position = "dodge") HTH, Thierry -

[R] Manipulate Data (with regular expressions)

2008-07-08 Thread Kunzler, Andreas
Dear Everyone, I try to automatically manipulate the data of a variable (class = factor) like x 220 220a 221 221b B221 Into two variables (class = numeric) like x y 220 0 220 1 221 0 221 1 221 1 y has to carry the information about the class (number or st

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

2008-07-08 Thread S Ellison
Two thoughts: i) If you have a narrow distribution, the density can be higher than 1. The area comes out at 1 for density, and n for the frequency. ii) hist() will not show the same frequencies as density() unless hist has unit bin sizes. density*length is showing number per unit change in Weig

[R] Multiple Plots and y Axis Labels

2008-07-08 Thread jonboym
Hi, I'm using the mfrow parameter in par() to plot several timeseries with a common time x axis as a sequence of plots one below the other. I reduced the top and bottom margins to zero to get a very nice looking plot but sometimes the labels on the y axes from one plot overlap with the y axis la

[R] shading an area in a edf

2008-07-08 Thread squall44
Hi, I've got the following edf: *** x = c(1.6,1.8,2.4,2.7,2.9,3.3,3.4,3.4,4,5.2) F2.5 <- ecdf(x) plot(F2.5, verticals= TRUE, do.p = TRUE, lwd=3, ylab = "", xlab = "", xlim = c(1,5.5)) abline(h= (0:5)*0.2) #mean abline(v=mean(x), lwd=2) mtext(text=expression(bar(x

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

2008-07-08 Thread Thomas Fröjd
Hi! Sorry for bothering you again but I can't seem to get it right. When i multiply the density with the number of observations it seems to be way to high, The reference curve is drawn at maybe 20 times higher frequency count than it should be. I use the following code where "weights$Weight" is

[R] Histogram with colors according to factor

2008-07-08 Thread Hans W. Borchers
Given a data frame with a continuous variable and a factor. I would like to generate a histogram of the continuous variable, where each bar is filled with different colors according to the percentage of factor values falling into this region of the continuous variable. I looked into packages like

Re: [R] one-site competition data // curve fitting

2008-07-08 Thread Joerg van den Hoff
On Mon, Jul 07, 2008 at 11:15:57AM +0200, Thiemo Schreiber wrote: > Hello everyone, > > I have biological data from a competition experiment where a free ligand is > titrated against the binding of a protein. > > Now, I would like to fit a standard on-site binding curve to this data in > order

[R] Change legend in the 'hydrogeo' package

2008-07-08 Thread Tomas Lanczos
At first sorry for the possibly dumb question of a newbie. I am using the hydrogeo package to visualize approx. 300 data within the Piper-Hill diagrams. The package is using a dataframe with 6 columns, first of them is containing the row.names, next four with the data itself. The last column c

  1   2   >