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

2009-04-06 Thread Dimitris Rizopoulos
well, you said you tried rowSums(M == 0) but according to the error message it seems that you tried rowSums[M == 0] Try to use parenthesis '(' instead of brackets '['. Best, Dimitris onyourmark wrote: Dear Dimitris, Thanks very much. I tried dim(M) and get: [1] 5030 2142 which I thought

Re: [R] line argument in mtext for axis ?

2009-04-06 Thread Uwe Ligges
Daren Tan wrote: Is there a similar argument for axis that controls the position of labels via line argument in mtext ? At least in my version of the help page of mtext() everything about that is described. What is your problem with ?mtext and the "line" argument? Uwe Ligges

[R] mckelvey-zavoina pseudo r2

2009-04-06 Thread Ryan Boyko
Hi, Are there any packages or functions that calculate the McKelvey-Zavoina Pseudo-R2 or the Aldrich-Nelson Pseudo-R2? Thanks, Ryan -- Ryan Boyko Graduate Student, UC Davis Evolutionary Anthropology and Graduate Group in Ecology Research Assistant to Cornell Village Dog Diversity Project

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

2009-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2009 05:01:56: > hi Erin, > Thanks for your reply to my problems. I tried and it works, but it sorted > all the column. In my case, I want it to sort d user_id column and another > information in other column will follow it. Now, after I sorted,

Re: [R] line argument in mtext for axis ?

2009-04-06 Thread Daren Tan
Previously, I wasn't aware that axis() supports "las" arguments, and as a result, I used axis() for the ticks and mtext() to rotate the labels perpendicular to the axis. Now, I hope to cleanup my codes by combining the axis() and mtext() codes into a single axis(), the only issue is that much of my

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

2009-04-06 Thread Cetinyürek Aysun
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 is just some characters meaningless. Thank you in advance, Kind Regard

Re: [R] mtext in barplot

2009-04-06 Thread Jim Lemon
johnhj wrote: Hii, Can anybody help me to put a text under the barplots. I will describe the percental between six grouped barplots. I tried to do it with mtext but without success. ... I tired to do it with mtext(side=1,at=x, text =c("Mean", "","","","","rere"), col = "red"), line = 1, cex =

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

2009-04-06 Thread Ken-JP
Hi, I posted this message on the StatET-user board last week, but it looks like a ghost-town... I have a bad feeling that there is some code in the plug-in which doesn't work well with my environment, but if I am lucky, maybe other users have worked around this problem somehow - I am hoping that

Re: [R] bigglm "update" with ff

2009-04-06 Thread Thomas Lumley
On Thu, 2 Apr 2009, Yue Sheng wrote: Hi, since bigglm doesn't have update, I was wondering how to achieve something like (similar to the example in ff package manual using biglm): bigglm() doesn't have update because it needs to iterate over the data and update() couldn't do that. Instead o

[R] GarchOxFit output

2009-04-06 Thread Vasileios Ismyrlis
Dear Sirs, I have a problem with the garchOxFit output. I want to display only the value of max.like.est and the information criteria. How can I do that; I enclose a part of GarchOxFit output, which is what I want to display. Best regards, Vasilios Ismyrlis GarchOxFit output No. Observations :

Re: [R] line argument in mtext for axis ?

2009-04-06 Thread Daren Tan
Thanks, I should learn to read deeper into the help page next time. :) On Mon, Apr 6, 2009 at 4:56 PM, Annette Heisswolf wrote: > Hei, > > As far as I understand your question, you might want to check the settings > of par(mgp), which has three elements. According to ?par mgp sets  "The > margin

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

2009-04-06 Thread Ranjan Maitra
Hi Paul, I believe that you may need to set seed differently when you call the R math library as standalone. Specifically, you need to do the following (or rather, the following works): unsigned int seed1, seed2; FILE *fran; fran = fopen("random.seed","r");

[R] political maps world maps in R, wrld_simpl

2009-04-06 Thread Patrizio Frederic
dear all, I'm a newbie in map tools. I was asking to perform an apparently very simple task. I have a list of countries (about fifty all over in the world) scored with a real positive value. Eg Country score Italy .56 UK .58 Korea .41 Mexico .63 ... I wish to plot geographical maps wher

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

2009-04-06 Thread Paul Smith
Thanks, Ranjan! I have tried to use the function SampleNoReplace in random.c, which seems to work, except that I get always the same random numbers (with your code the same happens). (My code is below.). I have read the documentation ("Writing R extensions"), where it is advised: «The interface t

Re: [R] time-series data and time-invariant missing values

2009-04-06 Thread Gabor Grothendieck
Check out na.locf in the zoo package. Here we fill in NAs going forward and just in case there were NAs right at the beginning we fill them in backward as well. library(zoo) x <- as.Date(c(NA, "2000-01-01", NA)) x2 <- na.locf(x, na.rm = FALSE) x2 <- na.locf(x2, fromLast = TRUE, na.rm = FALSE) gi

Re: [R] Grouping of data frames to calculate means

