[R] Odp: stack data sets

2009-01-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.01.2009 19:25:32: > Hi All, > > I'm generating 10 different data sets with 1 and 0 in a matrix form and > writing the output in separate files. Now I need to stack all these data sets > in one vector and I know that stack only operates on list or

[R] Odp: Question about collapse/aggregate and avoidance of loops

2009-01-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.01.2009 07:52:37: > Dear all, > > given the following data > > ## original data > id <- c(1,1,1,2,2,3) > author <- c("A","B","C","D","E","F") > tmp <- data.frame(id,author) > tmp > > > > tmp >id author > 1 1 A > 2 1 B > 3 1

Re: [R] Re : standard error of logit parameters

2009-01-28 Thread markleeds
I'm sure below is fine but john fox's CAR book has some nice examples of how to compute the logit parameters and variances from scratch using iteratively weighted least squares. On Thu, Jan 29, 2009 at 1:54 AM, justin bem wrote: Run outfit<-nlm(..., hessian=T) and then standards error ar

Re: [R] t.test in a loop

2009-01-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.01.2009 12:57:55: > On Wed, 28 Jan 2009, Michael Pearmain wrote: > > > Hi All, > > I've been having a little trouble with creating a loop that will run a a > > series of t.tests for inspection, > > Below is the code i've tried, and some checks i've

[R] Re : standard error of logit parameters

2009-01-28 Thread justin bem
Run outfit<-nlm(..., hessian=T) and then standards error are se<-diag(solve(outfit$hessian))   Justin BEM BP 1917 Yaoundé Tél (237) 76043774   De : Bomee Park À : r-help@r-project.org Envoyé le : Jeudi, 29 Janvier 2009, 4h01mn 56s Objet : [R] standa

[R] Question about collapse/aggregate and avoidance of loops

2009-01-28 Thread Weiss, Bernd
Dear all, given the following data ## original data id <- c(1,1,1,2,2,3) author <- c("A","B","C","D","E","F") tmp <- data.frame(id,author) tmp > tmp id author 1 1 A 2 1 B 3 1 C 4 2 D 5 2 E 6 3 F What is the best (most efficient/vectorized/avoiding loops)

Re: [R] Ignore text when reading data

