Re: [R] Plot and Boxplot in the same graph

2009-03-20 Thread Paul Johnson
On Fri, Mar 20, 2009 at 10:02 PM, johnhj wrote: > > Hii, > > Is it possible, to use the plot() funktion and the boxplot() funktion > together ? > I will plot a simple graph and additionally to the graph on certain places > boxplots. I have imagined to plot the graph a little bit transparency and >

Re: [R] Goodness of fit for negative binomial model

2009-03-20 Thread Paul Johnson
On Fri, Mar 20, 2009 at 8:03 PM, t c wrote: > Dear r list, > > I am using glm.nb in the MASS package to fit negative binomial models to data > on manta ray abundance, and AICctab in the bbmle package to compare model > IC.  However, I need to test for the goodness of fit of the full model, and

Re: [R] Creating dataframe names on the fly?

2009-03-20 Thread Paul Johnson
On Fri, Mar 20, 2009 at 7:18 PM, science! wrote: > > I am aware that it is easily possible to create var names on the fly. e.g. > assign(paste("m",i,sep=""),j) > but is it possible to assign dataframes to variables created on the fly? > > e.g. > If I have a dataframe called master and I wanted to

[R] R: Multi-line texts in plots

2009-03-20 Thread mauede
Now that I have my list of flags with theri respective values (thanks to all those who posted their suggestions): Flags Values 1 TrendOff 0 2 MOdwt 1 3ZeroPadding 1 4 Step1HSOff 1 5 Step1NumHSOff 4 6 Step1NumHSOff 1 7Step1ExtOff 1

Re: [R] A category reduction problem

2009-03-20 Thread Kathy Gerber
Many thanks to Bill and Thomas for both insight and this nice solution. Kathy Gerber William Dunlap wrote: If you diff the desired series you get all 2^n possible n-long sequences of 0's and 1's. Hence another solution is to convert the numbers in 0:(2^n-1) to their binary representations, put

[R] Creating dataframe names on the fly?

2009-03-20 Thread science!
I am aware that it is easily possible to create var names on the fly. e.g. assign(paste("m",i,sep=""),j) but is it possible to assign dataframes to variables created on the fly? e.g. If I have a dataframe called master and I wanted to subset parts of those data into separate dataframes, I could

[R] Plot and Boxplot in the same graph

2009-03-20 Thread johnhj
Hii, Is it possible, to use the plot() funktion and the boxplot() funktion together ? I will plot a simple graph and additionally to the graph on certain places boxplots. I have imagined to plot the graph a little bit transparency and show in the same graph on certain places boxplots Is it p

Re: [R] Calling R from Java (trying the R interface to Omegahat and Java)

2009-03-20 Thread Michael Kubovy
Thanks for the tip. I'll start with rJava, and see if that easier approach works. On Mar 20, 2009, at 10:50 PM, Martin Morgan wrote: Michael Kubovy writes: Dear R-helpers, I run R version 2.8.1 (2008-12-22) on i386-apple-darwin8.11.1 I would like to call R from Java. I downloaded SJava_0

Re: [R] Calling R from Java (trying the R interface to Omegahat and Java)

2009-03-20 Thread Martin Morgan
Michael Kubovy writes: > Dear R-helpers, > > I run R version 2.8.1 (2008-12-22) on i386-apple-darwin8.11.1 > > I would like to call R from Java. I downloaded SJava_0.69-0.tar.gz, > and then issued the command suggested on http://www.omegahat.org/ > RSJava/ : Others will point you to rJava

[R] Calling R from Java (trying the R interface to Omegahat and Java)

2009-03-20 Thread Michael Kubovy
Dear R-helpers, I run R version 2.8.1 (2008-12-22) on i386-apple-darwin8.11.1 I would like to call R from Java. I downloaded SJava_0.69-0.tar.gz, and then issued the command suggested on http://www.omegahat.org/ RSJava/ : % R INSTALL -c SJava_0.69-0.tar.gz ARGUMENT 'INSTALL' __ignored__ WARNI

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
Aha, I get it now. I was under the mistaken, intuitive impression that the subset condition was evaluated element-by-element... I guess it must actually work out to a vector of booleans, each element of which gets compared to the corresponding element of the data to be subsetted. That is, in hindsi

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread David Winsemius
If you use Jim's example and use grep() with ordinary and and then negative indexing, you get these results: > x[grep("her", x$input),] input output corpusFreq pvolOT pvolRatioOT 2 donate(her,thebook) P 48.7 68928 0.1899471 6give(her,it) P 100.0 1

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread jim holtman
grep and regexpr return different values. regexpr returns a vector of the same length as the input and this can be used to construct a logical subscript. grep return a vector of only the matches, in which case you can have a length of zero if there are no matches. Makes it harder to create the s

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
Thanks, Jim (and Mark, who replied off-list) -- that does the trick. I had tried using an index expression with grep, but that failed in the same way as the subset method. It is still rather mysterious why this works with regexpr but not with grep :) -Max On Fri, Mar 20, 2009 at 7:57 PM, jim holt

