Re: [R] a very simple question

2012-03-19 Thread David Winsemius
On Mar 18, 2012, at 4:43 PM, Dajiang Liu wrote: Dear All, I have a seemingly very simple question, but I just cannot figure out the answer. I attempted to run the following:a=0.1*(1:9);which(a==0.3);it returns integer(0). But obviously, the third element of a is equal to 0.3. I must

Re: [R] Problem reading mixed CSV file

2012-03-19 Thread Ashish Agarwal
This is quite a CPu consuming process. My system got hung up for the big file I have. Within the for loop that you have suggested, can't I have a case statement for different value of nfields to be read and specify what format does the variable needs to be read? something like case # input format

[R] Sankey Diagrams in R

2012-03-19 Thread Eric Fail
Dear R-list, I am trying to visualize where the dropout happens in our patient flow. We are currently using traditional flowcharts and it bothers me that I can't visualize both the percentage and the flow in one diagram. The other day I came across some interesting diagrams doing exactly what

Re: [R] randomly subsample rows from subsets

2012-03-19 Thread Rui Barradas
Hello, Try text= fish fam length 1 a 71.46 2 a 71.06 3 a 62.94 4 b 79.46 5 b 52.38 6 b 56.78 7 b 92.08 8 c 96.86 9 d 98.09 10 d 17.23 11 d 98.35 12 d 82.43 13 e 83.85 14 e 33.92 15 e 23.16 16 e 31.39 17 e 57.08 18 e 27.05 19 f 62.38 20 f 83.21 21 f 18.72 22 f 84.32 23 g 15.99 24 h 40.33 25 h

[R] How to use R script in VB?

2012-03-19 Thread Dong-Joon Lim
Hello R friends, I want to use my R script in VB to make macro in Excel. I tried with RExcel but it seems to me that this package is just GUI API and I still have to run(connect) R to use the script. Google tells me there are some ways to make R script as an independent library/module/header so

[R] Output formatting in Latex and R

2012-03-19 Thread Manish Gupta
I am working on Latex and R and using following code. echo=FALSE= infile-read.table(test.txt,sep=\t) Col3 - unique(infile[,3]) LCol3 - length(Col3) for (i in 1:LCol3) { print(paste(Column, Col3[i])) print(infile[infile[,3]==Col3[i],-3]) } @ I am getting following output. 1] Column C V1 V2 V4

Re: [R] How to Group Categorical data in R?

2012-03-19 Thread Manish Gupta
It is working fine. Thanks -- View this message in context: http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4483565.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Output formatting in Latex and R

