Re: [R] contourplot label color

2009-04-06 Thread bruno joly
Deepayan Sarkar wrote: > On Mon, Apr 6, 2009 at 9:00 AM, bruno joly wrote: > >> Hi everyone, >> >> I am new to the list. >> My problem is to change the color of the label in a contour plot. The plot >> is quite dark and I'd like to have the line and label white, it works for >> the line with a

[R] Maple and R

2009-04-06 Thread Roslina Zakaria
Hi R-users, Can Maple function be exported to R? I have a jacobian matrix (4X4) from maple in algebraic form which involve modified Bessel function of the first kind. I just wonder whether we can use algebraic form into R before the value of the parameters can be estimated. Thank you so much

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Ken-JP
Rolf, In general, I agree with you, but I am coding for a special case. 1. I am the only user and probably will be for the foreseeable future. 2. I like to have different tiers of visibility. At the public/highest level, I only want to see the functionality that I use often - my memory can only

[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)

2009-04-06 Thread Ken-JP
Hi, I need some help with 2.9.0 parse_Rd() Version 2 changes. I read the .pdf file and some posts on r-help, but after playing with this for several hours, I can't seem to get around this UTF-8 problem. - I'm trying to get rid of some warnings during R CMD Check for R 2.9.0Alpha on Japanese Vis

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Martin Morgan
Rolf Turner writes: > On 7/04/2009, at 3:34 PM, Ken-JP wrote: > > > >> Using NAMESPACE, I was able to hide my globals behind a "." (eg >> .myGlobal >> <<- 72) and use exportPattern("^[^\\.]*") to prevent users from >> seeing my >> globals, yet I was able to access their values inside my p

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Rolf Turner
On 7/04/2009, at 3:34 PM, Ken-JP wrote: Using NAMESPACE, I was able to hide my globals behind a "." (eg .myGlobal <<- 72) and use exportPattern("^[^\\.]*") to prevent users from seeing my globals, yet I was able to access their values inside my package. WHY do

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread David Winsemius
On Apr 6, 2009, at 6:31 PM, Jun Shen wrote: This is a good example to compare different approaches. My understanding is aggregate() can apply one function to multiple columns summarize() can apply multiple functions to one column I am not sure if ddply() can actually apply multiple functions

[R] Concern with randomForest

2009-04-06 Thread Ryan Harrigan
Hi all, When running a randomForest run using the following command: forestplas=randomForest(Prev~.,data=plas,ntree=20) print(forestplas) I get the following result: Call: randomForest(formula = Prev ~ ., data = plas, ntree = 2e+05, importance = TRUE) Type of random fore

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Ken-JP
Thanks to pointers from Uwe, I first tried zzz.R and .First.lib(), which does what I needed (initialize once). Then under Martin's suggestion, I converted the package to use NAMESPACE and .onLoad(). Using NAMESPACE, I was able to hide my globals behind a "." (eg .myGlobal <<- 72) and use export

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread hadley wickham
On Mon, Apr 6, 2009 at 5:31 PM, Jun Shen wrote: > This is a good example to compare different approaches. My understanding is > > aggregate() can apply one function to multiple columns > summarize() can apply multiple functions to one column > I am not sure if ddply() can actually apply multiple f

Re: [R] Puzzled by an error with apply()

2009-04-06 Thread Rolf Turner
On 7/04/2009, at 2:04 PM, Gang Chen wrote: I've written a function, myFunc, that works fine with myFunc(data, ...), but when I use apply() to run it with an array of data apply(myArray, 1, myFunc, ...) I get a strange error: Error in match.fun(FUN) : '1' is not a function, character or symbo

Re: [R] Writing specific columns to a data file

2009-04-06 Thread Coen van Hasselt
By only selecting the first column, i.e. write.table(data[,1], file="", .) ? On Tue, Apr 7, 2009 at 12:28, Brendan Morse wrote: > Hi, I have a function that generates some output with 2 columns, but I > only want to write the first column to a file. Is there a way to do > this in the write.t

Re: [R] How to save the variables in R to a file

2009-04-06 Thread Bernardo Rangel Tura
On Mon, 2009-04-06 at 11:05 +0200, Cetinyürek Aysun wrote: > Dear list members, > > I have f.mean matrix of size 500 X 83 in R, and I want to save this into a > file. > I used the command > save("f.mean.Rdata",file="D:/Users/Ays/Documents/Results") > it saves but when I open the file in notepad it