[R] Goodness of fit for negative binomial model

2009-03-20 Thread t c
Dear r list,   I am using glm.nb in the MASS package to fit negative binomial models to data on manta ray abundance, and AICctab in the bbmle package to compare model IC.  However, I need to test for the goodness of fit of the full model, and have not been able to find a Pearson's Chi Squared st

Re: [R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread jim holtman
Try using regexpr instead: > x <- read.table(textConnection("input output corpusFreq pvolOT pvolRatioOT + give(mysister,theoldbook) P 47.0 56016 0.1543651 + donate(her,thebook) P 48.7 68928 0.1899471 + give(mysister,thebook) P 73.4 80136 0.2208333 + donate

Re: [R] Difference between gam() and loess().

2009-03-20 Thread Kevin E. Thorpe
Kevin E. Thorpe wrote: Ravi Varadhan wrote: Good try, Kevin. But that doesn't seem to do it. set.seed(123) x <- sort(runif(100)) y <- sin(4*pi*x) + rnorm(100, sd=0.2) ans.lo2 <- loess(y ~ x, degree=2, span=0.75) ans.gam2 <- gam(y ~ lo(x, degree=2, span=0.75)) summary(ans.lo2$fitted - ans.g

Re: [R] Difference between gam() and loess().

2009-03-20 Thread Kevin E. Thorpe
Ravi Varadhan wrote: Good try, Kevin. But that doesn't seem to do it. set.seed(123) x <- sort(runif(100)) y <- sin(4*pi*x) + rnorm(100, sd=0.2) ans.lo2 <- loess(y ~ x, degree=2, span=0.75) ans.gam2 <- gam(y ~ lo(x, degree=2, span=0.75)) summary(ans.lo2$fitted - ans.gam2$fitted) # larger d

[R] Subsetting data where the condition is that the value of some column contains some substring

2009-03-20 Thread Max Bane
I have some data that looks like this: > dataP input output corpusFreq pvolOT pvolRatioOT 1 give(my sister, the old book) P 47.0 56016 0.1543651 5 donate(her, the book) P 48.7 68928 0.1899471 9 give(my sister

Re: [R] Bug with the col option in plot function

2009-03-20 Thread David Winsemius
Really belongs o R-SIG-Mac list and have copied it there. I cannot reproduce on my Mac. I get the same colors on the pdf file with that code as I do on the screen device. I have in in the past needed to set up a device before plotting: trellis.device(device="postscript", color = TRUE) ... bu

[R] How to disable prompting for Return key before starting a new page of output when using rlarg.diag(z1)

2009-03-20 Thread Michelle Irizarry
Hi! I am calling ismev rlarg.diag() multiple times inside a "for loop" in a script I've written. I don't want to have to hit the Return key many times, so I am using the following command at the top of my script so I am not prompted to press for the Return key. options(device.ask.default=FALSE) T

[R] Bug with the col option in plot function

2009-03-20 Thread heyi xiao
I lose control on colors when I plot points with pch=1 or 16 (empty or solid circle) or any letter, say "A". For example:   x=runif(5) y=runif(5) pdf("plot.pdf") plot(x, y, type='p', pch=1, col = 1:5) #just black points plot(x, y, type='p', pch=0, col = 1:5) #points with different colors

[R] Bug with the col option in plot function

2009-03-20 Thread heyi xiao
I lose control on colors when I plot points with pch=1 or 16 (empty or solid circle) or any letter, say "A". For example:   x=runif(5) y=runif(5) pdf("plot.pdf") plot(x, y, type='p', pch=1, col = 1:5) #just black points plot(x, y, type='p', pch=0, col = 1:5) #points with different colors

[R] Is this sample size big enough to test for statistical significance?

2009-03-20 Thread J S
Dear R community, Is this sample size large enough to study differences between two groups of the populations? Q1: do the body temperatures differ between the two groups of the overwintering turtles juveniles and adults? One group (adults) has 6 turtles Second group (juveniles) has 1 tu

[R] any package for connecting berkeley db in R?

2009-03-20 Thread Zheng, Xin (NIH) [C]
Hi there, Is there any such package? I searched but found none. Thanks in advance. Xin Zheng [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] ANOVA and TukeyHSD disagrees?

2009-03-20 Thread Rolf Turner
On 21/03/2009, at 12:50 AM, Fredrik Karlsson wrote: Dear list, Sorry for posting a borderline statistical question on the list, but hte SPSS people around me just stares at me blankly when refering to tests with any term other than ANOVA and post-hoc. I would appreciate any insight on h

[R] Redefining [ using next method

2009-03-20 Thread Christophe Genolini
Hi all, I would like to use an object and to add some definition to the [ function, but I do not manage... My objet is a "trajectories", a matrix whose columne name does contain information : - trajectories <- function(traj,varName,time){ colnames(traj) <- paste(varName,time,sep="")

Re: [R] Pruning trees in a Random Forest

2009-03-20 Thread Wensui Liu
I don't think it necessary to prune trees in RF, per brieman's paper. On 3/20/09, Liaw, Andy wrote: > The way the trees are structured in randomForest, there's no way to stop > tree growth by depth (what you called level). > > (If anyone has ideas, I'm all ears.) > > Andy > > From: Anirudh Kondav

Re: [R] plotting two variables with a third used for color

2009-03-20 Thread David Winsemius
On Mar 20, 2009, at 3:55 PM, Altaweel, Mark R. wrote: I have a problem where I have two columns of data that I can simply plot using: plot(wV[0:15,3],wY[0:15,3]). Perhaps: plot(wV[0:15,3],wY[0:15,3], col = ifelse(wY[0:15,3]>0, "blue","red") ) This produces my desired plot. Now, say I ha

[R] plotting two variables with a third used for color

2009-03-20 Thread Altaweel, Mark R.
I have a problem where I have two columns of data that I can simply plot using: plot(wV[0:15,3],wY[0:15,3]). This produces my desired plot. Now, say I have a third variable that I would like to introduce and use that variable to set different colors in the plot In this case, say I wanted val

Re: [R] Extract Time in POSIXct

2009-03-20 Thread jim holtman
Do you only want the HH:MM:SS of the data? What are you going to do with it? You can 'extract' it with format(hora, "%H%:%M:%S") If you don't want the date and are only working with the hours in a single day, then convert the time to a numeric value of hours (or minutes), whichever is appropria

[R] fisher.test - FEXACT error 7

2009-03-20 Thread Helena Mouriño
Dear all, I’m having an awkward problem in R. When I write the command Fisher.test(school.data,workspace=2e+07), where school.data is the matrix corresponding to the data set, I get the error message: FEXACT error 7. LDSTP is too small for this problem. Try increasing the size o

Re: [R] Pruning trees in a Random Forest

2009-03-20 Thread Liaw, Andy
The way the trees are structured in randomForest, there's no way to stop tree growth by depth (what you called level). (If anyone has ideas, I'm all ears.) Andy From: Anirudh Kondaveeti > > Hi all! > > The randomForest in R enables us to prune the trees using the nodesize > feature where we c

Re: [R] How to use termstrc functions?

2009-03-20 Thread David Winsemius
There is probably a greater density of potential users on the SIG- Finance mailing list. I still think you attribute special powers to that function that the authors never build into it. It does not predict the future. It doesn't even simulate the future. It just reformats into a matrix the

[R] RSPerl ?

2009-03-20 Thread T M
We were hoping to use RSPerl to interface various R scripts we have to a Perl-based web interface. I have been able to get some simple code working; however, I can't seem to return a dataframe from R to Perl, and I can't seem to determine from the documentation whether this is possible or not. I

[R] Pruning trees in a Random Forest

2009-03-20 Thread Anirudh Kondaveeti
Hi all! The randomForest in R enables us to prune the trees using the nodesize feature where we can stop splitting a node if it contains less than the specified no.of of records/entities at that node. However is there a way to stop the tree growing after a specified number of levels. To be more c

Re: [R] struggling with pairlists

2009-03-20 Thread Wacek Kusnierczyk
mau...@alice.it wrote: > I would like to create a vector of pairlist (flag, binary_value) like: > > (variable ="TrendOff", value = 0) > (variable ="MOdwt",value = 1) > (variable ? "ZeroPadding", value =1) > > > I tried the followin

Re: [R] randomForest

2009-03-20 Thread Anirudh Kondaveeti
Thanks a lot. That should help! Anirudh Kondaveeti 2009/3/20 Uwe Ligges > > > Uwe Ligges wrote: > >> >> >> Anirudh Kondaveeti wrote: >> >>> To be more clear, >>> >>> My data set contains two classes.. Class 1 and Class 2 >>> Class 1 has original data with 300 rows

Re: [R] randomForest

2009-03-20 Thread Uwe Ligges
Uwe Ligges wrote: Anirudh Kondaveeti wrote: To be more clear, My data set contains two classes.. Class 1 and Class 2 Class 1 has original data with 300 rows Class 2 is randomly generated data with 1500 rows. I want to sample a new data set with Class 1 - all the rows Class 2 - only 300 row

Re: [R] randomForest

2009-03-20 Thread Uwe Ligges
Anirudh Kondaveeti wrote: To be more clear, My data set contains two classes.. Class 1 and Class 2 Class 1 has original data with 300 rows Class 2 is randomly generated data with 1500 rows. I want to sample a new data set with Class 1 - all the rows Class 2 - only 300 rows out of 1500 rows a

Re: [R] randomForest

2009-03-20 Thread Liaw, Andy
Uwe had been right all along. I don't understand what you don't understand from the documentation. You can use sampsize=c(300, 300) and replace=FALSE to make sure that all 300 class 1 rows are used, but be warned that that leaves no rows for OOB estimate. Andy From: Anirudh Kondaveeti > > To

Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Max Kuhn
> I was including the settings in my document, but I also tried setting it > from the command line. This resulted in more of a change, but only in that > the ttBlue now being defined as black rather than blue. So, some effect, but > not all the way. You will have to define the styles before callin

Re: [R] How to use termstrc functions?

2009-03-20 Thread Chirantan Kundu
Actually I was looking for someone who has some experience in using the package. Anyway, thanks for your input. On Fri, Mar 20, 2009 at 10:51 PM, David Winsemius wrote: > How could I (or anyone for that matter) possibly answer that question? > > David Winsemius, MD > Heritage Laboratories > West

Re: [R] randomForest

2009-03-20 Thread Anirudh Kondaveeti
To be more clear, My data set contains two classes.. Class 1 and Class 2 Class 1 has original data with 300 rows Class 2 is randomly generated data with 1500 rows. I want to sample a new data set with Class 1 - all the rows Class 2 - only 300 rows out of 1500 rows and then use it in random fores

Re: [R] randomForest

2009-03-20 Thread Uwe Ligges
Anirudh Kondaveeti wrote: sampsize uses the same sample for all the trees in the random Forest. No. Uwe Ligges But I want to use different sample for each tree of the 500 trees in the random Forest. Thanks! Anirudh Kondaveeti 2009/3/20 Uwe Ligges Ani

Re: [R] randomForest

2009-03-20 Thread Anirudh Kondaveeti
sampsize uses the same sample for all the trees in the random Forest. But I want to use different sample for each tree of the 500 trees in the random Forest. Thanks! Anirudh Kondaveeti 2009/3/20 Uwe Ligges > > > Anirudh Kondaveeti wrote: > >> Hi! >> >> I am deali

Re: [R] Help with functions within a list

2009-03-20 Thread baptiste auguie
Agreed --- if you provided a working example it might be as simple as, library(reshape) recast(res, Id~Tick, fun="mean", id.var=c("Id", "Tick"), measure.var="X") which i had to test with this, res <- list(read.table(textConnection( "IdX Tick 1 2.2 1 2 3.1 1 1

Re: [R] Help with functions within a list

2009-03-20 Thread David Winsemius
I say again: Build a simple example; -- David Winsemius On Mar 20, 2009, at 1:00 PM, Altaweel, Mark R. wrote: I will try to be clearer with what I wanted. What I am trying to do is take a list, say defined as res, that has a size of 1000 For example: res[[1]] re

Re: [R] how can I find actual axis limits for an existing plot?

2009-03-20 Thread Eik Vettorazzi
Hi, see ?par You are probably interested in par("usr") Mark Borowsky schrieb: I would like to query an existing plot to learn the actual x and y limits of the plottable area. Is this possible? I can discover the extreme tick mark locations but not the actual plot area limits. Setting the

Re: [R] How to use termstrc functions?

2009-03-20 Thread David Winsemius
How could I (or anyone for that matter) possibly answer that question? David Winsemius, MD Heritage Laboratories West Hartford, CT On Mar 20, 2009, at 1:07 PM, Chirantan Kundu wrote: Thanks for the help. RATING & NAME are not required for this call as par documentation. About the CASHFLOWS I'

Re: [R] A category reduction problem

2009-03-20 Thread Thomas Lumley
I'd do this with recursion, I think * A valid (n+1) number sequence is a valid n-number sequence followed either by the last number of the sequence or the last number plus one. * A valid 1-number sequence is 0 -thomas On Fri, 20 Mar 2009, Kathy Gerber wrote: I am trying to print out

Re: [R] How to use termstrc functions?

2009-03-20 Thread Chirantan Kundu
Thanks for the help. RATING & NAME are not required for this call as par documentation. About the CASHFLOWS I'm not sure as I'm going to call create_cashflows_matrix which is supposed to return me the cashflow matrix. Do I still need to have the CASHFLOWSlist in the structure? On Fri, Mar 20, 2009

[R] Help with functions within a list

2009-03-20 Thread Altaweel, Mark R.
I will try to be clearer with what I wanted. What I am trying to do is take a list, say defined as res, that has a size of 1000 For example: res[[1]] res[[2]] .until res[[1000]] -- IdX Tick

[R] Extract Time in POSIXct

2009-03-20 Thread Paulo E. Cardoso
Assunto: Extract Time in POSIXct I have a dataframe with a column [hora] with this format: hora: POSIXct, format: "1899-12-30 14:30:00" It was obtained reading a access2007 database table. Can I extract the time from each entry, keeping the POSIXct format? Paulo E. Cardoso

Re: [R] Package HDF5

2009-03-20 Thread Dani
Hi Thomas, Thanks for responding. You are right about bioconductor, however their solution was to implement RHDF5 package for linux only, which allows selecting fields, but not ranges of the data. Any idea about ranges of data? My datafiles are as big as 20GB. thx, Dani On Fri, Mar 20, 2009 at 1

[R] A category reduction problem

2009-03-20 Thread Kathy Gerber
I am trying to print out a list of strings of length 11 based on integers 0 through 10. The rules as given to me for the ordering are: The first digit must be 0. The 2nd digit must be 0 or 1. The 3rd digit must equal the 2nd digit or the 2nd digit +1. ... Given the final digit, n, all digits 0 t

[R] how can I find actual axis limits for an existing plot?

2009-03-20 Thread Mark Borowsky
I would like to query an existing plot to learn the actual x and y limits of the plottable area. Is this possible? I can discover the extreme tick mark locations but not the actual plot area limits. Setting the limits with ylim will not help in this case because I am overplotting an existing

Re: [R] struggling with pairlists

2009-03-20 Thread jim holtman
It was not clear what you were asking for. Did you want a 'list' of 'lists' pairs? What are you going to use the data for? How are you expecting to access it? This will create a list similar to: z <- list(list(variable="TrendOff", value=0), list(... > flags_val <- c( 0,1,1,1,4,1,1,1,4,1,

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-20 Thread Gene Leynes
I have found the gdata library quite helpful: library(gdata) ll() ll(dimensions=TRUE) [[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:/

Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Fredrik Karlsson
Dear Max, I was including the settings in my document, but I also tried setting it from the command line. This resulted in more of a change, but only in that the ttBlue now being defined as black rather than blue. So, some effect, but not all the way. Here is the session info: > sessionInfo() R

Re: [R] How to use termstrc functions?

2009-03-20 Thread David Winsemius
Besides needing a grouped structure and not calling that function with a group name, your sub-structure does not seem complete when compared with the AAA group within the example dataset; > str(allbonds) # your structure List of 1 $ mybonds:List of 7 ..$ ISIN: chr [1:2] "IN0020080

[R] struggling with pairlists

2009-03-20 Thread mauede
I would like to create a vector of pairlist (flag, binary_value) like: (variable ="TrendOff", value = 0) (variable ="MOdwt",value = 1) (variable ? "ZeroPadding", value =1) I tried the following syntax but the emcompassing list (t

Re: [R] reshape dataframe

2009-03-20 Thread jim holtman
Does this do what you want: > x<-data.frame(id=c(1,2,3), snp1=c("AA","GG", + "AG"),snp2=c("GG","AG","GG"),snp3=c("GG","AG","AA")) > do.call(rbind, apply(x, 1, function(.row){ + data.frame(c(.row[1], .row[1]), +strsplit(.row[2], ''), +strsplit(.row[3], ''), +

Re: [R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Max Kuhn
Did you do this within the document, or prior to running odfWeave? Also, please provide the output of sessionInfo() after starting odfWeave. Max On Fri, Mar 20, 2009 at 11:03 AM, Fredrik Karlsson wrote: > Dear list, > > The output of my embedded code sections come out in the style "ttBlue" wich

Re: [R] How to use termstrc functions?

2009-03-20 Thread David Winsemius
On Mar 20, 2009, at 10:15 AM, Chirantan Kundu wrote: Here it goes - library(termstrc) ISIN <- vector() ISIN[1]<-"IN0020080019" ISIN[2]<-"IN0020020163" MATURITYDATE<-as.Date(c("20081231","20101231"),"%Y%m%d") STARTDATE<-as.Date(c("20010101","20020101"),format="%Y%m%d") COUPONRATE<-c(8.24,7.95)

Re: [R] randomForest

2009-03-20 Thread Uwe Ligges
Anirudh Kondaveeti wrote: Hi! I am dealing with random forest using R. Is there a way to sample a fixed no.of rows from a dataset for use with different trees in random Forest. To be more clear, my data set contains 1500 rows, and I am growing 500 trees in Random Forest Is it possible to samp

[R] odfWeave : change of text style of output is ignored

2009-03-20 Thread Fredrik Karlsson
Dear list, The output of my embedded code sections come out in the style "ttBlue" wich is Times New Roman and Blue when I open document. I would like to change this to a fixed witdth font, smaller and less blue by using style definitions in the document, but it really does not affect the output.

Re: [R] Dickey Fuller test of a time series (problem)

2009-03-20 Thread Wolfgang Koller
The argument 'x' of adf.test should not only be a vector but also a numeric vector (see ?adf.test). Have a closer look at your data and how they are stored. What does is.numeric(x) give? I guess that originally your data are stored as a data frame. Converting a data.frame to a vector is not d

[R] installing and loading packages

2009-03-20 Thread Maria I. Tchalakova
Hello, is it possible to make so that once I have installed and loaded the necessary packages in R, I don't need to install and load them for a new session in R? Up to now I install packages, for example, like this: install.packages("package_name") and then load them like this: library("package

Re: [R] Finding determinants of x-loaded matrix?

2009-03-20 Thread Richard M. Heiberger
This is an eigenvalue problem with 0 on the main diagonal. It is almost always inefficient to find the determinant as an intermediate step. The original poster is looking for the ngative of the eigenvalues of the matrix with the x replaced by zeros. > tmp <- matrix(c(0,1,0,0,1,0,1,0,0,1,0,1,0,0,1

[R] FW: reshape dataframe

2009-03-20 Thread Duijvesteijn, Naomi
Hi, I have a large dataset on which I would like to do the following: x<-data.frame(id=c(1,2,3), snp1=c("AA","GG", "AG"),snp2=c("GG","AG","GG"),snp3=c("GG","AG","AA")) > x id snp1 snp2 snp3 1 1 AA GG GG 2 2 GG AG AG 3 3 AG GG AA And

Re: [R] ggplot2: specifying legend titles

2009-03-20 Thread hadley wickham
On Fri, Mar 20, 2009 at 9:07 AM, Etches Jacob wrote: > I am trying to specify a legend title to be other than the variable name, > but I find that the legend splits because scale_shape() takes effect but > scale_colour() does not.  Can someone spot my error?  Here's some toy code > that produces t

[R] reshape dataframe

2009-03-20 Thread Duijvesteijn, Naomi
Hi, I have a large dataset on which I would like to do the following: x<-data.frame(id=c(1,2,3), snp1=c("AA","GG", "AG"),snp2=c("GG","AG","GG"),snp3=c("GG","AG","AA")) > x id snp1 snp2 snp3 1 1 AA GG GG 2 2 GG AG AG 3 3 AG GG AA And

[R] ggplot2: specifying legend titles

2009-03-20 Thread Etches Jacob
I am trying to specify a legend title to be other than the variable name, but I find that the legend splits because scale_shape() takes effect but scale_colour() does not. Can someone spot my error? Here's some toy code that produces the problem on my system (R2.8.1, windows, today's CRAN

Re: [R] Difference between gam() and loess().

2009-03-20 Thread Ravi Varadhan
Good try, Kevin. But that doesn't seem to do it. set.seed(123) x <- sort(runif(100)) y <- sin(4*pi*x) + rnorm(100, sd=0.2) ans.lo2 <- loess(y ~ x, degree=2, span=0.75) ans.gam2 <- gam(y ~ lo(x, degree=2, span=0.75)) summary(ans.lo2$fitted - ans.gam2$fitted) # larger differences, about 10%

Re: [R] How to use termstrc functions?

2009-03-20 Thread Chirantan Kundu
Here it goes - library(termstrc) ISIN <- vector() ISIN[1]<-"IN0020080019" ISIN[2]<-"IN0020020163" MATURITYDATE<-as.Date(c("20081231","20101231"),"%Y%m%d") STARTDATE<-as.Date(c("20010101","20020101"),format="%Y%m%d") COUPONRATE<-c(8.24,7.95) PRICE<-(50,100) ACCRUED<-c(5,2) TODAY<-c(Sys.Date(),Sys.D

Re: [R] R on netbooks et al?

2009-03-20 Thread Paul Norris
Dear Dirk, As a Ubuntu newbie I was going by the information on the following couple of webpages which talk about the need to turn the i386 binaries into binaries for lpia architecture: http://mydellmini.com/forum/i386-packages-on-lpia--t3540s75.html http://ubuntuforums.org/showthread.php?p=6

Re: [R] Finding determinants of x-loaded matrix?

2009-03-20 Thread David Winsemius
On Mar 20, 2009, at 9:09 AM, Bob Gotwals wrote: I need to find the determinant of this matrix x 1 0 0 1 x 1 0 0 1 x 1 0 0 1 x det yields x^4-3x^2+1 I can then use polyroot to find the roots of the coefficients. The question is about the use of "x", which is what I'm solving for. If you ar

[R] lmer

2009-03-20 Thread Anne Kempel
Sorry for bothering you - but I have a little problem. I`m completely new in R and trying to use lmer. That works, but I m not sure if my code is right, so I would just like to get an opinion from the experts. I have a Growthrate of plants (RGR Fixed Factors: Fertilizer, Status (alien or native

Re: [R] R on netbooks et al?

2009-03-20 Thread Paul Norris
Hi, Just to add to this thread (with my first ever R list post). I got a Dell Mini 9 (I think it is called the Inspirion 910 in the US?) yesterday running Ubuntu with 2GB and a 32 GB SSD. While the machine came with Ubuntu 8.04 LTS it is a version which has been compiled by Dell to suit the

Re: [R] How to use termstrc functions?

2009-03-20 Thread David Winsemius
Got code? On Mar 20, 2009, at 8:15 AM, Chirantan Kundu wrote: I'm trying to use the package termstrc. However I cannot figure out how to invoke helper functions like create_cashflows_matrix & create_maturities_matrix. Even when I try to invoke those with the data supplied with the package (say,

Re: [R] Statistical Tests

2009-03-20 Thread Christos Hatzis
The following site is your friend: http://www.rseek.org/ -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > meenu.s...@ingim.com > Sent: Friday, March 20, 2009 5:47 AM > To: r-help@r-project.org > Subject: [R] Sta

[R] Statistical Tests

2009-03-20 Thread Meenu.Sahi
Dear Members Is there an R code for the following statistical tests ? 1. marquering_verbeek 2.HenrikssonMerton 3.cumby&modest Regards Meenu - ATTENTION: The information in this electronic mail message is priva...{{dropped:18}}

Re: [R] Import R-output into Java

2009-03-20 Thread Maxl18
Thanks, now it works! Max Romain Francois-2 wrote: > > Ooops, I meant this : > > con.voidEval("sink('test.txt')"); > con.voidEval("cat(1+1)"); > con.voidEval("sink()"); > > Romain Francois wrote: >> Hi, >> >> try this instead: >> >> con.voidEval("sink(test.txt)"); >> con.voidEval("cat(1+1)"

[R] R: Multi-line texts in plots

2009-03-20 Thread mauede
Thank you. I will try the approacch you suggested. Here is the list of 20 flags whose concurrent values values select the program branch. "TRUE" / "FALSE" can be replaced by 1 / 0 All the seperating lines "$$" and "..." and comments (in capital letters) can be removed (this is a print-out). Just

[R] How to use termstrc functions?

2009-03-20 Thread Chirantan Kundu
Hi, I'm trying to use the package termstrc. However I cannot figure out how to invoke helper functions like create_cashflows_matrix & create_maturities_matrix. Even when I try to invoke those with the data supplied with the package (say, corpbonds), it throws error saying "Error in as.vector(x, mo

[R] Finding determinants of x-loaded matrix?

2009-03-20 Thread Bob Gotwals
R friends, I need to find the determinant of this matrix x 1 0 0 1 x 1 0 0 1 x 1 0 0 1 x det yields x^4-3x^2+1 I can then use polyroot to find the roots of the coefficients. The question is about the use of "x", which is what I'm solving for. thanks in advance, and this is a back-burner ques

Re: [R] Plot contour inside a polygon

2009-03-20 Thread Duncan Murdoch
On 3/20/2009 8:40 AM, Irina Foss wrote: Dear, I am trying to plot contours (with filled.contour function) inside UK area, so that no contours are plotted over the sea. I was wondering if anyone can help me with this task and if I can get any suggestions how to do that. If you have a grid of

[R] Plot contour inside a polygon

2009-03-20 Thread Irina Foss
Dear, I am trying to plot contours (with filled.contour function) inside UK area, so that no contours are plotted over the sea. I was wondering if anyone can help me with this task and if I can get any suggestions how to do that. Thank you, Irina Irina Foss Environmental Research Institute N

Re: [R] Multi-line texts in plots

2009-03-20 Thread baptiste auguie
Hi, it would help if you provided a minimal example. Here is one approach I often use with the plotting package ggplot2, parameters <- expand.grid(m=c(0, 1), s=seq(0.1, 1,length=10)) x <- seq(-5, 5, length=300) foo <- function(m, s){ data.frame(x=x, y=dnorm(x, m, s), m=factor(m), s=fa

Re: [R] print of objects in R

2009-03-20 Thread Paul Hiemstra
Hi Mary, To print without [1,] use cat() instead of print(). To get rid of the row names when printing a data.frame use: print(data.frame, row.names = FALSE) To get nice Latex tables, you can use xtable (as the other reply suggested). If you want to include it in Word, you can export your da

[R] ANOVA and TukeyHSD disagrees?

2009-03-20 Thread Fredrik Karlsson
Dear list, Sorry for posting a borderline statistical question on the list, but hte SPSS people around me just stares at me blankly when refering to tests with any term other than ANOVA and post-hoc. I would appreciate any insight on how this all is possible: I have a model fitted by aov() stored

Re: [R] Mean-replacing NAs in a 3d array

2009-03-20 Thread Eik Vettorazzi
Hi Tom, it would have been nice (and it is in fact requested by the posting guide) to give a running example instead of letting us construct your data. Anyway, it wasn't too hard with Xa<-array(1:12,dim=c(2,2,3)) Xa[c(2,6,8)]<-NA #so next, create a vector for the colMeans with length 2*2*3, rep

[R] Multi-line texts in plots

2009-03-20 Thread mauede
I am running a simulation many times changing one parameter each time and recording the outcome. I have to produce a plot to make a sense of the bunch of numbers I get from every run. My problem is to insert a multi-line text to keep track of which result correspond to which parameter values. A

[R] convert point coordinates UTM to WSG

2009-03-20 Thread Marc Marí Dell'Olmo
Dear R-users, Can anyone tell me how to convert point coordinates from WSG84 (google maps coordinates) format to UTM HUSO-31 ED-50. And if I have a map (shp format) with UTM HUSO-31 ED-50 coordinates, how can I convert to WSG84 (google maps coordinates) coordinates. Should I install some external

Re: [R] function question

2009-03-20 Thread Wacek Kusnierczyk
of course! as some might suggest, i should have used times new sarcastic ;) vQ PS beware of vector(vector) and function(function) Bert Gunter wrote: > Not surprising at all -- expected! > > is.function(vector) ##TRUE > > -- Bert > > -Original Message- > From: Wacek Kusnie

Re: [R] Using predict on a biglm object returns NA

2009-03-20 Thread Thomas Lumley
On Fri, 20 Mar 2009, Pradheep K E wrote: When I run predict on the model output on a new data (for testing) or on the same data, I get only NA's. I'm able to run predict with some other models constructed with biglm. One reason I suspect is that the model itself has a few undefined terms (NA's).

[R] Accuracy of R and other platforms

2009-03-20 Thread Alejandro C. Frery
Hi, The paper @ARTICLE{AlmironSilvaMM:2009, author = {Almiron, M. and Almeida, E. S. and Miranda, M.}, title = {The Reliability of Statistical Functions in Four Software Packages Freely used in Numerical Computation}, journal = {Brazilian Journal of Probability and Statistics}, ye

Re: [R] Extreme AIC or BIC values in glm(), logistic regression

2009-03-20 Thread Maggie Wang
Dear Gavin, Gad and all, Thank you very much for the reply! Indeed my problem resembles Gavin's previously encountered one, and the suggested method of package brglm() and profilemodel() seems solve the problem right on target. Right now I get stabilized AIC and realistic prediction, I'll check

Re: [R] classes and methods

2009-03-20 Thread Wacek Kusnierczyk
mtmor...@fhcrc.org wrote: >> setClass("foo",representation(x="numeric")) > > This creates an *S4* class which HAS A 'slot' x that is of type numeric. > >>> setMethod("plot","foo",function(x,y,...)boxplot(x,...)) >>> x <- rnorm(100) >>> class(x) <- "foo" > > uh oh, this is creating an *S3* class tha

  1   2   >