2009-04-06 Thread Thomas Lumley
On Mon, 6 Apr 2009, Steve Murray wrote: Dear R Users, I have 120 data frames of the format table_198601, table_198602... table_198612, table_198701, table_198702... table_198712 through to table_199512 (ie. the first 4 digits are years which vary from 1986 to 1995, and the final two digits

Re: [R] Survey Package with Binary Data (no Standard Errors reported)

2009-04-06 Thread Thomas Lumley
On Fri, 3 Apr 2009, Paul Jones wrote: Hi, I'm trying to get standard errors for some of the variables in my data frame. One of the questions on my survey is whether faculty coordinate across curriculum to include Arts Education as subject matter. All the responses are coded in zeros and ones

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

2009-04-06 Thread Christian Ruckert
Cetinyürek Aysun schrieb: 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 is just some characters meaningless. The p

Re: [R] all subsets for glm

2009-04-06 Thread Thomas Lumley
If you actually want to find the best subsets, you can get a good approximation by using leaps on the weighted least squares fit that is the last iteration of the IWLS algorithm for fitting the glm. Running regsubsets witha reasonably large value of nbest and then refitting the top models as

Re: [R] line argument in mtext for axis ?

2009-04-06 Thread Annette Heisswolf
Hei, As far as I understand your question, you might want to check the settings of par(mgp), which has three elements. According to ?par mgp sets "The margin line (in mex units) for the axis title, axis labels and axis line. Note that mgp[1] affects title whereas mgp[2:3] affect axis. The defa

[R] Comparing 2 slopes of 2 regression lines

2009-04-06 Thread Benedikt Niesterok
Hello everyone, I would like to test two regression slopes:do they differ significantly?The data and commands I've used so far: x<-8.5:32.5 #Vektor x y<-c( NA , NA , 5.67 , 6.53 , 6.83, 7.41 , 7.93 , 8.5 , 8.86, 9.46 , 9.82 , 10 ,10.35 , 10.7 ,11.03 ,11.37 ,11.61 ,11.84, 12.12, 12.39 ,1

[R] Grouping of data frames to calculate means

2009-04-06 Thread Steve Murray
Dear R Users, I have 120 data frames of the format table_198601, table_198602... table_198612, table_198701, table_198702... table_198712 through to table_199512 (ie. the first 4 digits are years which vary from 1986 to 1995, and the final two digits are months which vary from 01 to 12 for eac

Re: [R] Curve fitting,FDA for biological data

2009-04-06 Thread trias
There are a couple of different goals for this projects *identify periodicities at different timescales (ie different dT) *fit data into discrete number of curves, ie 6 different basic functions should be enough to describe the basic repeating elements in this data (ie 6 different categories of

[R] Odp: Comparing 2 slopes of 2 regression lines

2009-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2009 12:28:35: > Hello everyone, > I would like to test two regression slopes:do they differ significantly?The > data and commands I've used so far: > x<-8.5:32.5 #Vektor x > y<-c( NA , NA , 5.67 , 6.53 , 6.83, 7.41 , 7.93 , 8.5 , 8.86, 9

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-06 Thread Ken-JP
UPDATE on StatET and Ubuntu 8.10 amd64: StatET also works perfectly on Ubuntu 8.10 amd64, but the installation procedure takes a lot more effort than on XP Pro 32-bit or Vista 32-bit (at least from my experience). But I am very happy to have more RAM and having StatET working definitely helps

[R] time-series data and time-invariant missing values

2009-04-06 Thread Kunzler, Andreas
Dear list, I have some problems with time-series data and missing values of time-invariant informations like sex or the birth-date. Assume a data (d) structure like id birth sex year of observation 1 NA NA 2006 1 1976-01-01 male2007 1

Re: [R] Problem with Dynamo-Package

2009-04-06 Thread Dieter Menne
Mohammad Sabr yahoo.com> writes: > I am facing a problem when I am installing the dynamo-package and loading it. After I installed the package, > I received the following warning message: > "In file.create(f.tg) : > cannot create file 'C:\PROGRA~2\R\R-28~1.1/doc/html/packages.html', reason 'Perm

Re: [R] DierckxSpline fitting with different sets of y-values in one time

2009-04-06 Thread Jonckers Elisabeth
Dear, So What I'm looking at is the effect of age on the functional connectivity in a certain brain network. I have the ages of different subjects as x-values and values representing this functional connectivity with a region of intrest. This values are always for one voxel. But I found a whole

Re: [R] problem with svyglm()

2009-04-06 Thread Thomas Lumley
On Thu, 2 Apr 2009, Federico Calboli wrote: Hello, I'm trying to use the function svyglm in the library survey. I create a data survey object: data_svy<- svydesign(id=~PSU, strata=~sample_domain, weights=~sample_weight, data=data, nest=TRUE) and I try to use svyglm() with little success: R<

[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

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

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

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

[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

[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

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

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

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

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

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

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

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

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

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

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

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

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,

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

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

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

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

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

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

[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

  1   2   >