[R] Writing specific columns to a data file

2009-04-06 Thread Brendan Morse
Hi, I have a function that generates some output with 2 columns, but I only want to write the first column to a file. Is there a way to do this in the write.table command? thetaout=write.table(estimatedtheta, file="/Users/morse07/Desktop/R/ Trial/score.dat", row.names=F, col.names=F) Any adv

[R] Writing specific columns to a data file

2009-04-06 Thread Brendan Morse
Hi, I have a function that generates some output with 2 columns, but I only want to write the first column to a file. Is there a way to do this in the write.table command? thetaout=write.table(estimatedtheta, file="/Users/morse07/Desktop/R/ Trial/score.dat", row.names=F, col.names=F) Any adv

[R] Puzzled by an error with apply()

2009-04-06 Thread Gang Chen
I've written a function, myFunc, that works fine with myFunc(data, ...), but when I use apply() to run it with an array of data apply(myArray, 1, myFunc, ...) I get a strange error: Error in match.fun(FUN) : '1' is not a function, character or symbol which really puzzles me because '1' is meant

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread jim holtman
If you want 128 combinations, then generate 8 16-bit random numbers and concatenate them together. You will have to check for dups as you generate the sequence, but it is at least a start and should fit within the memory of the system. On Mon, Apr 6, 2009 at 7:39 PM, David Katz wrote: > > This i

[R] extract values from summary

2009-04-06 Thread Felipe Carrillo
Hi: # How can I extract the 'Forecasts' from the 'summary(predicted)' from the example below? library(forecast) weightData <- data.frame(weight = c(2.1,2.4,2.8,3.6,4.1,5.2,6.3),week= 1:7) weight <- as.numeric(weightData$weight) predicted <- forecast(weight,h=3,level=95) # see the predicted sum

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread David Katz
This is very cool indeed until you want to use more than 32 or so terms and most operating systems force you to go to floating point. > x=sample(2^34,1000) Error in sample(2^34, 1000) : invalid 'x' argument In addition: Warning message: In sample(2^34, 1000) : NAs introduced by coercion jholt

[R] heatmap.2 no reordering of the columns and rows

2009-04-06 Thread Tanuja Bompada
Hi,   I need to generate a heatmap on a square matrix and wouldn't want to reorder the columns and the rows on the heatmap display.    I have used the options Rowv=NULL and Colv=NULL but doesn't seem to work. Following is a snippet of the heatmap function i am using. args <- commandArgs(); inpu

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread David Katz
If I understand your problem properly, you could just note that selecting 1:n of n objects is the same as deciding separately whether each one is included or not. (exclude the case where none are selected). Take 1000 of these and you are there- except some are duplicates - so generate extras and

[R] Confidence interval?

2009-04-06 Thread Thomas Seth Davis
hi folks, I need help fitting/plotting a confidence interval to a frequency distribution Can someone help with this? thanks, tsd -Original Message- > Date: Mon Apr 06 15:08:20 MST 2009 > From: r-help-requ...@r-project.org > Subject: Welcome to the "R-help" mailing list >

[R] Calculating marginal effects in R