2012-03-19 Thread priyank
Col3 - unique(Msg17$V3) LCol3 - length(Col3) for (i in 1:LCol3) { print(paste(Column, Col3[i])) write.table(Msg17[Msg17$V3==Col3[i],-3], row.names=F, col.names=F,quote=F) # If you R implementation does not accept 'F', use 'FALSE' } -- View this message in context:

Re: [R] Output formatting in Latex and R

2012-03-19 Thread Manish Gupta
Great it works! But how can i put space or tab between two records? -- View this message in context: http://r.789695.n4.nabble.com/Output-formatting-in-Latex-and-R-tp4483631p4483921.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] multiple density plot

2012-03-19 Thread K. Elo
Hi, some sample data would be *very* helpful... Kind regards, Kimmo 16.03.2012 15:44, statquant2 wrote: Hello I am looking for a special plot. Let's suppose I have *100 days and *each day I have a (1D) distribution of the same variable. I would

Re: [R] a very simple question

2012-03-19 Thread Rainer Schuermann
As to the reasons, David as given you the necessary hints. In order to get around the issue, here is what I do: a - round( 0.1 * ( 1:9 ), 1 ) a [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 which( a == 0.3 ) [1] 3 Rgds, Rainer Original-Nachricht Datum: Sun, 18 Mar 2012

Re: [R] Singleton pattern

2012-03-19 Thread David Cassany
Thanks all of your answers and advices! They brought me some light! I'll have a look to memois package and to tracemem function in order to check if they can help me somehow, at least to understand and trace in detail how memory gets consumed. Thank you all! David 2012/3/16 Jan T. Kim

Re: [R] a very simple question

2012-03-19 Thread Petr Savicky
On Sun, Mar 18, 2012 at 09:43:54PM +, Dajiang Liu wrote: Dear All, I have a seemingly very simple question, but I just cannot figure out the answer. I attempted to run the following:a=0.1*(1:9);which(a==0.3);it returns integer(0). But obviously, the third element of a is equal to 0.3.

Re: [R] How to use R script in VB?

2012-03-19 Thread Jeff Newmiller
Actually, RExcel and the StatConn DCOM connector are what you want, and this is not the right place to discuss it. Go to http://www.statconn.com/, and read the license carefully. --- Jeff NewmillerThe

Re: [R] install R package on Unix cluster

2012-03-19 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 18/03/12 14:40, Uwe Ligges wrote: On 18.03.2012 05:47, Lorenzo Cattarino wrote: Hi R users, Working from a PC, I am trying to install the spatstat package on a Unix cluster. I created the following PBS file to send a job array:

Re: [R] Output formatting in Latex and R

2012-03-19 Thread Manish Gupta
Hi, I am using follosing code and getting the below output. echo=FALSE= infile-read.table(/home/manish/Desktop/test.txt,sep=\t,header=TRUE) Col3 - unique(infile[,3]) LCol3 - length(Col3) for (i in 1:LCol3) { print(paste(Disease Risk:, Col3[i]),row.names=FALSE, col.names=FALSE,quote=FALSE)

Re: [R] Problem reading mixed CSV file

2012-03-19 Thread Jim Holtman
How big is the file? In the example I sent I waa using 'textConnection' to reread the input. If the file is large, this can be slow. You will have better luck writing the converted data outmto a temporarynfile and reading it right back in. I am not such exactly what you are asking. You can

Re: [R] Help with dlply, loop and column names

2012-03-19 Thread Peter Meilstrup
I'm not sure I follow exactly what group of regression models you want to create, but a good first step might be to use reshape so that each party's vote share goes on a different row and the vote shares are all in the same column. Then you can use plyr grouping on tipo and party to make your

Re: [R] Problem reading mixed CSV file

2012-03-19 Thread Petr PIKAL
Hi This is quite a CPu consuming process. My system got hung up for the big file I have. Within the for loop that you have suggested, can't I have a case statement for different value of nfields to be read and specify what format does the variable needs to be read? something like case

Re: [R] Help with dlply, loop and column names

2012-03-19 Thread Igor Sosa Mayor
Peter: many thanks for your help. This is basically what I wanted to do and in a much more elegant way. On Mon, Mar 19, 2012 at 03:13:40AM -0700, Peter Meilstrup wrote: I'm not sure I follow exactly what group of regression models you want to create, but a good first step might be to use

[R] plot method for rasters and layout

2012-03-19 Thread Olivier Eterradossi
Hi list, I thought I was used to layouts, but today I am facing a problem I cannot overcome : On my R installation (Windows 7 Pro, SP1, R version 2.13.0, daily update of packages), I am not able to put raster plots in user defined layouts : layout.matrix-matrix(c(1,2,3,4,5,5),2,3)

[R] Call for chapters: Data Mining Applications with R

2012-03-19 Thread Yanchang Zhao
Book title: Data Mining Applications with R URL: http://www.rdatamining.com/books/book2. Publisher: Elsevier Chapter proposal due date: 30 April 2012 Introduction R is one of the most widely used data mining tools in scientific and business applications, among dozens of

Re: [R] plot method for rasters and layout

2012-03-19 Thread Michael Sumner
Is this with SDI in Windows? I'd update to a recent version of R, and please provide reproducible code next time. It could be the same as this issue, now long ago fixed: https://stat.ethz.ch/pipermail/r-devel/2011-February/059906.html Cheers, Mike. On Mon, Mar 19, 2012 at 9:57 PM, Olivier

Re: [R] plot method for rasters and layout

2012-03-19 Thread Olivier Eterradossi
Mike, It is with SDI in Windows. Here is reproducible code (by the way, I just add the opening of any raster and plot it four times). library (raster) b- brick(system.file(external/rlogo.grd, package=raster)) layout.matrix-matrix(c(1,2,3,4,5,5),2,3,byrow=TRUE) layout(mat=layout.matrix)

Re: [R] assign a value to an element

2012-03-19 Thread John Kane
I am not sure that I understand but does something like this do what you want? ec-1:10 vec[vec==4] - 100 vec - 1:10 vec[ vec==4 | vec==8] - 100 vec - 1:10 aa - 50 vec[vec==4] - aa John Kane Kingston ON Canada -Original Message- From: marc_...@yahoo.fr Sent: Sun, 18 Mar 2012

[R] Reshape data frame with dcast and melt

2012-03-19 Thread mails
Hello, I implemented two functions reshape_long and reshape_wide (see full working example below) to reshape data frames. I created several small examples and the two functions seemed to work properly. However, using the reshape_wide function on my real data sets (about 200.000 to 300.000 rows)

[R] Issue with asin()

2012-03-19 Thread Letnichev
Hello everyone, I am working for a few days already on a basic algorithm, very common in applied agronomy, that aims to determine the degree-days necessary for a given individual to reach a given growth stade. The algorithm (and context) is explained here:

[R] Problem with package tensor

2012-03-19 Thread Peppe Ricci
Hi, I'm using R to create multidimensional data, ie tensors. R, for my work, is very good for import the data and I have seen that there are packages to manage tensor and to factor the tensor. I would ask a help regarding the package called tensor and tensorA. I have seen, unfortunately, that the

Re: [R] plotting border over map

2012-03-19 Thread uday
Hi Ray, Thanks for reply /R/PlotGridded2DMap.R /R/image.plot.fix.R /R/image.plot.plt.fix.r are the functions those I wrote for plotting and they work with another data, but only I have some issue with only the codes those I provided before. and what do you mean by I am redefining the map()

[R] what is p,d q in arima() function of time series

2012-03-19 Thread sagarnikam123
i am new to time series i found in help about arima arima(x = data, order = c(p, d, q)) what is exactly p,d,q? if i not changed them,what effects will happens? -- View this message in context: http://r.789695.n4.nabble.com/what-is-p-d-q-in-arima-function-of-time-series-tp4484368p4484368.html

[R] How to cluster/classify following time series?

2012-03-19 Thread sagarnikam123
how to cluster/classify attached time series ?(each column/time series consider as single unit while clustering/classifying) if my concept is wrong,tell me how to extract time series with highest information content ? given file is to do it http://r.789695.n4.nabble.com/file/n4484173/rasta.txt

[R] Save File after order

2012-03-19 Thread MSousa
Hello,     I'm trying to write the sorted data in a file of a data.frame, My question and my problem is that when I record in file adds a new column row.name, which apparently is the original position in the file.     I wanted to write to the file without this column

[R] fitted values with locfit

2012-03-19 Thread Soberon Velez, Alexandra Pilar
Dear memberships, I'm trying to estimate the following multivariate local regression model using the locfit package: BMI=m1(RCC)+m2(WCC) where (m1) and (m2) are unknown smooth functions. My problem is that once I get the regression done I cannot get the fitted values of each of this

Re: [R] a very simple question

2012-03-19 Thread Dajiang Liu
Thanks a lot for the clarification. I just find it very bizarre that if you run a=0.1*(1:9);which(a==0.4) it returns the right answer. Anyway, I will pay attention next time. Thanks a lot. Date: Mon, 19 Mar 2012 08:59:59 +0100 From: rainer.schuerm...@gmx.net Subject: Re: [R] a very simple

[R] regression with proportion data

2012-03-19 Thread Georgiana May
Hello, I want to determine the regression relationship between a proportion (y) and a continuous variable (x). Reading a number of sources (e.g. The R Book, Quick R,help), I believe I should be able to designate the model as: model-glm(formula=proportion~x, family=binomial(link=logit)) this runs

[R] Dotplot: how to change size in the y lab ?

2012-03-19 Thread Jose Bustos Melo
Hi everyone, I'm trying to reduce the font size in the Y  exe in this plot: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=150 Anyone knows how to do it? I have checked the argument lab.cex and cex, but any of these works! if you want to check us this code: ### read the data

Re: [R] Issue with asin()

2012-03-19 Thread Duncan Murdoch
On 12-03-19 7:42 AM, Letnichev wrote: Hello everyone, I am working for a few days already on a basic algorithm, very common in applied agronomy, that aims to determine the degree-days necessary for a given individual to reach a given growth stade. The algorithm (and context) is explained here:

Re: [R] regression with proportion data

2012-03-19 Thread Doran, Harold
The logit link requires a binary response variable, not a proportion. Better bet is a beta regression. You can also do some stuff with linear regression if you do some transformations, but linear regression assumes the outcome is any number on the real number line bounded between -Inf and Inf.

Re: [R] Issue with asin()

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 12:42, Letnichev wrote: Hello everyone, I am working for a few days already on a basic algorithm, very common in applied agronomy, that aims to determine the degree-days necessary for a given individual to reach a given growth stade. The algorithm (and context) is

Re: [R] a very simple question

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 13:47, Dajiang Liu wrote: Thanks a lot for the clarification. I just find it very bizarre that if you run a=0.1*(1:9);which(a==0.4) it returns the right answer. Anyway, I will pay attention next time. Thanks a lot. Look at a = 0.1*(1:4) a - 0.4 [1] -0.3 -0.2

Re: [R] regression with proportion data

2012-03-19 Thread Rubén Roa
Your response variable is not binomial, it's a proportion. Try the betareg function in the betareg package, which more correctly assumes that your response variable is Beta distributed (but beware that 1 and 0 are not allowed). The syntax is the same as in a glm. HTH Ruben -Mensaje

Re: [R] regression with proportion data

2012-03-19 Thread Jorge I Velez
Hi Georgiana, Take a look at the betareg package at http://cran.r-project.org/web/packages/betareg/index.html HTH, Jorge.- On Mon, Mar 19, 2012 at 10:05 AM, Georgiana May wrote: Hello, I want to determine the regression relationship between a proportion (y) and a continuous variable (x).

Re: [R] Issue with asin()

2012-03-19 Thread Sarah Goslee
Hi, You're not following the algorithm as given. The asin step shouldn't be done for all values, but only for the ones that don't meet the previous conditions. You're trying to calculate that step for ALL values, then only use certain ones. You must instead subset the values, THEN calculate that

Re: [R] Save File after order

2012-03-19 Thread Sarah Goslee
It doesn't have anything to do with your use of order(). Those are the row names of your data frame. You can disable writing them with the row.names=FALSE argument to write.table(). Sarah On Mon, Mar 19, 2012 at 8:16 AM, MSousa ricardosousa2...@clix.pt wrote: Hello,     I'm trying to write

Re: [R] regression with proportion data

2012-03-19 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Georgiana May Sent: 19 March 2012 14:06 To: r-help@r-project.org Subject: [R] regression with proportion data I understand that the binomial function concerns successes

Re: [R] what is p,d q in arima() function of time series

2012-03-19 Thread R. Michael Weylandt
https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average You may also be interested in forecast:::auto.arima Michael On Mon, Mar 19, 2012 at 6:54 AM, sagarnikam123 sagarnikam...@gmail.com wrote: i am new to time series i found in help about arima arima(x = data, order = c(p, d,

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread R. Michael Weylandt
To view the source of (most) functions, simply type funcname without parentheses: here, you get dmvt function (x, delta, sigma, df = 1, log = TRUE, type = shifted) { if (df == 0) return(dmvnorm(x, mean = delta, sigma = sigma, log = log)) if (is.vector(x)) { x - matrix(x,

[R] Google Summer of Code

2012-03-19 Thread John C Nash
Once again, R has been accepted as an organization for the Google Summer of Code (2012). We invite students interested in this program to learn more about it. A good starting point is http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2012. The Google GSOC home page is

Re: [R] a very simple question

2012-03-19 Thread Ted Harding
On 19-Mar-2012 Dajiang Liu wrote: Thanks a lot for the clarification. I just find it very bizarre that if you run a=0.1*(1:9);which(a==0.4) it returns the right answer. Anyway, I will pay attention next time. Thanks a lot. The basic explanation is that, for an integer r (0r10), what is

Re: [R] Identifying a change in events between bins

2012-03-19 Thread Robert Baer
Your description was too general for me to know exactly what you want but perhaps this will help you solve your own problem set.seed(123) evtlist = sample(c('fwd','rev'),100,replace=TRUE) evtlist [1] fwd rev fwd rev rev fwd rev rev rev fwd rev fwd rev [14] rev fwd rev fwd fwd fwd rev rev rev

Re: [R] Dotplot: how to change size in the y lab ?

2012-03-19 Thread ilai
On Mon, Mar 19, 2012 at 7:56 AM, Jose Bustos Melo jbustosm...@yahoo.es wrote: Hi everyone, I'm trying to reduce the font size in the Y  exe in this plot: dotplot( bank ~ MV2007 + MV2009 , data = d, horiz = T,  par.settings = list(  superpose.symbol = list(  pch = 21,  fill = c( lightblue,

Re: [R] a very simple question

2012-03-19 Thread Petr Savicky
On Mon, Mar 19, 2012 at 12:47:12PM +, Dajiang Liu wrote: Thanks a lot for the clarification. I just find it very bizarre that if you run a=0.1*(1:9);which(a==0.4) it returns the right answer. Anyway, I will pay attention next time. Thanks a lot. Hi. Yes, these things are bizarre

[R] plm function

2012-03-19 Thread Millo Giovanni
Dear Ieva, plm(.., model=within) (which is the default for plm()) estimates a within model on time-demeaned data, which is equivalent to using the LSDV estimator. Therefore any time-constant dummy variable you add by hand will be discarded because of perfect collinearity. What kind of dummies

Re: [R] glm: getting the confidence interval for an Odds Ratio, when using predict()

2012-03-19 Thread peter dalgaard
On Mar 19, 2012, at 03:32 , Dominic Comtois wrote: Say I fit a logistic model and want to calculate an odds ratio between 2 sets of predictors. It is easy to obtain the difference in the predicted logodds using the predict() function, and thus get a point-estimate OR. But I can't see how to

[R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
Hello, I am trying to fit my histogram to a smooth Gaussian curve(the data closely resembles one except a few bars). This is my code : #!/usr/bin/Rscript out_file = irc_20M_opencl_test.png png(out_file) scan(my.csv) - myvals hist(myvals, breaks = 50, main = My Distribution,xlab = My Values)

Re: [R] Save File after order

2012-03-19 Thread MSousa
Thanks -- View this message in context: http://r.789695.n4.nabble.com/Save-File-after-order-tp4484539p4485370.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] 'Unexpected numeric constant'

2012-03-19 Thread HJ YAN
Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns. I would like to name the first column `DATE` and

Re: [R] Issue with asin()

2012-03-19 Thread Letnichev
Hello, you're totally right, I tried first to control the flow with if (MaxDailyTemp k MinDailyTemp k){statement} but it was a bit messy. Then ifelse() was supposed to help me out, but it didn't. Thank you for your time, your code works exactly as I want :) P. -- View this message in

Re: [R] Issue with asin()

2012-03-19 Thread Letnichev
Yes, with the same input I had two different outputs with Excel and R. When printing a debug report of Excel, it showed no anomalies and I am certain it didn't calculate odd values (such as NaNs). The way I coded was wrong, as Sarah said, I didn't follow completely the algorithm. The solution she

Re: [R] Output formatting in Latex and R

2012-03-19 Thread priyank
Use the eol=\n\n option. The records should have a 2 line space. -- View this message in context: http://r.789695.n4.nabble.com/Output-formatting-in-Latex-and-R-tp4483631p4485457.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread statfan
Thanks for your advice. I actually meant to ask about the pmvt for the distribution function. Viewing the source code pmvt uses the function mvt which uses the function probval which sources the fortran code: Fortran(mvtdst, N = as.integer(n), NU = as.integer(df), LOWER =

[R] Coverage Probability

2012-03-19 Thread hubinho
Hello. I'm allready this far. I have a function which is calculating the lower (l) and upper (u) limit for a confidence interval for the odds ratio. For example for 5 simulated 2x2 tables the upper and lower limits are: u [1] 2.496141 7.436524 8.209161 4.313587 3.318612 l [1] -0.9718608

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, You are almost there. Try this slightly modification of your function: # theta, u and l are vectors of the same length foo - function(theta, u, l) mean(theta = l theta = u, na.rm = TRUE) foo(theta, u, l) HTH, Jorge.- On Mon, Mar 19, 2012 at 12:55 PM, hubinho wrote: Hello.

[R] car/MANOVA question

2012-03-19 Thread Ranjan Maitra
Dear colleagues, I had a question wrt the car package. How do I evaluate whether a simpler multivariate regression model is adequate? For instance, I do the following: ami - read.table(file = http://www.public.iastate.edu/~maitra/stat501/datasets/amitriptyline.dat;, col.names=c(TCAD, drug,

Re: [R] 'Unexpected numeric constant'

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 17:39, HJ YAN wrote: Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns.

Re: [R] hypergeometric function in ‘ mvtnorm’

2012-03-19 Thread Berend Hasselman
On 19-03-2012, at 16:54, statfan wrote: Thanks for your advice. I actually meant to ask about the pmvt for the distribution function. Viewing the source code pmvt uses the function mvt which uses the function probval which sources the fortran code: No it doesn't source. It call a

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-19 Thread pie'
hey, thnks a lot. I got exactly what I wanted. -- View this message in context: http://r.789695.n4.nabble.com/Rolling-regressions-with-sample-extended-one-period-at-a-time-tp4470316p4485815.html Sent from the R help mailing list archive at Nabble.com.

[R] Linear regression

2012-03-19 Thread Diviya Smith
Hello there, I am new to using regression in R. I wanted to solve a simple regression problem where I have 2 equations and 2 unknowns. So lets say - y1 = alpha1*A + beta1*B y2 = alpha2*A + beta2*B y1 - runif(10, 0,1) y2 - runif(10,0,1) alpha1 - 0.6 alpha2 - 0.75 beta1 - 1-alpha1 beta2

Re: [R] 'Unexpected numeric constant'

2012-03-19 Thread Peter Ehlers
On 2012-03-19 09:39, HJ YAN wrote: Dear R-help, I am trying to rename the variables in a dataframe, called 'T1A' here. Seems renaming was successful, but when I call one of the variable I got error message and I wanted to know why. The data frame contains 365 rows and 49 columns. I would like

[R] Automaticall adjust axis scales

2012-03-19 Thread Alaios
Dear all, I have made a function that given a number of list elements plot them to the same window. The first element is plotted by using plot and all the rest are plotted under the same window by using lines. I have below a small and simple reproducible example. x1-c(1:10) plot(x1)

Re: [R] car/MANOVA question

2012-03-19 Thread John Fox
Dear Ranjan, As you no doubt noticed, the Manova() function in the car package, or the Anova() function for which Manova() is an alias, produces type II or III tests for a multivariate linear model. To compare two nested multivariate linear models, as you wish to do, you can use the standard R

[R] hgu133plus2hsentrezgprobe library

2012-03-19 Thread Eleni Christodoulou
Hello R community, I am processing raw Affymetrix CEL files and I am using the Michigan custom CDF library hgu133plus2hsentrezgprobe. I have been looking for documentation on the function that it contains...I am specifically interested in converting probe names to gene symbols. Does anybody know

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
If I understand you correctly, a univariate Gaussian distribution is uniquely determined by its first two moments so you can just fit those directly (using sample mean for population mean and sample variance with Besel's correction for population variance) and get the best Gaussian (in a ML

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread R. Michael Weylandt
I don't believe this is possible in base graphics: you need to plan your graphics ahead with something like plot(, ylim = range(x1, x2, x3)). There's a pen-and-paper approach which means once something is there, it's on the device permanently (unless you write over it). Perhaps an interactive

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I see, that could be an option, however isn't there a fitting function which would do that on given data? On 19 March 2012 19:49, R. Michael Weylandt michael.weyla...@gmail.com wrote: If I understand you correctly, a univariate Gaussian distribution is uniquely determined by its first two

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
Take a look at fitdistr in the MASS package. fitdistr(x, normal) I don't think you need to supply start values for the normal since its loglikelihood function is nicely behaved. You may need to for harder distributions. Michael On Mon, Mar 19, 2012 at 2:54 PM, Vihan Pandey

Re: [R] Linear regression

2012-03-19 Thread Bert Gunter
1. Homework assignment? We don't do homework here. 2. If not, a mixture model of some sort? I suggest you state the context of the problem more fully. R has several packages to do mixture modeling, if that's what you're trying to do. 3. In any case, this cannot be done with lm() (at least

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I'll check it out, thanks a million Micheal! On 19 March 2012 19:59, R. Michael Weylandt michael.weyla...@gmail.com wrote: Take a look at fitdistr in the MASS package. fitdistr(x, normal) I don't think you need to supply start values for the normal since its loglikelihood function is nicely

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread Jorge I Velez
Perhaps matplot()? matplot(cbind(x1, x2, x3), type = 'l') See ?matplot for more information. HTH, Jorge.- On Mon, Mar 19, 2012 at 2:40 PM, Alaios wrote: Dear all, I have made a function that given a number of list elements plot them to the same window. The first element is plotted by

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread Alaios
Thanks for the immediate answer. is ther any alternative for the matplot? There might few limitations with matplot in my case. I will post again if needed when I will be at office tomorrow. Regards Alex From: Jorge I Velez jorgeivanve...@gmail.com Cc: R

Re: [R] regression with proportion data

2012-03-19 Thread Peter Ehlers
On 2012-03-19 07:35, S Ellison wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Georgiana May Sent: 19 March 2012 14:06 To: r-help@r-project.org Subject: [R] regression with proportion data I understand that the binomial

[R] where this Error comes from?

2012-03-19 Thread Alaios
Dear all, While I am executing my code I receive the error below Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :   'x' must be atomic the weird thing that I am not calling anywhere sort function nor do I rely on anyh sorting. How I can discover where this comes from

Re: [R] where this Error comes from?

2012-03-19 Thread R. Michael Weylandt
I call upon the great and mighty Google (hallowed be its name) to discover: traceback() and its more powerful cousin options(error = recover) Michael On Mon, Mar 19, 2012 at 3:22 PM, Alaios ala...@yahoo.com wrote: Dear all, While I am executing my code I receive the error below Error in

Re: [R] where this Error comes from?

2012-03-19 Thread William Dunlap
Call traceback() after seeing the error message. E.g., factor(list(1, 2:3, 4:6)) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? traceback() 3: stop('x' must be atomic for 'sort.list'\nHave you called 'sort' on a list?) 2: sort.list(y)

Re: [R] where this Error comes from?

2012-03-19 Thread Bert Gunter
?traceback ?options ## consider changing error option to recover ?debug Search on debugging in R to find more possibilities. R is a programming language. You need to learn how to debug code if you wish to program in R. -- Bert On Mon, Mar 19, 2012 at 12:22 PM, Alaios ala...@yahoo.com wrote:

Re: [R] Automaticall adjust axis scales

2012-03-19 Thread William Dunlap
Or look at the xlim and ylim arguments to plot. E.g., x1 - 1:10 ; x2 - 11:17 ; x3 - 21:23 plot(NA, NA, xlim=range(1, length(x1), length(x2), length(x3)), ylim=range(x1, x2, x3), type=n, xlab=, ylab=) points(x1, type=b) lines(x2) points(x3) title(xlab=The X Values, ylab=The Y Values)

Re: [R] Linear regression

2012-03-19 Thread Diviya Smith
Hello Bert, This is definitely not for a homework problem. I am trying to estimate frequencies of mutations in different groups. The mutation frequencies can be modeled as a linear relation in cases of mixtures. So I have a lot of populations that follow the relationship - y = alpha*A + beta*B

Re: [R] Linear regression

2012-03-19 Thread Niloofar Javanrouh
hi I think You Can Use solve function to solve the equations.   ___  Niloofar.Javanrouh MSc Student Of BioStatistics Mashad University Of Medical Sciences   From: Bert Gunter

Re: [R] Coverage Probability

2012-03-19 Thread hubinho
Thank you very much. This was, was i needed. Unfortunately I have one futher problem with this Code. I don't only need the coverage probability for one but for a range of different odds ratios. (for example [1;30]). I tried it with a loop but I get an error. I think again, that I'm almost there

[R] [R-pkgs] acs package: analyze data from the U.S. American Community Survey

2012-03-19 Thread Ezra Haber Glenn
We are pleased to announce version 0.8 of the acs package for R, now available on CRAN (http://cran.r-project.org/web/packages/acs/index.html. The package provides a general toolkit for managing, analyzing, and presenting data from the U.S. Census American Community Survey (ACS). Confidence

Re: [R] Linear regression

2012-03-19 Thread Bert Gunter
Note that your equations can be written: y = alpha*A + (1-alpha)*B, which is equivalent to y = (A-B) * alpha + B , i.e. of form y = C*alpha + B a simple linear equation in alpha You have two different values of alpha at which y was measured, so just stack up all your results into a single

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, You need to initialize the for() loop and then store the u and l values properly: # parameters n1 - 10 n2 - 10 y - 100 alpha - 1 z-1.96 # creating B 2x2 tables B - 50 u - l - vector('numeric', B) for (i in 1:B){ theta - i x1 - exp(alpha +theta)/ (1+ exp(alpha +theta))

[R] Lag based on Date objects with non-consecutive values

2012-03-19 Thread Sam Albers
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a

Re: [R] Coverage Probability

2012-03-19 Thread hubinho
Thank you very much again. But in this case I get the coverage probability as an average over all values for the odds ratio. I need a coverage probability for every value for the odds ratio. So the coverage probability for odds ratio = 1, than for odds ratio = 2 and so on. Sorry to bother you

[R] Unexpected input in function

2012-03-19 Thread Schryver, Jack C.
Hi, Although the following statements work individually in R, they produce an error if placed inside a function as below: fsubt - function(a) { b - 1:length(a) b-a } The error message is: Error: unexpected input in: b - 1:length(a) b- Any insight would be greatly appreciated. Thanks, Jack

Re: [R] Unexpected input in function

2012-03-19 Thread Sarah Goslee
I think you'll need to provide a reproducible example, because your code works for me: fsubt - function(a) { + b - 1:length(a) + b-a + } fsubt(1:5) [1] 0 0 0 0 0 fsubt(sample(1:10)) [1] -8 -6 1 1 -1 5 3 1 4 0 fsubt(2) [1] -1 On Mon, Mar 19, 2012 at 4:01 PM, Schryver, Jack C.

Re: [R] hgu133plus2hsentrezgprobe library

2012-03-19 Thread Iain Gallagher
Hi Eleni Question like this are better served on the bioconductor mailing list. Nonetheless try this ALL - topTable(fit2, coef=1, number=Inf) ALL$SYMBOL - unlist(mget(ALL$ID, hgu133plus2hsentrezgSYMBOL, ifnotfound=NA)) Here ALL is the output from limma for differential expression (ALL$ID is

Re: [R] Unexpected input in function

2012-03-19 Thread R. Michael Weylandt
The OP's error suggests (to me) that there's a line break error somewhere so it may be a funny quirk of encoding/OS incompatibility if it's from a source()'d script. Incidentally, the OP could also write the body of his function as a one liner with: seq_along(a) - a Michael On Mon, Mar 19,

Re: [R] Coverage Probability

2012-03-19 Thread Jorge I Velez
Hi hubinho, This starts to look as homework to me so this will be my last try in helping you. The general strategy would be along the lines of (1) write a function that does what you want for a value of theta and (2) sapply() that function to the vector of theta values you would like to

Re: [R] Unexpected input in function

2012-03-19 Thread Ted Harding
I think the most likely explanation is that something in the input string has had the effect of inserting an invisible character between the - and the a in b-a, and a possible suspect is pollution by UTF8: see the discussion at

  1   2   >