2009-01-28 Thread beyar
thanks to all for the solutions. Especially to Jim H for this one which worked perfectly... (i only had to change the seperater on the header to /t as there are spaces in header names) Try this: > x <- readLines(textConnection("main data file - file 1 + by mr x + etc + + + T

Re: [R] Ignore text when reading data

2009-01-28 Thread jim holtman
Try this: > x <- readLines(textConnection("main data file - file 1 + by mr x + etc + + + Timeout1 + Sec mm + 0.82495117 -0.020977303 + 1.3554688 -0.059330709 + 1.826416-0.021419302 + 2.3295898 -0.051521059 + 2.8347168 -0.020661414 + + + Timeout1 + Sec

Re: [R] Ignore text when reading data

2009-01-28 Thread Remko Duursma
Sorry, forgot this line after the textConnection bit: r <- readLines(myfile) - Remko Duursma Post-Doctoral Fellow Centre for Plant and Food Science University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macqua

Re: [R] Ignore text when reading data

2009-01-28 Thread Remko Duursma
# replace this bit, replace it with your file name myfile <- textConnection( "Timeout1 Sec mm 0.82495117 -0.020977303 1.3554688 -0.059330709 1.826416-0.021419302 2.3295898 -0.051521059 2.8347168 -0.020661414 Timeout1 Sec mm 3.8679199 -0.0004396

[R] Ignore text when reading data

2009-01-28 Thread beyar
Hi, I have tab delimited text files containing numerical data, like below, but many more columns. As you can see, the first few lines are heading and file data. I need to skip these lines. 2 lines above where the numbers start is what I want to use as my header rows. I then want to ignore the

[R] standard error of logit parameters

2009-01-28 Thread Bomee Park
Hi everyone. I am now estimating the parameters for a logit model, and trying to get the estimates by laximizing the log_likelihood. The nlm function works nicely for maximizing the -(log_likelihood) and returns the parameter estimates that minimize the static, and the gradients also, but d

Re: [R] using Sweave with a master file that has several iputted .tex files

2009-01-28 Thread cameron.bracken
Mark Wardle wrote: > > Using make means a "build" for a single chapter is cached unless the > source file > changes and so one can see the results of changes to one source file > almost immediately. > The pgfSweave package is specifically designed for speeding up the compilation time in large

Re: [R] Faced Problems with RODBC package 1.2-5 and 1.2-4 for windows

2009-01-28 Thread Mark Wardle
You need to include much more information. Try creating a reproducible example - you may find the answer in the process of doing this. You may find the posting guide for the mailing list to be helpful - you've had no replies because you haven't explained your problem well enough. Mark 2009/1/28

Re: [R] glm binomial loglog (NOT cloglog) link

2009-01-28 Thread Jorge Ivan Velez
Dear Bill, Perhaps the "cloglog" function in the "VGAM" package might be useful for you. HTH, Jorge On Fri, Jan 23, 2009 at 11:32 AM, William Simpson < william.a.simp...@gmail.com> wrote: > I would like to do an R glm() with > family = binomial(link="loglog") > > Right now, the cloglog link ex

Re: [R] questions about histogram

2009-01-28 Thread Jorge Ivan Velez
Dear Wenxia, Take a look at this post: http://www.nabble.com/Histogram-for-grouped-data-in-R-to21624806.html#a21624806 HTH, Jorge On Wed, Jan 28, 2009 at 4:50 AM, Wenxia Li wrote: > Hi all, > > I'm a new R user. I have the following information about a data set and how > to make a histogram

Re: [R] questions about histogram

2009-01-28 Thread Wenxia Li
it's a frequency histogram. The total area of the bars is 1, and the area of each bar represents its frequency, i.e. 25/50,10/50,10/50,5/50, respectively. And the width of the bars are different. On Jan 28, 2009, at 5:50 PM, Wenxia Li wrote: Hi all, I'm a new R user. I have the following

Re: [R] questions about histogram

2009-01-28 Thread jim holtman
Try this: > x <- read.table(textConnection("0-2 25 + 2-10 10 + 10-100 10 + 100-1000 5")) > > x V1 V2 1 0-2 25 2 2-10 10 3 10-100 10 4 100-1000 5 > ?barplot > x <- read.table(textConnection("0-2 25 + 2

Re: [R] [SPAM] - Re: for/if loop - Bayesian Filter detected spam

2009-01-28 Thread Henrik Bengtsson
On Wed, Jan 28, 2009 at 2:41 PM, wrote: > Well, maybe you are just bad at typing then ;-) > > The lines rr==ii, pp==pp+1, etc. are not setting rr and pp but comparing > them. > Probably you want rr <- ii and pp <- pp+1, etc. > And the last line of your loop 'ii=ii+1' means that, > since the for s

[R] questions about histogram

2009-01-28 Thread Wenxia Li
Hi all, I'm a new R user. I have the following information about a data set and how to make a histogram? data number of observations 0-2 25 2-10 10 10-100 10 100-1000 5 I tried barplot(height=...,width=...,...), the output

Re: [R] [SPAM] - Re: for/if loop - Bayesian Filter detected spam

2009-01-28 Thread davidr
Well, maybe you are just bad at typing then ;-) The lines rr==ii, pp==pp+1, etc. are not setting rr and pp but comparing them. Probably you want rr <- ii and pp <- pp+1, etc. And the last line of your loop 'ii=ii+1' means that, since the for statement is already incrementing ii, you are incrementi

[R] Dynamic random effects model

2009-01-28 Thread Joseph Magagnoli
All R experts, How do I fit a dynamic Random effects model with a binary dependent variable in R Thanks JCM [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Changing histogram stack in qplot

2009-01-28 Thread Jason Rupert
Worked beautifully!  Thank you again for providing such a flexible package.  --- On Wed, 1/28/09, hadley wickham wrote: From: hadley wickham Subject: Re: [R] Changing histogram stack in qplot To: jasonkrup...@yahoo.com Cc: R-help@r-project.org Date: Wednesday, January 28, 2009, 3:32 PM Hi Ja

Re: [R] Using R in a web application

2009-01-28 Thread Gad Abraham
Will Glass-Husain wrote: Hi, I want to use R to do user-submitted jobs in a (java-based) webapp. Specifically, I want * users to upload R scripts * run the R job on user data * save the results to database I'm concerned about sandbox issues. * Is it possible to disable file read/write capabilit

Re: [R] Newbie Question About Histograms

2009-01-28 Thread Eik Vettorazzi
How about > dta<-read.table("clipboard",header=T) > means<-aggregate(dta$Length,by=list(YearC=dta$YearC),FUN=mean) > barplot(means[,2],names.arg=means[,1]) you may have a look at ?barplot to see (lots of) options for fine tuning the plot. hth. pfc_ivan schrieb: Also I forgot to say that The

Re: [R] for/if loop

2009-01-28 Thread SnowManPaddington
Hi ya, I've revised the code (and finally know what I m doing.. :-D) The good news is.. I dont get any error message, but the bad news is the following optim generate no results. I still think there is something to do with my loop... can anyone advice? Thanks again!!! pp=1 rr=1 for (ii in 1:n

Re: [R] Newbie Question About Histograms

2009-01-28 Thread pfc_ivan
Also I forgot to say that The Y-axis values for each YearC would be the mean value of all the Lenghts that happen in that YearC. Basically I cant figure out how to put the mean values of Lengths for each YearC on Y axis. Thanks in advance! -- View this message in context: http://www.nabble.co

Re: [R] rproxy.dll

2009-01-28 Thread Clément D
Duncan Murdoch-2 wrote: > > On 25/10/2008 1:01 PM, Murray Eisenberg wrote: >> Is rproxy.dll supposed to be installed as part of a Windows binary >> installation of R? And the installer put it in R's bin subdirectory? >> >> If so, it seems to be missing from the R-2.8.0 patched, 2008-10-25 >

Re: [R] Memory issue?

2009-01-28 Thread Ubuntu Diego
I had similar issues with memory occupancy. You should explicitly call gc() to call the garbage collector (free memory routine) after you do rm() of the big objects. D. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] Changing histogram stack in qplot

2009-01-28 Thread hadley wickham
Hi Jason, You'll need scale_fill_manual(values = c(low = "blue", middle = "black", high = "red")) See http://had.co.nz/ggplot2/scale_manual.html for more examples/details. Regards, Hadley On Wed, Jan 28, 2009 at 3:11 PM, Jason Rupert wrote: > I've been using qplot pretty successfully to gener

Re: [R] Help with normal distribution in random samples...

2009-01-28 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Sea Captain 1779 > Sent: Wednesday, January 28, 2009 12:04 PM > To: r-help@r-project.org > Subject: [R] Help with normal distribution in random samples... > > > Hi!!! > > First

Re: [R] Text data

2009-01-28 Thread Nutter, Benjamin
Jim's solution is more elegant than the following (and probably more efficient) but you could also try the following (This let's you sort by AN/HN, and then by the number at the start of the filename): > text <- c( "26M_AN_C.bmp", "22M_AN_C.bmp", "20M_HA_O.bmp", "20M_AN_C.bmp", "26M_H

Re: [R] Help with normal distribution in random samples...

2009-01-28 Thread Mike Lawrence
?rnorm On Wed, Jan 28, 2009 at 4:04 PM, Sea Captain 1779 wrote: > > Hi!!! > > First time 'R' user looking for a little assistance. Here is what I have so > far: > > practice1 = matrix ((runif(5000, min =0, max = 12)), 100) > > which is creating 50 samples, for 100 cases, distributed between 0-12

Re: [R] Text data

2009-01-28 Thread jim holtman
This will sort on those characters: > x <- readLines(textConnection("26M_AN_C.bmp + 22M_AN_C.bmp + 20M_HA_O.bmp + 20M_AN_C.bmp + 26M_HA_O.bmp + 22M_HA_O.bmp + 31M_AN_C.bmp + 38M_HA_O.bmp")) > closeAllConnections() > # pick off characters between "_" > sortKey <- sub(".*_(.+)_.*", "\\1", x) > sortK

[R] Changing histogram stack in qplot

2009-01-28 Thread Jason Rupert
I've been using qplot pretty successfully to generate stacked histograms.  However, it appears that I need to tweak the colors a little.    I've got three temperature variables (characters not numeric) and I need to change from the default qplot colors to the following: Low = Blue Middle = black

[R] Text data

2009-01-28 Thread Alice Lin
i have a data column of text entries: 26M_AN_C.bmp 22M_AN_C.bmp 20M_HA_O.bmp 20M_AN_C.bmp 26M_HA_O.bmp 22M_HA_O.bmp 31M_AN_C.bmp 38M_HA_O.bmp . . . . And I would like to sort by the middle tag: AN, HA, etc. Is there a way to parse text data in R? In excel, I would have used the "left" and "rig

Re: [R] Newbie Question About Histograms

2009-01-28 Thread Peter Alspach
Kia ora Ivan I think you might want a barplot. ?hist under 'See Also:' states: Typical plots with vertical bars are _not_ histograms. Consider 'barplot' or 'plot(*, type = "h")' for such bar plots. [The online help in R is good.] HTH Peter Alspach > -Original Message---

[R] Help with normal distribution in random samples...

2009-01-28 Thread Sea Captain 1779
Hi!!! First time 'R' user looking for a little assistance. Here is what I have so far: practice1 = matrix ((runif(5000, min =0, max = 12)), 100) which is creating 50 samples, for 100 cases, distributed between 0-12. What I would like is to be able to set the mean and SD so that the data is no

[R] Newbie Question About Histograms

2009-01-28 Thread pfc_ivan
Hello everyone. Just have a question , cant figure out how to make this histogram. I have this table, that i stored in a variable name new.data2. Table looks like this Year GeoArea SmpNo Month Gear Maturity Length Age YearC 1989 1 36210 221225 1 1988 1991 1

Re: [R] R compilation

2009-01-28 Thread stephen sefick
yes, first don't crosspost. It all depends on what OS .. blah, blah, blah. You must read the posting guide because it will up your chances of a reply. On Wed, Jan 28, 2009 at 1:37 PM, Attiglah, Mama wrote: > > Hi Mates, > I have a very long R code that needs to go to production but my portfolio

[R] Cor(df,method = "kendall")

2009-01-28 Thread glenn
Hi All, Does anyone know of any issues at all with using; Cor(df,method = ³kendall²) On a dataframe (df) 13 columns wide say? Seems to hang my system for a while in calculating the correlation matrix ­ appreciate it is doing some ranking calculations so I am expecting too much that it should re

Re: [R] Get median of each column

2009-01-28 Thread Stephan Kolassa
Thank you, Rolf, for this well-deserved spanking :-) I promise to amend my ways and think before I send in the future. Best, Stephan Rolf Turner schrieb: On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote: Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should

Re: [R] Power analysis for MANOVA?

2009-01-28 Thread Stephan Kolassa
Hi Adam, first: I really don't know much about MANOVA, so I sadly can't help you without learning about it an Pillai's V... which I would be glad to do, but I really don't have the time right now. Sorry! Second: you seem to be doing a kind of "post-hoc power analysis", "my result isn't signi

Re: [R] Get median of each column

2009-01-28 Thread Rolf Turner
On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote: Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should work. Look at ?apply Note that apply() works with ***matrices***. The foregoing code will work, given that all columns of ``dataset'' are numeric, due to

Re: [R] Repeated measures design for GAM? - corrected question...

2009-01-28 Thread Strubbe Diederik
Dear Simon, Many thanks for pointing me to the GAMM! For clarification, Bird_abundance are breeding densities ( e.g. 1.25 BP/ha, 2.20 BP/ha,...) and count is just the actual survey(e.g. first_survey,...). The dataset looks like Bird_abundance Study_area YEARCOUNT X1 X2 X3

Re: [R] Get median of each column

2009-01-28 Thread Stephan Kolassa
Assuming your data are in a data.frame called dataset, apply(dataset,2,median) should work. Look at ?apply HTH, Stephan Frank Zhang schrieb: I am new to R. How can I get column median? Thanks.Frank [[alternative HTML version deleted]]

Re: [R] Saving plot into file without showing it

2009-01-28 Thread jim holtman
pdf("yourFile.pdf") plot(1) plot(2) plot(3) . dev.off() On Wed, Jan 28, 2009 at 12:26 PM, julien cuisinier wrote: > > Hi List, > > > My apologies in advance if question is simplistic, I am quite new to R > graphics capabilities and I could not find anything in past threads... > > I use R 2.8

Re: [R] Saving plot into file without showing it

2009-01-28 Thread Stephan Kolassa
Try pdf("foo.pdf") plot(x) dev.off() Other possibilities are jpeg(), tiff(), postscript() etc. HTH, Stephan julien cuisinier schrieb: Hi List, My apologies in advance if question is simplistic, I am quite new to R graphics capabilities and I could not find anything in past threads...

Re: [R] Get median of each column

2009-01-28 Thread jim holtman
?apply > x <- matrix(1:25,5) > x [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 > apply(x, 2, median) [1] 3 8 13 18 23 > On Wed, Jan 28, 2009 at 11:48 AM, Frank

[R] R compilation

2009-01-28 Thread Attiglah, Mama
Hi Mates, I have a very long R code that needs to go to production but my portfolio managers do not use R language and the software is not supported by my bank. Is there any way I can compile the code to an executable file and make it usable to my portfolio managers who have no knowledge at al

[R] Get median of each column

2009-01-28 Thread Frank Zhang
I am new to R. How can I get column median? Thanks.Frank [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/pos

[R] Saving plot into file without showing it

2009-01-28 Thread julien cuisinier
Hi List, My apologies in advance if question is simplistic, I am quite new to R graphics capabilities and I could not find anything in past threads... I use R 2.8.1 under Mac OS X, but I would preferrably have a cross platform answer as I use also R under Windows I produce plots using R

Re: [R] constrainOptim

2009-01-28 Thread Ben Bolker
June Wong hotmail.com> writes: > > > Dear R helpers > > I have a question regarding the constrainOptim. > I'm coding the nested logit and would like to set a bound of rho to (0,1] as an extreme value distribution > where rho = exp(lambda)/1+exp(lambda) > I wonder if I can do that directly in

[R] stack data sets

2009-01-28 Thread Nidhi Kohli
Hi All, I'm generating 10 different data sets with 1 and 0 in a matrix form and writing the output in separate files. Now I need to stack all these data sets in one vector and I know that stack only operates on list or data frame however I got these data sets by converting list to a matrix so c

Re: [R] help with plot layout

2009-01-28 Thread Greg Snow
We don't have your data, so we cannot reproduce what you are doing and the plot was stripped off before we saw it (only certain types of attachments are allowed, and some e-mail programs don't give the correct information about attachments so even those types can be stripped if it is not clear w

[R] [R-pkgs] AdMit version 1-01.01

2009-01-28 Thread ARDIA David
Dear all, The new version of AdMit (version 1.01-01) is now available from CRAN. SUMMARY The package provides functions to perform the fitting of an adaptive mixture of Student-t distributions to a target density through its kernel function. The mixture approximation can then be used as the impo

[R] gls prediction using the correlation structure in nlme

2009-01-28 Thread Dr Carbon
How does one coerce predict.gls to incorporate the fitted correlation structure from the gls object into predictions? In the example below the AR(1) process with phi=0.545 is not used with predict.gls. Is there another function that does this? I'm going to want to fit a few dozen models varying in

Re: [R] Repeated measures design for GAM? - corrected question...

2009-01-28 Thread Simon Wood
`gamm' in package `mgcv' will let you specify random effects as part of a generalized additive mixed model, but I must admit that I'm a bit confused about what `Bird_abundance' is here, and how it differs from `Count'. best, Simon On Wednesday 28 January 2009 17:09, Strubbe Diederik wrote: > De

Re: [R] StepAIC with coxph

2009-01-28 Thread Ravi Varadhan
Michele, This error means that some of the variables in your formula have missing values, and hence when these terms or added/dropped you have a different sample size. Hence, the AIC cannot be compared between different models. The solution is to create a compelete-data dataframe for the larg

[R] Sweave problem with greek text

2009-01-28 Thread constantine
Dear Sweave and R aficionados, I am using R and Latex for many years, writing texts in greek. I tried to combine them with Sweave, but without any success. Could you provide me with any help? Usually my LaTeX files are like this iso-8859-7 encoded .tex file: http://costis.name/0various/lists/R/

[R] Repeated measures design for GAM? - corrected question...

2009-01-28 Thread Strubbe Diederik
Dear all, I have a question on the use of GAM with repeated measures. My dataset is as follows: - a number of study areas where bird abundance has been determined. Counts have been performed in 3 consecutive years and there were 2 counts per year (i.e. in total 6 counts). - a number of environm

[R] repeated measures design for GAM?

2009-01-28 Thread Strubbe Diederik
Dear all, I have a question on the use of GAM with repeated measures. My dataset is as follows: - a number of study areas where bird abundance has been determined. Counts have been performed in 3 consecutive years and there were 2 counts per year (i.e. in total 6 counts). - a number of environm

Re: [R] constrainOptim

2009-01-28 Thread Ravi Varadhan
For simple box constraints, i.e. lower and upper limits directly on the parameters themselves, you don't need ConstrOptim. You can get the job done with the "L-BFGS-B" algorithm in optim() or using nlminb() or using the spg() function in the BB package. In this case the feasible region is a h

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Wed, 28 Jan 2009 11:25:55 -0500 TB> That the two behave the same doesn't change the assessment TB> that the design TB> is flawed. That doesn't mean that the function is wrong. TB> It means only TB> that the behaviour can be made more useful. For exa

[R] constrainOptim

2009-01-28 Thread June Wong
Dear R helpers I have a question regarding the constrainOptim. I'm coding the nested logit and would like to set a bound of rho to (0,1] as an extreme value distribution where rho = exp(lambda)/1+exp(lambda) I wonder if I can do that directly in optim (say rho > 0 & <= 1) or need to use const

Re: [R] Logical subset of the columns in a dataframe

2009-01-28 Thread David Winsemius
One approach to such a problem would be to use a logical vector inside the function colSums. ?colSums > DF <- data.frame(XX= runif(20), YY=runif(20)) > colSums(DF > 0.5) XX YY 11 9 > colSums(DF > -Inf) XX YY 20 20 > > colSums(DF> 0.5)/colSums(DF > -Inf) #could have used DF >= min(DF) in t

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Ted Byers
Hi Yohan, On Wed, Jan 28, 2009 at 10:28 AM, Yohan Chalabi wrote: > "TB" == Ted Byers > on Wed, 28 Jan 2009 09:30:58 -0500 > > TB> It is certain that all entries have the same format, but I'm > TB> starting to > TB> think that the error message is something of a red herring. > T

Re: [R] Logical subset of the columns in a dataframe

2009-01-28 Thread Prof Brian Ripley
On Wed, 28 Jan 2009, Mark Na wrote: Hi R-helpers, I've been struggling with a problem for most of the day (!) so am finally resorting to R-help. I would like to subset the columns of my dataframe based on the frequency with which the columns contain non-zero values. For example, let's say that

Re: [R] Newbie question about "grouping"

2009-01-28 Thread hadley wickham
On Wed, Jan 28, 2009 at 8:13 AM, Rixon, John C. wrote: > Hi folks: > > I am a SQL guy who just downloaded and installed R yesterday. I am > trying to evaluate some "complex" aggregations we are currently > performing with Syncsort (and have tried in Oracle) with R. I have > loaded data in a data

Re: [R] Newbie question about "grouping"

2009-01-28 Thread Thomas Lumley
Some useful commands are: by(), aggregate(), ave(), split(). eg by(market_value, account_id, sum) -thomas On Wed, 28 Jan 2009, Rixon, John C. wrote: Hi folks: I am a SQL guy who just downloaded and installed R yesterday. I am trying to evaluate some "complex" aggregations we are

Re: [R] Newbie question about "grouping"

2009-01-28 Thread David Winsemius
?by ?aggregate ?ave Further specifics might be forthcoming if self-contained example data and desired output were offered. The help pages will have worked examples, of course. -- David Winsemius On Jan 28, 2009, at 9:13 AM, Rixon, John C. wrote: Hi folks: I am a SQL guy who just downl

Re: [R] Grouping problem

2009-01-28 Thread hadley wickham
You might want to have a look at the plyr package, http://had.co.nz/plyr, which includes tools for performing this sort of grouping. Hadley On Wed, Jan 28, 2009 at 9:47 AM, venkata kirankumar wrote: > Hi all, > I have a problem with grouping like I have to give count of employes in each > depart

Re: [R] Grouping problem

2009-01-28 Thread David Winsemius
A vague answer is the best you should hope for with such a vague question with no sample data: ?table ?xtabs ?"==" A search on "Frequency tables from factors" should get you to the intro to R section with that name. -- David Winsemius On Jan 28, 2009, at 10:47 AM, venkata kirankumar wrote

[R] Logical subset of the columns in a dataframe

2009-01-28 Thread Mark Na
Hi R-helpers, I've been struggling with a problem for most of the day (!) so am finally resorting to R-help. I would like to subset the columns of my dataframe based on the frequency with which the columns contain non-zero values. For example, let's say that I want to retain only those columns wh

[R] Newbie question about "grouping"

2009-01-28 Thread Rixon, John C.
Hi folks: I am a SQL guy who just downloaded and installed R yesterday. I am trying to evaluate some "complex" aggregations we are currently performing with Syncsort (and have tried in Oracle) with R. I have loaded data in a dataframe and have performed some of the simple aggregations on a subs

[R] help with plot layout

2009-01-28 Thread mauede
It takes a lot of sweat to generate a composite plot with R ... sigh. I though I was almost done when I met the umpteenth hurdle. I cannot place a nice title on the 2nd plot (raw signal) on the layout. I do not have control on where either the "main" option of "plot" function, or "title", place

[R] Grouping problem

2009-01-28 Thread venkata kirankumar
Hi all, I have a problem with grouping like I have to give count of employes in each department like if in one company there is departments like Mechanical, Computer, Fitting, electronics and Chemical hear I have to retreave the number of employes in each department and as well as I have to retre

Re: [R] putting match.call to good use

2009-01-28 Thread Prof Brian Ripley
On Wed, 28 Jan 2009, Dieter Menne wrote: Prof Brian Ripley stats.ox.ac.uk> writes: The way to do this is eval(substitute()). E.g. from the new Rd2HTML What is Rd2HTML? A function in the R-devel version of R (is 'new' not rather a hint?). From the NEWS file: o parse_Rd(), an exp

Re: [R] OT: Adding verbatim R code text into LaTeX documents: texttt; verb or url?

2009-01-28 Thread JLucke
LaTeX offers a verbatim environment. \begin{verbatim} This is maintained verbatim, Latex commands and environments are typeset as written without any processing. \end{verbatim} Be sure to use the package verbatim. ---Joe "Peter Dunn" Sent by: r-help-boun...@r-project.org 01/28/2009 01:41

Re: [R] plot slideshow

2009-01-28 Thread David Winsemius
If you investigate how the call: demo(graphics) ... works, you find that the first interactive event is handled by the code at the end of the demo function, Just type: demo The rest of the interactive events are handled by this single line at the beginning of the graphics.R code that crea

Re: [R] putting match.call to good use

2009-01-28 Thread Peter Dalgaard
Prof Brian Ripley wrote: > On Wed, 28 Jan 2009, Harald Eikrem wrote: > >> ( I just became aware the mailer enforces html bodies, as such removed >> by the list handler. Sorry about that. My message was ) >> >> I have this function >> >> slm <- function(fun=lm, ...) { >> #ilm <- eval(match.call(

Re: [R] putting match.call to good use

2009-01-28 Thread Dieter Menne
Prof Brian Ripley stats.ox.ac.uk> writes: > The way to do this is eval(substitute()). E.g. from the new Rd2HTML > What is Rd2HTML? Dieter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Yohan Chalabi
"TB" == Ted Byers on Wed, 28 Jan 2009 09:30:58 -0500 TB> It is certain that all entries have the same format, but I'm TB> starting to TB> think that the error message is something of a red herring. TB> Consider this: TB> TB> > year = 2009 TB> > week = 0 TB> > day

Re: [R] plot slideshow

2009-01-28 Thread stephen sefick
I know you probably want to do this in R, but you could do this in power point or the openoffice variant rather easily. Stephen On Wed, Jan 28, 2009 at 9:44 AM, diego Diego wrote: > Dear R experts: > I've seen that it's possible to make a sort of "slideshow" with several > R-plots (each slide i

Re: [R] Merge two vectors into one.

2009-01-28 Thread Gábor Csárdi
Is position important? The vectors always have the same length? They always have the same entry if both are not NA? If yes, yes and yes, then res <- ifelse( is.na(x), y, x) does what you want. Otherwise please explain better what you want. Gabor On Wed, Jan 28, 2009 at 3:54 PM, patricia garcía

Re: [R] Merge two vectors into one.

2009-01-28 Thread patricia garcía gonzález
Hi, Sorry, the answers are yes yes yes. And thank you for your idea it works perfectly. Regards Patricia > Date: Wed, 28 Jan 2009 16:01:11 +0100 > Subject: Re: [R] Merge two vectors into one. > From: csa...@rmki.kfki.hu > To: kurtney...@hotmail.com > CC: r-help@r-project.org > > Is p

Re: [R] Merge two vectors into one.

2009-01-28 Thread Dimitris Rizopoulos
you could start by something like the following: x <- c("Y", "H", NA, NA) y <- c(NA, "H", NA, "B") ifelse(is.na(x), y, x) I hope it helps. Best, Dimitris patricia garcía gonzález wrote: Hi all, I have two vectors like this: x <- c( "Y", "H", NA, NA ) y <- c( NA, "H", NA,

Re: [R] putting match.call to good use

2009-01-28 Thread Prof Brian Ripley
On Wed, 28 Jan 2009, Harald Eikrem wrote: ( I just became aware the mailer enforces html bodies, as such removed by the list handler. Sorry about that. My message was ) I have this function slm <- function(fun=lm, ...) { #ilm <- eval(match.call()[-1]); # no way ilm <- eval(parse(text=sub

[R] Merge two vectors into one.

2009-01-28 Thread patricia garcía gonzález
Hi all, I have two vectors like this: x <- c( "Y", "H", NA, NA ) y <- c( NA, "H", NA, "B" ) And would like to make one vector with the common elements, and the element available only in one of the vectors. res <- c( "Y", "H", NA, "B" ) Thanks, Patricia > From:

[R] StepAIC with coxph

2009-01-28 Thread Michele Santacatterina
Hi, i'm trying to apply StepAIC with coxph...but i have the same error: stepAIC(fitBMT) Start: AIC=327.77 Surv(TEMPO,morto==1) ˜ VOD + SESSO + ETA + Error in dropterm.default(fit,scope$drop, scale=scale,trace=max(0, : number of rows in use has changed: remove missing values? anybody

Re: [R] Re : Need help on running Heckman Correction Estimation using R

2009-01-28 Thread Arne Henningsen
Hi Kishore and Justin, The sample selection stuff has been separated from the micEcon package about one year ago. It is available in the sampleSelection package [1,2,3] now. The sample selection package is thoroughly described in a (freely available) paper published in the Journal of Statistica

[R] plot slideshow

2009-01-28 Thread diego Diego
Dear R experts: I've seen that it's possible to make a sort of "slideshow" with several R-plots (each slide is activated by a click on the mouse). How can I put this on a R-script??? Regards. D. [[alternative HTML version deleted]] __ R-help

Re: [R] initial value in 'vmmin' is not finite

2009-01-28 Thread Prof Brian Ripley
On Wed, 28 Jan 2009, June Wong wrote: Dear r helpers I run the following code for nested logit and got a message that Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite What does this mean? and how can I correct it?

Re: [R] Mystery Error in midnightStandard

2009-01-28 Thread Ted Byers
Hi Yohan, Thanks. On Wed, Jan 28, 2009 at 4:57 AM, Yohan Chalabi wrote: > "TB" == Ted Byers > on Tue, 27 Jan 2009 16:00:27 -0500 > > TB> I wasn't even aware I was using midnightStandard. You won't > TB> find it in my > TB> script. > TB> > TB> Here is the relevant loop: >

[R] putting match.call to good use

2009-01-28 Thread Harald Eikrem
( I just became aware the mailer enforces html bodies, as such removed by the list handler. Sorry about that. My message was ) I have this function slm <- function(fun=lm, ...) { #ilm <- eval(match.call()[-1]); # no way ilm <- eval(parse(text=sub("^list", deparse(substitute(fun)), depar

[R] initial value in 'vmmin' is not finite

2009-01-28 Thread June Wong
Dear r helpers I run the following code for nested logit and got a message that Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite What does this mean? and how can I correct it? Thank you June > yogurt = read.table

[R] Character SNP data to binary MAF data

2009-01-28 Thread Hadassa Brunschwig
Hi I am sure there is a function out there already but I couldn't find it. I have SNP data, that is, a matrix which contains in each row two characters (they are different in each row) and I would like to convert this matrix to a binary one according to the minor allele frequency. For non-genetici

Re: [R] evaluation revisited

2009-01-28 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > On Wed, Jan 28, 2009 at 6:26 AM, Wacek Kusnierczyk > wrote: > >> Gabor Grothendieck wrote: >> >>> The argument to eval.parent is evaluated before eval.parent >>> ever sees it. >>> >> really? eval.parent is just a regular r function, a wrapper for eval >>

Re: [R] evaluation revisited

2009-01-28 Thread Gabor Grothendieck
On Wed, Jan 28, 2009 at 6:26 AM, Wacek Kusnierczyk wrote: > Gabor Grothendieck wrote: >> The argument to eval.parent is evaluated before eval.parent >> ever sees it. > > really? eval.parent is just a regular r function, a wrapper for eval > with envir=parent.frame(). the arguments to eval.parent

Re: [R] for/if loop

2009-01-28 Thread jim holtman
Within the loops you are changing the loop variables (pp & rr). Why are you doing this? THis might be causing your problem of what sounds like an infinite loop. You probably want to rethink what you are trying to do in the loop. On Wed, Jan 28, 2009 at 3:21 AM, SnowManPaddington wrote: > > Hi,

  1   2   >