2009-04-06 Thread Ranju Bhattarai
Hi, I estimated the probit model in R using glm command. I am looking for a way to estimate the marginal effects of the variables in the probit model. I would highly appreciate if anyone could share the code for estimating the marginal effects in R. Thank you Ranu [[alternative HTML vers

Re: [R] multi panel plot using xyplot()

2009-04-06 Thread jim holtman
Why don't you use something like this to plot without having to extract the clones: xyplot(height~year|factor(clone), x, group=code, layout=c(3,2)) On Mon, Apr 6, 2009 at 6:11 PM, Schreiber, Stefan wrote: > Hi there, > > I hope you guys can help me with the following: > > If have a file like

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Jun Shen
This is a good example to compare different approaches. My understanding is aggregate() can apply one function to multiple columns summarize() can apply multiple functions to one column I am not sure if ddply() can actually apply multiple functions to multiple columns? This is what I would like to

[R] ROCR package partial false positive and accuracy

2009-04-06 Thread Saeed Abu Nimeh
Hi, In the ROCR package is there a way to find the accuracy that corresponds to a given false positive rate. In version 1.0-2, the authors of the package added an option to find the partial area under the ROC curve up to a given false positive rate by passing an optional parameter fpr.stop: perf.au

[R] multi panel plot using xyplot()

2009-04-06 Thread Schreiber, Stefan
Hi there, I hope you guys can help me with the following: If have a file like this: yearclone codeheight 19954 4-1 1 19964 4-1 2 19974 4-1 3 19954 4-2 1 19964 4-2 2 19974 4-2 3 19955 5-1 1

[R] tkrplot installation problems

2009-04-06 Thread Abhijit Dasgupta
Hello, I'm running R 2.8.1 on Ubuntu Hardy. I'm trying to install tkrplot. Using r-cran-tkrplot from the repository, I'm getting the following error: > library(tkrplot) Loading required package: tcltk Loading Tcl/Tk interface ... done Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk

Re: [R] approximation function

2009-04-06 Thread carol white
Thanks for your reply. I know the exact values. The purpose is to find out the distribution function if it is exponential, linear, etc. Best, Carol --- On Mon, 4/6/09, Ravi Varadhan wrote: From: Ravi Varadhan Subject: Re: [R] approximation function To: wht_...@yahoo.com Cc: r-h...@stat.math.

[R] mtext problem - grainy and massive file size

2009-04-06 Thread gcam032
Hi Team, I'm on a mac, 0SX 10.5.6, R 2.7.2. I consistently make pairs plots and use mtext() to put labels on top of the plot in the outer margin. All of a sudden, this text has become really grainy in the final product and is making huge files. I have no idea why this has just started happenin

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Dylan Beaudette
Nice example. Does anyone know if it is possible to use multiple aggregating functions with the melt/cast functions? Cheers, Dylan On Monday 06 April 2009, Christian wrote: > A good package for this sort of questions is doBy, too. > > library(doBy) > summaryBy( tpdv + UM + qta ~ Materiale ,dat

Re: [R] approximation function

2009-04-06 Thread Ravi Varadhan
Hi, At the sampling points, do you know the function value "exactly" or you only observe it with "noise"? If it is the former, you can use an interpolation scheme, such as, for example, interpSpline() in "splines" package. If it is the latter, you can use a smoother, such as, for example, smo

Re: [R] approximation function

2009-04-06 Thread Luc Villandre
Hi, This is a rather broad question. The function lowess() might be a good place to start, I guess (although I'm not sure whether this fits in your definition of "approximation functions"...). Best of luck, Luc carol white wrote: Hi, Having a set of values (non-time series data), what a

[R] approximation function

2009-04-06 Thread carol white
Hi, Having a set of values (non-time series data), what are the approximation functions that could determine the trend of the values? Cheers, Carol [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat

Re: [R] "bucketing" observations

2009-04-06 Thread Dan Dube
great! the "cut" function was exactly what i needed. thank you both! > -Original Message- > From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] > Sent: Monday, April 06, 2009 4:01 PM > To: Dan Dube > Cc: r-help@r-project.org > Subject: Re: [R] "bucketing" observations > > try

Re: [R] "bucketing" observations

2009-04-06 Thread Dimitris Rizopoulos
try this: dat <- data.frame(vals = rnorm(1000)) breaks <- quantile(dat$vals, seq(0, 1, .1)) dat$bucket <- cut(dat$vals, breaks, labels = FALSE, include.lowest = TRUE) I hope it helps. Best, Dimitris Dan Dube wrote: is there a better way to bucket observations into more-or-less evenly sized

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread Eik Vettorazzi
Hi Jasper, maybe its not a very R'ish solution but the following could be a starting point: First, notice that every combination you are looking for can be represented as an integer in binary notation where each bit stands for a specific community. So looping through all combinations is the sam

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread jim holtman
Are you just trying to obtain a combination from 25 possible terms? If so, then just sample the number you want and convert the number to binary: > sample(33554432,100) [1] 6911360 5924262 23052661 12888381 25831589 16700013 24079278 33282839 12751862 26086726 31363494 7118320 21866536 42129

Re: [R] "bucketing" observations

2009-04-06 Thread Bert Gunter
?cut ?quantile (perhaps, to define the breaks) Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Dube Sent: Monday, April 06, 2009 12:45 PM To: r-help@r-project.org Su

[R] "bucketing" observations

2009-04-06 Thread Dan Dube
is there a better way to bucket observations into more-or-less evenly sized buckets than this? it seems like this must be a common operation: dt = data.frame(points=rnorm(1000),bucket=NA) breaks = quantile(dt$points,seq(0:1,.1)) for (i in 2:length(breaks)) { if (i == 2) {

Re: [R] Need help in calculating studentized residuals/leverage values of non-linear model [nls()]

2009-04-06 Thread rkevinburton
Is the output of residuals() the studentized residuals or just the residuals? Dieter Menne wrote: > Giam Xingli nus.edu.sg> writes: > > >I hope I can get advice regarding the calculation of leverage values or > >studentized residual values of a non-linear regression model. It seem

[R] Bonpower Crashes Trying Sparse Matrix (Igraph)

2009-04-06 Thread Surendar Swaminathan
Hello All, I have been trying to do bonpow for a while now.Bonpow works for few graphs and for few others it goes out of memory. I did see reply to one of the posting Alph Centrality Crashed in Igraph memory error. The solution in the posting was to use sparse matrix. This is the link of the mes

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Uwe Ligges
Dieter Menne wrote: Uwe Ligges statistik.tu-dortmund.de> writes: That fine, in principle, convention is to have code in zzz.R, see Writing R Extzensions. Finally I got it, zzz comes from Extzensions. In the fields I normally work in, zzz mean the LAST thing to do before going to sleep or t

Re: [R] contourplot label color

2009-04-06 Thread Deepayan Sarkar
On Mon, Apr 6, 2009 at 9:00 AM, bruno joly wrote: > Hi everyone, > > I am new to the list. > My problem is to change the color of the label in a contour plot. The plot > is quite dark and I'd like to have the line and label white, it works for > the line with a simple "col", but for the labels I n

[R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread jasper slingsby
Hello I apologise for the length of this entry but please bear with me. In short: I need a way of subsampling communities from all possible communities of n taxa taken 1:n at a time without having to calculate all possible combinations (because this gives me a memory error - using combn() or ex

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Christian
A good package for this sort of questions is doBy, too. library(doBy) summaryBy( tpdv + UM + qta ~ Materiale ,data=data,FUN=c(sum,length,mean)) regards, Christian Hi, I ve been searching a lot in internet..but I can t find a solution Attached, you find a file. I need for each (Materiale, tpdv,

Re: [R] nlme weighted

2009-04-06 Thread Dieter Menne
Mollet, Fabian wur.nl> writes: > I'm fitting a non linear model (energy allocation model to individual > growth data) using your nlme routine. For each individual I have thus a > number of observations (age and size) to which I fit the nonlinear > function, with random effects for the individuals

[R] Problem with Extracting Fitted Values from fGarch package

2009-04-06 Thread Mohammad Sabr
Good day everyone, I fitted a GARCH model to a time series and R estimated the model and provide me with the estimates. However, when I tried to extract the fitted values from the estimated model I got the following error message: "Error in .local(object, ...) : object "fit" not found"   I used

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Dieter Menne
Uwe Ligges statistik.tu-dortmund.de> writes: > That fine, in principle, convention is to have code in zzz.R, see > Writing R Extzensions. Finally I got it, zzz comes from Extzensions. In the fields I normally work in, zzz mean the LAST thing to do before going to sleep or to crash the system.

[R] How to find the cost relationship with a few factors and a few numeric sizes? (Resending with datasets)

2009-04-06 Thread guox
I have a small data set (see attachment valve.txt or valve.csv), in which there are a few facors: Type, ValveBody,Manufacturer and a few numeric sizes: FlangeSize, Port.Size, Pressure and Cost. I would like to find a statistics model that shows how Cost is related to these factors and numeric size

Re: [R] Boxplots in Barplots

2009-04-06 Thread Greg Snow
Well, the symbols function will add boxplots to an existing plot wherever you want. But, you should really consider what question(s) your are trying to answer. As a general rule, adding things to a barplot will do more to distort the barplot than add additional information. If the boxplot con

Re: [R] Collapse data matrix with extra info separated by commas

2009-04-06 Thread hadley wickham
On Mon, Apr 6, 2009 at 10:40 AM, baptiste auguie wrote: > Here's one attempt with plyr, hopefully Hadley will give you a better > solution ( I could not get cast() to do it either) > > test <- > data.frame(a=c("A","A","A","A","B","B","B"),b=c(1,1,2,2,1,1,1),c=sample(1:7)) > ddply(test,.(a,b),.fun=

[R] dput and getOptions('width')

2009-04-06 Thread Stavros Macrakis
dput appears to ignore the value of getOptions('width') Is there some other way to control the line width it uses? or to get it to observe getOptions('width')? If I wanted infinite line width, I could send the output to a textConnection and paste the pieces together, but putting line breaks back

Re: [R] how to sort and plot data?

2009-04-06 Thread Jun Shen
Hema, This may work: aggregate(hema[1],hema[2],function(x)length(unique(x))) to calculate how many different websites each id visited. hema[1] is the website column, hema[2] is user_id. You can always add more index columns like days to aggregate(). Jun On Thu, Apr 2, 2009 at 11:06 PM, Hemavathi

Re: [R] enscript states file for R scripts?

2009-04-06 Thread Thomas Liebig
Hi, enclosed is an enscript states file for R scripts. regards, Thomas Peter Dalgaard schrieb: Dirk Eddelbuettel wrote: On 15 July 2008 at 17:23, hadley wickham wrote: | An alternative to enscript is highlight, | http://www.andre-simon.de/doku/highlight/en/highlight.html, which does | come wi

Re: [R] Maintain proportions while reducing graphic output size

2009-04-06 Thread Glen Sargeant
lawnboy34 wrote: > > Hello, > > Is there a combination of par() settings or other commands that will allow > me to uniformly reduce the size of graphics outputs? It appears that the > png() device outputs 5-inch by 5-inch images, and I am trying to change > my > whole script to produce 4x4 im

Re: [R] Problem with Dynamo-Package

2009-04-06 Thread Mohammad Sabr
Hi Jim, In fact I faced this message when I installed several other packages but I didn't face any problem loading them except the Dynamo-Package. I tried to install it on an another computer and I faced the same problem, the package failed to load. Any help will be appreciated. Mohammad

[R] How to find the cost relationship with a few factors and a few numeric sizes?

2009-04-06 Thread guox
I have a small data set (see attachment valve.txt or valve.csv), in which there are a few facors: Type, ValveBody,Manufacturer and a few numeric sizes: FlangeSize, Port.Size, Pressure and Cost. I would like to find a statistics model that shows how Cost is related to these factors and numeric size

Re: [R] Collapse data matrix with extra info separated by commas

2009-04-06 Thread jim holtman
try this: > x <- lapply(split(test, list(test$a, test$b), drop=TRUE), function(.data){ + data.frame(a=.data$a[1], b=.data$b[1], c=paste(.data$c, collapse=',')) + }) > do.call(rbind, x) a b c A.1 A 1 1,2 B.1 B 1 5,6,7 A.2 A 2 3,4 > On Mon, Apr 6, 2009 at 10:38 AM, Daniel Brewer w

[R] contourplot label color

2009-04-06 Thread bruno joly
Hi everyone, I am new to the list. My problem is to change the color of the label in a contour plot. The plot is quite dark and I'd like to have the line and label white, it works for the line with a simple "col", but for the labels I need to pass throught a panel call and : > contourplot(Pr

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Martin Morgan
Hi Ken -- Ken-JP wrote: > > Is there a specific place where we can place code to run once only in a > package? > > I have code that switches based on Sys.info()[["nodename"]] - but since this > just about never changes, I would like to run it only once when someone > runs: > > require( mypackag

[R] ARMA-GARCH package in R?

2009-04-06 Thread Irene Schreiber
Hello, Does anyone know about an R-package on multivariate ARMA-GARCH models? Or in Matlab? I would be very grateful if someone could help! Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list h

Re: [R] Collapse data matrix with extra info separated by commas

2009-04-06 Thread baptiste auguie
Here's one attempt with plyr, hopefully Hadley will give you a better solution ( I could not get cast() to do it either) test <- data .frame (a=c("A","A","A","A","B","B","B"),b=c(1,1,2,2,1,1,1),c=sample(1:7)) ddply(test,.(a,b),.fun=function(.) paste(.)[3]) a b V1 1 A 1c(2, 4

Re: [R] Recommended packages for a statistician

2009-04-06 Thread Martin Maechler
> "LV" == Luc Villandre > on Mon, 06 Apr 2009 10:42:34 -0400 writes: LV> Hi, LV> Pretty hard to say. It really depends on what you want to. LV> MASS, nlme, lme4 and Hmisc are packages I use on a daily basis. Note that MASS is part of the VR bundle, and that and nlme are

Re: [R] Schoenfeld residuals

2009-04-06 Thread Terry Therneau
Laura Bonnett was kind enough to send me a copy of the data that caused the plotting error, since it was an error I had not seen before. 1. The latest version of survival gives a nicer error message: > fit <- coxph(Surv(rem.Remtime, rem.Rcens) ~ all.sex, nearma) > cfit <- cox.zph(fit) > plot(cf

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Karl Ove Hufthammer
calpeda: > I need for each (Materiale, tpdv, UM) to find sum,avg and count > My idea was to aggregate for the 3 parameters ..but I don t know how to > get the numeric value (SUM,COUNT,AVG) I need. If I have understood what you’re trying to accomplish, this should work: $ library(Hmisc) $ d=read.

Re: [R] number of zeros in a matrix -row by row

2009-04-06 Thread onyourmark
oh boy, what a mistake. Ok, I will try that and look up what it means afterward. Thank you. MUHC-Research wrote: > > Hi, > > Try > > /rowSums(M==0)/ > > This should work just fine. > > Cheers, > > Luc > > onyourmark wrote: >> Hi. I have an n x m matrix M some of who's entries are zeros. I

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread hadley wickham
On Mon, Apr 6, 2009 at 9:34 AM, Stavros Macrakis wrote: > There are various ways to do this in R. > > # sample data > dd <- data.frame(a=1:10,b=sample(3,10,replace=T),c=sample(3,10,replace=T)) > > Using the standard built-in functions, you can use: > > *** aggregate *** > > aggregate(dd,list(b=dd$

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Stavros Macrakis
Actually, ddply does this perfectly ... I had made a mistake in using 'each'. The correct code is: ddply(dd,~b+c,function(x)each(count=length,sum=sum,avg=mean)(x$a)) b c count sum avg 1 1 1 2 10 5.00 2 2 1 1 3 3.00 3 3 1 1 10 10.00 4 1 2 2 10 5.00

Re: [R] threshold distribution

2009-04-06 Thread J. R. M. Hosking
Abelian wrote: Dear ALL I have a list of data below 0.80010 0.72299 0.69893 0.99597 0.89200 0.69312 0.73613 1.13559 0.85009 0.85804 0.73324 1.04826 0.84002 1.76330 0.71980 0.89416 0.89450 0.98670 0.83571 0.73833 0.66549 0.93641 0.80418 0.95285 0.76876 0.82588 1.09394 1.00195 1.14976 0.80008 1.119

Re: [R] Recommended packages for a statistician

2009-04-06 Thread Luc Villandre
Hi, Pretty hard to say. It really depends on what you want to. MASS, nlme, lme4 and Hmisc are packages I use on a daily basis. I guess you could also ask for those. David Scott wrote: On Wed, 1 Apr 2009, Eamonn O'Brien wrote: The company I work for require users to request what packages they

[R] Collapse data matrix with extra info separated by commas

2009-04-06 Thread Daniel Brewer
Hello, I would like to reshape my data for presentation purposes from something like this: > test <- data.frame(a=c("A","A","A","A","B","B","B"),b=c(1,1,2,2,1,1,1),c=1:7) > test a b c 1 A 1 1 2 A 1 2 3 A 2 3 4 A 2 4 5 B 1 5 6 B 1 6 7 B 1 7 to something like this: a b c 1 A 1 1,2 3 A 2 3,4 5 B

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Stavros Macrakis
There are various ways to do this in R. # sample data dd <- data.frame(a=1:10,b=sample(3,10,replace=T),c=sample(3,10,replace=T)) Using the standard built-in functions, you can use: *** aggregate *** aggregate(dd,list(b=dd$b,c=dd$c),sum) b c a b c 1 1 1 10 2 2 2 2 1 3 2 1 *** tapply **

Re: [R] Search for a graph package - see link

2009-04-06 Thread Gábor Csárdi
Yes, the 'igraph' package can do this (http://igraph.sf.net), and I think 'network' can do it, too. Maybe others as well. Best, Gabor On Mon, Apr 6, 2009 at 4:26 PM, Knut Krueger wrote: > Hi to all, > does anybody knows whether there is a package to plot those > http://www.equine-science.de/temp

Re: [R] Best way to turn a list into a data.frame

2009-04-06 Thread Daniel Brewer
Thanks thats marvellous. Does the trick beautifully. Dan hadley wickham wrote: > On Mon, Apr 6, 2009 at 8:49 AM, Daniel Brewer wrote: >> Hello, >> >> What is the best way to turn a list into a data.frame? >> >> I have a list with something like: >> $`3845` >> [1] "04010" "04012" "04360" >> >>

[R] Search for a graph package - see link

2009-04-06 Thread Knut Krueger
Hi to all, does anybody knows whether there is a package to plot those http://www.equine-science.de/temp/graph.jpg graphs. the thickness of the points and/or the lines should be represent the numbers of behaviours With kind regards Knut __ R-help@r-p

Re: [R] Best way to turn a list into a data.frame

2009-04-06 Thread Luc Villandre
Hi Daniel, In your case, I guess you could use: col1 = rep(attributes(my.list)$names,lapply(my.list,length)) ; col2 = unlist(my.list,use.names=FALSE) ; my.data.frame = as.data.frame(cbind(col1,col2)) ; This should work well. Cheers, Luc Daniel Brewer wrote: Hello, What is the best way to t

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Uwe Ligges
Ken-JP wrote: Is there a specific place where we can place code to run once only in a package? I have code that switches based on Sys.info()[["nodename"]] - but since this just about never changes, I would like to run it only once when someone runs: require( mypackage ) or library( vte ) I'

Re: [R] Best way to turn a list into a data.frame

2009-04-06 Thread hadley wickham
On Mon, Apr 6, 2009 at 8:49 AM, Daniel Brewer wrote: > Hello, > > What is the best way to turn a list into a data.frame? > > I have a list with something like: > $`3845` >  [1] "04010" "04012" "04360" > > $`1029` > [1] "04110" "04115" > > And I would like to get a data frame like the following: >

Re: [R] Need Help with StatET Error/Bug? on Ubuntu 8.10 amd64

2009-04-06 Thread John Fox
Dear Ken, The thread on the StatET email list to which I referred indicates that StatET does work under 64-bit Vista using 32-bit Eclipse and Java. Best, John > -Original Message- > From: r-help-boun...@

Re: [R] number of zeros in a matrix -row by row

2009-04-06 Thread Luc Villandre
Hi, Try /rowSums(M==0)/ This should work just fine. Cheers, Luc onyourmark wrote: Hi. I have an n x m matrix M some of who's entries are zeros. I want to know how many zeros there are in each row-perhaps stored in a 1 x n vector which lists the number of zeros for each row of M. Before

[R] [R-pkgs] New package: ascii version 0.1

2009-04-06 Thread David Hajage
Hi, ascii is a new R package for writing asciidoc or txt2tags document with embeded R commands. It provides: - a generic method for common R objects: ascii(). Default argument depends of R object. - two Sweave drivers: Sweave("yourfile.Rnw", RweaveAsciidoc) or Sweave("yourfile.Rnw", RweaveT2t).

[R] update() a LME-with correlated errors object

2009-04-06 Thread Christian Salas
Hi there I cannot update a fitted LME-with spatially correlated errors object, please check the example. Data from an R book, only 281 rows, the provided code download the data from my website. I use R 2.8.1 under linux-ubuntu, For this session i was using the following packages Package

[R] Best way to turn a list into a data.frame

2009-04-06 Thread Daniel Brewer
Hello, What is the best way to turn a list into a data.frame? I have a list with something like: $`3845` [1] "04010" "04012" "04360" $`1029` [1] "04110" "04115" And I would like to get a data frame like the following: 3845 "04010" 3845 "04012" 3845 "04360" 1029 "04110" 1029 "04115" Any ideas

[R] Maintain proportions while reducing graphic output size

2009-04-06 Thread Jason Pare
Hello, Is there a combination of par() settings or other commands that will allow me to uniformly reduce the size of graphics outputs? It appears that the png() device outputs 5-inch by 5-inch images, and I am trying to change my whole script to produce 4x4 images with the same proportions. I tri

Re: [R] How to preserve NULL in vector

2009-04-06 Thread Duncan Murdoch
On 4/6/2009 9:24 AM, Daren Tan wrote: I have a vector containing NULL. Referencing to that NULL gives me NA instead, which disrupt my codes. How can i preserve NULL as it is ? NULL is not a numeric value, so you can't put it in a numeric vector. When you tried, it got converted to the numeric

[R] How to preserve NULL in vector

2009-04-06 Thread Daren Tan
I have a vector containing NULL. Referencing to that NULL gives me NA instead, which disrupt my codes. How can i preserve NULL as it is ? > res <- c(1,2,NULL) > res[1] [1] 1 > res[2] [1] 2 > res[3] [1] NA __ R-help@r-project.org mailing list https://sta

[R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Ken-JP
Is there a specific place where we can place code to run once only in a package? I have code that switches based on Sys.info()[["nodename"]] - but since this just about never changes, I would like to run it only once when someone runs: require( mypackage ) or library( vte ) I'm tempted to have

Re: [R] Need Help with StatET Error/Bug? on Ubuntu 8.10 amd64

2009-04-06 Thread Ken-JP
Thank you, John, for this bit of information - it will be useful when I move to 64 bit Vista one of these days. FWIW, the Ubuntu 8.10 amd64 install I attempted was on 64-bit versions of everything (except possibly StatET itself). 64-bit R, JDK, and Eclipse. If someone does get StatET working

Re: [R] Code of sample() in C

2009-04-06 Thread Paul Smith
Thanks again, Ranjan. I am wondering whether the seed can be set (renewed) with GetRNGstate(). Furthermore, I would like to understand why I am getting the reported compilation errors when I insert GetRNGstate() in my code. Paul On Mon, Apr 6, 2009 at 12:17 PM, Ranjan Maitra wrote: > Hi Paul, >

Re: [R] Need Help with StatET Error/Bug? on Ubuntu 8.10 amd64

2009-04-06 Thread John Fox
Dear Ken-JP, I'm not sure that this is relevant, but I posted a question recently to the StatET list about using StatET with 64 bit Vista (I don't yet have the machine), and was told that it would work, but only with 32-bit versions of Eclipse and Java. I hope this helps, John > -Original M

Re: [R] package: maps and spatstat question

2009-04-06 Thread hadley wickham
Hi Laura, You might find the map_data function from the ggplot2 package helpful: library(ggplot2) library(maps) head(map_data("state", "iowa")) It formats the output of the map command into a self-documenting data frame. Hadley On Mon, Apr 6, 2009 at 7:00 AM, Laura Chihara wrote: > > I would

[R] Odp: re ad.table

2009-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2009 11:54:27: > > Hi, > I ve been searching a lot in internet..but I can t find a solution > Attached, you find a file. > I need for each (Materiale, tpdv, UM) to find sum,avg and count > My idea was to aggregate for the 3 parameters ..but I don

Re: [R] SUM,COUNT,AVG

2009-04-06 Thread Gabor Grothendieck
I gather you have an SQL background since those are SQL functions. Check out the sqldf R package and the many examples on the home page: http://sqldf.googlecode.com and in ?sqldf That may ease the transition from SQL to R. On Mon, Apr 6, 2009 at 5:37 AM, calpeda wrote: > > Hi, > I ve been sear

[R] Boxplots in Barplots

2009-04-06 Thread johnhj
Hii, Is it possible to put Boxplots at the top of the Barplots ? I will describe the standard derivation with a Boxplot at the of the Barplots. It could also be "line" instead of Boxplot... Can anybody help me how to do it ? greetings, j. -- View this message in context: http://www.nabble.c

[R] re ad.table

2009-04-06 Thread calpeda
Hi, I ve been searching a lot in internet..but I can t find a solution Attached, you find a file. I need for each (Materiale, tpdv, UM) to find sum,avg and count My idea was to aggregate for the 3 parameters ..but I don t know how to get the numeric value (SUM,COUNT,AVG) I need. Can you help me? t

[R] SUM,COUNT,AVG

2009-04-06 Thread calpeda
Hi, I ve been searching a lot in internet..but I can t find a solution Attached, you find a file. I need for each (Materiale, tpdv, UM) to find sum,avg and count My idea was to aggregate for the 3 parameters ..but I don t know how to get the numeric value (SUM,COUNT,AVG) I need. Can you help me? t

[R] nlme weighted

2009-04-06 Thread Mollet, Fabian
Dear R-expert I'm fitting a non linear model (energy allocation model to individual growth data) using your nlme routine. For each individual I have thus a number of observations (age and size) to which I fit the nonlinear function, with random effects for the individuals on the estimated paramet

[R] package: maps and spatstat question

2009-04-06 Thread Laura Chihara
I would like to use the output from the map function in the package maps for use in, say, the spatstat package. I don't quite understand the coordinates for the border of the state: Example: library(maps) iowa<-map("region","iowa) x<-iowa$x y<-iowa$y There are NA's and duplicated coordinates.

[R] R and .net/C#

2009-04-06 Thread fayssal
Hi There, There seems to be a way for calling R from .net. However, is there anyway for calling .net/C# code from R? Something similar to the RJava package for .net? Thanks a mil! Fayssal -- View this message in context: http://www.nabble.com/R-and-.net-C--tp22904715p22904715.html Sent from

  1   2   >