[R] Can R do this ?

2008-07-08 Thread Daren Tan
I have a folder full of pngs and jpgs, and would like to consolidate them into a pdf with appropriate title and labels. Can this be done via R ? _ Easily publish your photos to your Spaces with Photo Gallery. [[alternative

[R] Sum(Random Numbers)=100

2008-07-08 Thread Shubha Vishwanath Karanth
Hi R, I need to generate 50 random numbers (preferably poisson), such that their sum is equal to 100. How do I do this? Thank you, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.org

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

2008-07-08 Thread Shubha Vishwanath Karanth
...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 allocations(i.e., 5 8 56 12 etc without any decimals)... Thank you, Shubha -Original

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

2008-07-08 Thread Peng Jiang
Hi, I am afraid there is no other way except using brute force, that is , loop until their sum reaches your expectation. it is easy to figure out this probability by letting their sum to be a new random variable Z and Z = X_1 + \ldots + X_n where X_i ~ Poisson({\lambda}_i) . By

Re: [R] Survey questions

2008-07-08 Thread Tobias Verbeke
Farley, Robert wrote: I found and loaded the survey package. ?rake and ?postStratify seem promising. Are there other packages/procedures I've missed? Are there online references that an R newbie could use to feel comfortable applying these procedures to a survey? How about a reference

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

2008-07-08 Thread Moshe Olshansky
For arbitrary lambda_i it can take years until the sum of 50 such random variables is 100! But if one makes lambda_i = 2, then the probability that the sum of 50 of them equals 100 is about 1/sqrt(2*pi*100), so on average that sequence of 50 numbers must be generated about sqrt(2*pi*100)) ~ 25

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

2008-07-08 Thread Daniel Malter
what you could (what I suggest) is not technically clean because your draw is not strictly random any more. But if you want to distribute 100 on 50 units with a Poisson-distributed variable x, then your lambda must be 100/50=2. You could then sample Poisson distribution ( rpois(50,2) ), sum over

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

2008-07-08 Thread Daniel Malter
sum.x=sum(x) while(sum.x!=100) x=rpois(50,2) I have tried this, but this can really take some time. In fact, I would suggest an similarly fraudulent activity, draw 49 values, and set the last nonrandomly to the difference between 100 and the sum of the 49 values if this difference is a.)

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

2008-07-08 Thread Daniel Malter
For some reason, the while-loop I sent did not work. It was running forever although I don't know why. Anyway, using repeat works fast: repeat{x=rpois(50,2) if(sum(x)==100) break } - cuncta stricte discussurus - -Ursprüngliche

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

2008-07-08 Thread Richard Pearson
Shubha Does table(ceiling(runif(100,0,50))) give you something like you want? Richard. Shubha Vishwanath Karanth 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

[R] Change in behaviour of sd()

2008-07-08 Thread Fiona Johnson
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)) apply(a,2,sd,na.rm=T) In R2.6.0 this gives (which is

[R] How to change labels in a histogram

2008-07-08 Thread Lord Yo
Hi everyone I am trying to add a percent sign to my labels in a hist() plot. labels = TRUE gives me the values, but I don't know how to add the percent sign. I would prefer to annote the plot after drawing it, e.g. using text(), but don't know how to address the positions in a standard

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

2008-07-08 Thread Bill.Venables
x - rmultinom(1, 100, rep(1/50, 50)) as.vector(x) [1] 4 0 5 4 2 2 4 4 3 2 4 1 1 1 2 0 0 0 2 1 0 4 3 3 2 4 2 2 2 0 1 1 4 2 2 2 0 1 1 1 2 3 2 2 4 1 [47] 3 1 3 0 sum(x) [1] 100 Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826

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

2008-07-08 Thread Peter Dalgaard
Richard Pearson wrote: Shubha Does table(ceiling(runif(100,0,50))) give you something like you want? That's a neat(-ish) solution of Moshe's multinomial formulation. More generally, if p is a vector of probabilities you can simulate independent indicators with cut(runif(N), c(0,cumsum(p))

[R] what does this warning mean ?

2008-07-08 Thread Peng Jiang
Hi , dear R experts . I use the package mclust to do some cluster analysis . doing the example that the document provides faithfulModel - Mclust( faithful ) plot( faithfulModel ) I remember in R 2.7.0 I can get several figures using the plot command, but after I update R, using the

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

2008-07-08 Thread Philipp Pagel
I am trying to add a percent sign to my labels in a hist() plot. labels = TRUE gives me the values, but I don't know how to add the percent sign. I would prefer to annote the plot after drawing it, e.g. using text() This is probably a good starting point: x - rnorm(100) h - hist(x)

[R] package segmented problem

2008-07-08 Thread Alan Kelly
Hi, while using package segmented (version 0.2-4) by Vita Muggeo to investigate a possible change point (around time = 222) in admissions for a specific medical condition I had the following error message: fit2.seg-segmented(fit2, seg.Z=~time,psi=222) Error in segmented.lm(fit2, seg.Z =

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

2008-07-08 Thread Patrick Burns
So really you want random portfolios. While your specification may satisfy the demands of your current application, in general generating random portfolios is more complicated. There can be a large number of constraints required to make the portfolios conform to a realistic situation. Two

Re: [R] Can R do this ?

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 6:59 AM, Daren Tan [EMAIL PROTECTED] wrote: I have a folder full of pngs and jpgs, and would like to consolidate them into a pdf with appropriate title and labels. Can this be done via R ? I do not know whether R can do that. However, you can accomplish that easily with

Re: [R] Can R do this ?

2008-07-08 Thread Gabor Csardi
If this is about more than a handful files, then it is really painful to do it with OpenOffice.org or LyX, I guess. You can use imagemagick, this is fairly standard on Linux. Then it is something like this, assuming you have bash: for f in *.png; do convert $f ${f%png}pdf; done for f in *.jpg;

Re: [R] Can R do this ?

2008-07-08 Thread Mark Difford
Hi Daren, Can R (out)do Emacs? I think you just need to ?Sweave a little. Mark. Daren Tan wrote: I have a folder full of pngs and jpgs, and would like to consolidate them into a pdf with appropriate title and labels. Can this be done via R ?

Re: [R] Can R do this ?

2008-07-08 Thread Gabor Csardi
Ooops, please ignore my previous mail, I did not read the question carefully enough. Gabor On Tue, Jul 08, 2008 at 02:27:51AM -0700, Mark Difford wrote: Hi Daren, Can R (out)do Emacs? I think you just need to ?Sweave a little. Mark. Daren Tan wrote: I have a folder

[R] attributing values to dataframe positions following eval

2008-07-08 Thread Stephane Bourgeois
Hi everybody, I've been looking around, but can't seem to find the answer. I get a list of names (which vary, so I never know them in advance), and transform them into variables, each of which is a dataframe, using assign: polyList - c(rs123, rs124, rs555, rs000) numPoly -

Re: [R] Problems with lm()

2008-07-08 Thread Chibisi Chima-Okereke
Hi Daniel, Thanks for the info., I read the wiki link and it made sense Chibisi On Tue, Jul 8, 2008 at 1:42 AM, Daniel Malter [EMAIL PROTECTED] wrote: If that is so, i.e. x1=-x2, then they do not convey different meaning and cannot be estimated. Think about it that way you leave the house 8

[R] Constrained optimization

2008-07-08 Thread Kanak Choudhury
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 impossible of find the best initial value for every step. also i am not exactly sure how

[R] forecast xreg

2008-07-08 Thread Vorlow Constantinos
Dear all, I am fitting an arimax (arima with some extra explanatory variables) model to a time series. Say, I have a Y (dependent variable) and an X (explanatory). Y is 100 observations (time series) and X is 100 + 20 (20 to use for the forecast horizon). I can not make xreg work with

[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

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 to

[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

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] 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) ==

[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

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

[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

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

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,

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

[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

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

Re: [R] Help with eigenvectors

2008-07-08 Thread Ben Bolker
Francisco Javier Santos Alamillos fsantos at 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

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 binding

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

2008-07-08 Thread Ben Bolker
Joerg van den Hoff j.van_den_hoff at 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

[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,

[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] 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

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 want

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, 5:40 AM

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

[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] 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 Everyone,

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 automatically manipulate the

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

[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

[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

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( polyList,

[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

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

[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

[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

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] 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 want

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 PROTECTED]

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_mean,

[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 given

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 carlendar

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 impossible

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 will

[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, but

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 measurements

[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

[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] 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 13 33 32 21 12  [31] 22 24 44 42 21 12 23 31 12

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

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

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 counting a

[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)])

[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 =

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

[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)

[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

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 structur

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

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 you may

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,

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
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 PROTECTED]

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

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 -

[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 in

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] 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, but

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=485root=zoo;) plot(x.zoo[, 25]) axis.zoo uses the same algorithm as axis.Date in R and so it gives similar results: #

[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,

[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?

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

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

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 useage

[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

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))

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

  1   2   >