[R] iterative methods in R

2011-04-11 Thread rvohen
does some know iterative methods in R ? thank you! -- View this message in context: http://r.789695.n4.nabble.com/iterative-methods-in-R-tp3443837p3443837.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

[R] Optimzing a nested function

2011-04-11 Thread vioravis
I am trying to optimize a nested function using nlminb. This throws out an error that y is missing. Can someone help me with the correct syntax?? Thank you. test1 <- function(x,y) { sum <- x + y return(sum) } test2 <- function(x,y) { sum <- test1(x,y) sumSq <- sum*sum return(sumSq) } n

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-11 Thread Deepayan Sarkar
On Mon, Apr 11, 2011 at 12:49 AM, Jeff Stevens wrote: > Many thanks, Peter.  This works brilliantly, and I prefer to have the > labels assigned outside of panel function as well. You could also consider using which.packet(). You haven't explicitly told us how the labels are matched with the boxpl

Re: [R] Regression model with proportional dependent variable

2011-04-11 Thread Achim Zeileis
On Mon, 11 Apr 2011, ty ty wrote: Hello, dear experts. I don't have much experience in building regression models, so sorry if this is too simple and not very interesting question. Currently I'm working on the model that have to predict proportion of the debt returned by the debtor in some perio

Re: [R] regular expression question

2011-04-11 Thread Joshua Wiley
Hi Erin, Please read ?grep. It is clearly not the function you want (neither is strsplit() either really). This does what you want and you can modify for upper/lower case if you need it. Also note that regular expressions exist separate from R, so while ":" may have seemed natural to select a r

Re: [R] regular expression question

2011-04-11 Thread Peter Langfelder
On Mon, Apr 11, 2011 at 10:49 PM, Erin Hodgess wrote: > Dear R People: > > I have a data frame with the following column names: > >> names(funky) >  [1] "UHD.1"   "UHD.2"   "UHD.3"   "UHD.4"   "L..W..1" "L..W..2" "L..W..3" >  [8] "L..W..4" "B..W..1" "B..W..2" "B..W..3" "B..W..4" "W..B..1" "W..B..2

Re: [R] font Times New Roman and size 9 of labels of graphics

2011-04-11 Thread Prof Brian Ripley
On Mon, 11 Apr 2011, Fabiane Silva wrote: Hello, I wonder how to change the font of chart to Times New Roman and size 9. Attached is the graphic I need to make these changes Nothing was attached. In any case, please follow the posting guide and tell us your platform and graphics device and

[R] regular expression question

2011-04-11 Thread Erin Hodgess
Dear R People: I have a data frame with the following column names: > names(funky) [1] "UHD.1" "UHD.2" "UHD.3" "UHD.4" "L..W..1" "L..W..2" "L..W..3" [8] "L..W..4" "B..W..1" "B..W..2" "B..W..3" "B..W..4" "W..B..1" "W..B..2" [15] "W..B..3" "W..B..4" "B..G..1" "B..G..2" "B..G..3" "B..G..4"

Re: [R] Plotting a quadratic line on top of an xy scatterplot

2011-04-11 Thread jjap
Hi, Is it just me or it appears the "temperature" and "probability" should be reversed? Anyhow it should help you to assign your model to a variable (as Joshua did with his own suggestion) yourmodel <-lm(x[,2] ~ x[,1] + I(x[,1]^2)) # again, taking literally the way you formulated it...

[R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

2011-04-11 Thread Felix Nensa
Hi, I am using nls to fit a non linear function to some data but R keeps giving me "singular gradient matrix at initial parameter estimates" errors. For testing purposes I am doing this: ### R code ### x <- 0:140 y <- 200 / (1 + exp(17 - x)/2) * exp(-0.02*x) # creating 'perfect' samples with fit

[R] joining data based upon a moving time window?

2011-04-11 Thread Kerry
I have weather data that was recorded every hour, and location data (X,Y) that was recorded every 4 hours. I want to know what the temperature was at location X,Y. The weather data isn't exactly at the same time. So, I have written this loop for every location to scan through the weather

[R] plot - kamada.kawai layout without arrows

2011-04-11 Thread kparamas
Hi, I am plotting a graph with kamada.kawai layout. But I am getting direction arrows in the graphs. Please let me know how to avoid this. g <- watts.strogatz.game(1, 2000, 5, 0.4) comps <- clusters(g)$membership colbar <- rainbow(max(comps)+1) V(g)$color <- colbar[comps+1] png(filename) p

[R] font Times New Roman and size 9 of labels of graphics

2011-04-11 Thread Fabiane Silva
Hello, I wonder how to change the font of chart to Times New Roman and size 9. Attached is the graphic I need to make these changes Thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

[R] Is there some command or alternative using dist.dna in ape package for models not included like GTR?

2011-04-11 Thread Ignacio Quintero
Hi, I am making some DNA distances and I would like to use dist.dna as matrix in R, but this command does not include models like GTR... Is there some command or alternative using dist.dna in ape package for models not included like GTR? I would appreciate any help given Thank you very much, Igna

Re: [R] read in summarised data as table()

2011-04-11 Thread dirknbr
Ok it looks like this x yz a 12 12 34 b 34 34 35 c 56 78 0 where the numbers are counts of cases I can read it in, but how do I tell R it's a table? Dirk -- View this message in context: http://r.789695.n4.nabble.com/read-in-summarised-data-as-table-tp3442283p3443102.html Sent from t

[R] model specification: help needed

2011-04-11 Thread Ram H. Sharma
Hi R experts: I am new to mixed model commodity. I am tryping to specify a model using lmer in lme4 package. I am not sure if I am doing right, so I need your helpplease.. Treatment / factor structure Year: level 1:3, the whole the experiment was repeated in three years, random fact

Re: [R] bind mean to a df

2011-04-11 Thread baptiste auguie
Hi, You could try, library(plyr) ddply(data, .(name), transform, mean=mean(sale)) ddply(data, .(name), summarize, mean=mean(sale)) HTH, baptiste On 12 April 2011 15:46, Geoffrey Smith wrote: > Hello, I would like to take the mean of a column from a data frame and then > bind the mean back to

Re: [R] bind mean to a df

2011-04-11 Thread Joshua Wiley
Hi Geoffrey, Here is one option (data named dfrm instead of data because data() is a function too): ## Data dfrm <- data.frame( name = c('Frank','Frank','Frank','Tony','Tony','Tony','Ed','Ed','Ed'), year = c(2004,2005,2006,2004,2005,2006,2004,2005,2006), sale = c(56,45,55,65,68,70,45,67,23)

[R] bind mean to a df

2011-04-11 Thread Geoffrey Smith
Hello, I would like to take the mean of a column from a data frame and then bind the mean back to the data frame. I can do this using the following lines of code, but I am looking for a more elegant solution. Thank you very much. Geoff name <- c('Frank','Frank','Frank','Tony','Tony','Tony','Ed'

Re: [R] Meta-analysis of a correlation matrix

2011-04-11 Thread Mike Cheung
Dear luri, The metaSEM package (http://courses.nus.edu.sg/course/psycwlm/Internet/metaSEM/) may be used to fit structural equation models on the pooled correlation/covariance matrices with weighted least squares as the estimation method. You may refer to the examples in tssem1() and tssem2(). Reg

Re: [R] Plotting a quadratic line on top of an xy scatterplot

2011-04-11 Thread Joshua Wiley
Hi Josh, This is by no means the fanciest solution ever, but as there are predict methods for many types of models in R, I thought I would show it this way. ## fit the model model <- lm(probability ~ poly(temperature, 2), data = x) ## create line values dat <- data.frame(temperature = seq(min(x$

Re: [R] simple maths question

2011-04-11 Thread Ben Bolker
Georg Ehret gmail.com> writes: > > Hi Mrs & Ms "R", > A simple maths question that I am trying to resolve with R: I need to > calculate the SE from a pvalue and it's beta... How to do this...? > Thank you very much and best regards! > Georg Ehret, Geneva, Switzerland. Without more infor

Re: [R] nndist R vs. ArcGIS

2011-04-11 Thread Rolf Turner
On 12/04/11 07:32, Barry Rowlingson wrote: On Mon, Apr 11, 2011 at 4:49 PM, smoluka wrote: Can anyone tell me why I would get different average nearest neighbor values for the same set of coordinates between ArcGIS 10 and R? Sometimes the difference in distance is over 1.3 km. Edge correctio

[R] Revolutions Blog: March Roundup

2011-04-11 Thread David Smith
I write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of March: The d

Re: [R] RExcel

2011-04-11 Thread array chip
Yes, I did, and no error message. And comRegisterRegistry() returns NULL, not sure if that matters John From: Jonathan P Daily Cc: r-help ; r-help-boun...@r-project.org Sent: Mon, April 11, 2011 11:39:12 AM Subject: Re: [R] RExcel It is asking the obvious,

Re: [R] Partial italic in graph titles when looping

2011-04-11 Thread David Winsemius
On Apr 11, 2011, at 6:28 PM, Josh B wrote: Follow-up question: I want to make the gene name bold and italic, AND make the "p" number just bold. But here's the catch: now I want the "p" number to appear as a superscript! I am no longer clear (if I ever was) what the "p number might be,

Re: [R] Geographic distance between lat-long points in R?

2011-04-11 Thread Seeliger . Curt
> A comparison of some geographic distance calculations is provided at > http://pineda-krch.com/2010/11/23/great-circle-distance-calculations-in-r/ > , along with code for calculating the Vincenty inverse formula, which > relies on the WGS-84 ellipsoid approximations. You know, Scott, I shoul

Re: [R] Help on calculating a variable using random numbers

2011-04-11 Thread Dennis Murphy
Hi: Try simtest <- transform(simtest, growth = rnorm(1000, m = ifelse(treat == 0, 0.1, 0.5), s = 0.03)) HTH, Dennis On Mon, Apr 11, 2011 at 1:16 PM, Shane Phillips wrote: > I'm new to R, but I'm trying to write a program for a dissertation that > generates a dataset as follows... > > subj

[R] simple maths question

2011-04-11 Thread Georg Ehret
Hi Mrs & Ms "R", A simple maths question that I am trying to resolve with R: I need to calculate the SE from a pvalue and it's beta... How to do this...? Thank you very much and best regards! Georg Ehret, Geneva, Switzerland. [[alternative HTML version deleted]] __

[R] Speeding up "Multinomial Logit"/"Proportional odds model" in R vs stata?

2011-04-11 Thread Tal Galili
Hi all, An R blogger just published a comparison between R and stata for performing: - Multinomial Logit - Proportional odds model - Generalized Logit At: http://ekonometrics.blogspot.com/2011/04/speeding-tickets-for-r-and-stata.html The benchmark used (as mentioned in the comment to t

Re: [R] Geographic distance between lat-long points in R?

2011-04-11 Thread Scott Chamberlain
Thanks very much for the help! Scott On Monday, April 11, 2011 at 12:54 PM, seeliger.c...@epamail.epa.gov wrote: > I have a bunch of geographic locations specified by lat-long > > coordinates. What's an easy way to calculate geographic distance > > between any two points? OR, perhaps there is

Re: [R] Meta-analysis of a correlation matrix

2011-04-11 Thread Scott Chamberlain
I don't know if it can, but have you looked into the metafor package? On Monday, April 11, 2011 at 1:46 PM, Iuri Gavronski wrote: > Sorry for the cross-posting, but I would like to know if anyone is > aware of a package in R for this. > > > > -- Forwarded message -- > From: John

Re: [R] Problem with facet_grid in ggplot2

2011-04-11 Thread Brian Diggs
On 4/11/2011 9:33 AM, Simon Hayward wrote: Hi all, I am practising a bit with ggplot2 but I have a problem when I try to use facet_grid. The following code:- p<- ggplot(diamonds, aes(carat, ..density..)) + + geom_histogram(binwidth = 1) p + facet_grid(cut ~ clarity, margins=TRUE) produce the

Re: [R] Getting many substrings but only loading the original string one time.

2011-04-11 Thread Jonathan
Duncan, That would appear to be exactly what I was looking for! I will follow up if I have trouble after implementing the script this'll be used in. I suppose I'd be wondering whether R is a reasonably fast language to use for this type of task (given the very large long string size, and the

[R] Meta-analysis of a correlation matrix

2011-04-11 Thread Iuri Gavronski
Sorry for the cross-posting, but I would like to know if anyone is aware of a package in R for this. -- Forwarded message -- From: John Antonakis Sent: Sunday, April 10, 2011 3:26 PM To: RMNET Subject: Meta-analysis of a correlation matrix (correct thread title) Hi: Does anyone

[R] Help on calculating a variable using random numbers

2011-04-11 Thread Shane Phillips
I'm new to R, but I'm trying to write a program for a dissertation that generates a dataset as follows... subject=1:1000 treat=rbinom(1*1000,1,.13) gender=rbinom(1*1000,1,.5) eth=runif(1*1000, min=1, max=4) cogat=rnorm(1*1000, 100, 16) map=rnorm(1*1000, 200, 9) simtest=data.frame (subjec

[R] Plotting a quadratic line on top of an xy scatterplot

2011-04-11 Thread Josh B
Dear Listserv, Here is my latest in a series of simple-seeming questions that dog me. Consider the following data: x <- read.table(textConnection("temperature probability 0.11 9.4 0 2.3 0.38 8.7 0.43 9.2 0.6 15.6 0.47 8.7 0.09 12.8 0.11 9.4 0.01 7.7 0.83 8 0.65 9.3 0.05 7.4 0.34 10.1 0.02 4.8 0.

Re: [R] Getting many substrings but only loading the original string one time.

2011-04-11 Thread Duncan Murdoch
On 11/04/2011 3:48 PM, Jonathan wrote: Hi All, I'm looking for a way to get many substrings from a longer string and then stitch them together. But, since the longer string is really, really long (like 250 MB long), I don't want to do this in a loop and load and re-load the longer string ma

[R] Getting many substrings but only loading the original string one time.

2011-04-11 Thread Jonathan
Hi All, I'm looking for a way to get many substrings from a longer string and then stitch them together. But, since the longer string is really, really long (like 250 MB long), I don't want to do this in a loop and load and re-load the longer string many times. Does anybody have an idea? May

Re: [R] nndist R vs. ArcGIS

2011-04-11 Thread Barry Rowlingson
On Mon, Apr 11, 2011 at 4:49 PM, smoluka wrote: > Can anyone tell me why I would get different average nearest neighbor values > for the same set of coordinates between ArcGIS 10 and R? Sometimes the > difference in distance is over 1.3 km. Edge correction? In a spatial point pattern, points nea

Re: [R] How can I include a new book on the

2011-04-11 Thread Marcio Pupin Mello
It's there. Thank you Ben and also Kurt! Best, Marcio Em 4/7/2011 10:19 AM, Marcio Pupin Mello escreveu: Thanks Ben! I will! Em 4/7/2011 8:32 AM, Ben Bolker escreveu: Marcio Pupin Mello ieee.org> writes: I've just published a new book for R beginners in Portuguese: "Conhecendo o R: uma visão

Re: [R] Polar Plots

2011-04-11 Thread Peter Ehlers
On 2011-04-11 05:38, ogbos okike wrote: Dear List, Following the link below ( http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=plotrix:clock24.plot) I got an interesting polar plots which displayed my data and the time of observation. Thank you very much for providing such details. However, I have

Re: [R] Fwd: CRAN problem with plyr-1.4.1

2011-04-11 Thread Douglas Bates
The first thing to do is try another mirror. The "official" (or as official as we ever get about anything) U.S. mirror is http://cran.us.R-project.org They tend to be very good about updating. Presently the source package for plyr is at version 1.5 and the binary versions are both at 1.4.1 On

Re: [R] nndist R vs. ArcGIS

2011-04-11 Thread Seeliger . Curt
Alexis wrote: > Can anyone tell me why I would get different average nearest neighbor values > for the same set of coordinates between ArcGIS 10 and R? Sometimes the > difference in distance is over 1.3 km. spatstat::nndist calculates Euclidean distances rather than distances along the earth's s

Re: [R] RExcel

2011-04-11 Thread Jonathan P Daily
It is asking the obvious, but did you run the commands from the rcom package after installation (see inline ***s)? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room w

[R] Fwd: CRAN problem with plyr-1.4.1

2011-04-11 Thread Ian Davis
It looks like there might be some kind of problem with the Plyr-1.4.1 packages pushed to CRAN? The web pages show 1.4.1 as the current version, but trying to fetch the source through the provided link gives a 404: http://lib.stat.cmu.edu/R/CRAN/web/packages/plyr/index.html $ wget http://lib.sta

Re: [R] Adding margin text to lattice graphics

2011-04-11 Thread Oscar Perpiñan Lamigueiro
Hi, You can try the combination of c.trellis and update from the latticeExtra package. For example: p <- xyplot(1~1) update(c(p, p, p, p), xlab='SomeText', ylab='MoreText') update(c(p, p, p, p), xlab=c('SomeText', 'SomeText2'), ylab=c('MoreText', 'MoreText2')) There are lots of examples in h

Re: [R] Time series of spatial data

2011-04-11 Thread Oscar Perpiñan Lamigueiro
Hi, You could try spacetime: http://cran.r-project.org/web/packages/spacetime/ Cheers. Oscar. - Oscar Perpiñán Lamigueiro Dpto. de Ingeniería Eléctrica EUITI-UPM http://procomun.wordpress.com --- En Thu, 7 Apr 2011 03:38:12 -0700 (PDT) idham escr

[R] Problem with facet_grid in ggplot2

2011-04-11 Thread Simon Hayward
Hi all, I am practising a bit with ggplot2 but I have a problem when I try to use facet_grid. The following code:- p <- ggplot(diamonds, aes(carat, ..density..)) + + geom_histogram(binwidth = 1) p + facet_grid(cut ~ clarity, margins=TRUE) produce the following error:- Error in class(output[[

[R] Zoom on simple.violinplot

2011-04-11 Thread PhDGuy
Hello, I am using the function simple.violinplot from the package UsingR. I have some outliers in my dataset so that the distribution has very long tails. As a result, the y-axis of the output of simple.violinplot extends to very large values. I would like to zoom on the y-axis with a command such

Re: [R] Partial italic in graph titles when looping

2011-04-11 Thread Josh B
Follow-up question: I want to make the gene name bold and italic, AND make the "p" number just bold. But here's the catch: now I want the "p" number to appear as a superscript! For instance: TFL1^687 (the carrot is to indicate that I actually want the "p" number as a superscript). Thanks ver

[R] Override col.lines and col.symbol in panel.xyplot with type='b'

2011-04-11 Thread Szumiloski, John
Dear useRs, I have a longitudinal experiment with several treatment groups, ~20 subjects per group, ~6 timepoints and a continuous dependent variable. I have been successfully been using lattice::xyplot with this data. However, I have been stumped with a particular application of it. I would

[R] forest + igraph ?

2011-04-11 Thread Samor Gandhi
Hello, Is it possible to have two meta-plots in one graph (not par(mfrow=c(2,1))? But somthing like  library(metafor)  library("igraph")    if (interactive()) {     forest(dat.Treat$RR, ci.lb=dat.Treat$lower, ci.ub=dat.Treat$upper, xlab="Relative Risk",slab=dat.Treat$ID,refline=1)     forest(da

[R] nndist R vs. ArcGIS

2011-04-11 Thread smoluka
Can anyone tell me why I would get different average nearest neighbor values for the same set of coordinates between ArcGIS 10 and R? Sometimes the difference in distance is over 1.3 km. Alexis -- View this message in context: http://r.789695.n4.nabble.com/nndist-R-vs-ArcGIS-tp3442375p3442375.

[R] Regression model with proportional dependent variable

2011-04-11 Thread ty ty
Hello, dear experts. I don't have much experience in building regression models, so sorry if this is too simple and not very interesting question. Currently I'm working on the model that have to predict proportion of the debt returned by the debtor in some period of time. So the dependent variable

[R] Question about GAM (mgcv)

2011-04-11 Thread Samuel Turgeon
Dear list, i'm using the GAM function from mgcv package. I'm using this syntax: model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x3)+s(x4)+s(5),family=quasipoisson,data=data) and I'm sequentially dropping the single term with the highest non-significant p-value from the model and re-fitting unt

Re: [R] read in summarised data as table()

2011-04-11 Thread jim holtman
I assume that you would use 'read.csv' if you are getting output from Excel. Since we have no idea of what you data looks like, it is hard to tell. At least post an example of your data and then what you are expecting as output from the mosaicplot using the data. On Mon, Apr 11, 2011 at 11:20 AM

[R] RExcel

2011-04-11 Thread array chip
Hi, I am installing Excel using package "RExcelInstaller". When I tried to run installRExcel() I got this error message: You don not have the R package rcom installed. The (D)COM server installed which will aloow you to use the background server in RExcel. Since rcom is not installed, foregro

Re: [R] Geographic distance between lat-long points in R?

2011-04-11 Thread Seeliger . Curt
> I have a bunch of geographic locations specified by lat-long > coordinates. What's an easy way to calculate geographic distance > between any two points? OR, perhaps there is a function for > calculating a distance matrix for K sites? A comparison of some geographic distance calculations is

Re: [R] Fast version of Fisher's Exact Test

2011-04-11 Thread Steve Lianoglou
Hi, On Fri, Apr 8, 2011 at 1:52 PM, Bert Gunter wrote: > 1. I am not an expert on this. Definitely me neither, but: > 2. However, my strong prior would be no, since because it is "exact" it has > to calculate all the possible configurations and there are a lot to > calculate with the values of

Re: [R] Geographic distance between lat-long points in R?

2011-04-11 Thread dirknbr
I found something here http://www.biostat.umn.edu/~sudiptob/Software/distonearth.R #The following program computes the distance on the surface of the earth between two points point1 and point2. Both the points are of the form (Longitude, Latitude) geodetic.distance <- function(point1, point2) {

[R] read in summarised data as table()

2011-04-11 Thread dirknbr
I have some summarised data from a 2D pivot table which I want to visualise in R. How can I read in the data as a R table so I can use mosaicplot()? Dirk -- View this message in context: http://r.789695.n4.nabble.com/read-in-summarised-data-as-table-tp3442283p3442283.html Sent from the R help ma

[R] good examples of plot(table())

2011-04-11 Thread dirknbr
I am looking for good examples of visualising a tabulation using plot(table()) maybe with colour coding or indexing. Dirk -- View this message in context: http://r.789695.n4.nabble.com/good-examples-of-plot-table-tp3442131p3442131.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] ordered logistic regression - cdplot and polr

2011-04-11 Thread Joshua Wiley
Hi Elizabeth, On Mon, Apr 11, 2011 at 9:59 AM, Elizabeth Pringle wrote: > Hi, > > I have a dataset that I am trying to analyze and plot as an ordered logistic > regression (y = ordinal categories 1-3, x = continuous variable with values > 3-9). > > First is a problem with cdplot: > Produces a bea

Re: [R] ordered logistic regression - cdplot and polr

2011-04-11 Thread Achim Zeileis
On Mon, 11 Apr 2011, Elizabeth Pringle wrote: Hi, I have a dataset that I am trying to analyze and plot as an ordered logistic regression (y = ordinal categories 1-3, x = continuous variable with values 3-9). First is a problem with cdplot: Produces a beautiful plot, with the "right" trend, bu

Re: [R] Mclapply and print statement

2011-04-11 Thread Steve Lianoglou
Hi, On Mon, Apr 11, 2011 at 5:26 AM, Alaios wrote: > Dear all. > I am using the mclapply function to split my code to the many cores my system > has. It seems that is working fine. This is the parallel version of lcapply. > > The only problem that I seem to have is that the printf cannot print m

Re: [R] Comparing execution times

2011-04-11 Thread Steve Lianoglou
Just a comment about your use of foreach: On Mon, Apr 11, 2011 at 6:29 AM, Alaios wrote: [snip] > C.Case. Foreach is considered to be easier to be applied to manycores. > > foreach (i=1:dimz) %do% { >    print(sprintf('Creating the %d map',i)); >    Shadowlist[,,i]<-f <- GaussRF(x=x, y=y, model=m

Re: [R] Fast version of Fisher's Exact Test

2011-04-11 Thread Steven McKinney
Depends on how many other programs, and how large they are, and how much RAM you have on your machine. If I repeatedly run the example I used below, my R session shows 170MB of memory usage, not a huge amount relative to total memory, and not a huge amount even for 32 bit R. But if your system

[R] ordered logistic regression - cdplot and polr

2011-04-11 Thread Elizabeth Pringle
Hi, I have a dataset that I am trying to analyze and plot as an ordered logistic regression (y = ordinal categories 1-3, x = continuous variable with values 3-9). First is a problem with cdplot: Produces a beautiful plot, with the "right" trend, but my independent factor values are transformed.

Re: [R] Geographic distance between lat-long points in R?

2011-04-11 Thread Eik Vettorazzi
Hi Scott, have a look at the 'earth.dist'-function in the package 'fossil'. hth. Am 11.04.2011 17:37, schrieb Scott Chamberlain: > Dear R, > > > I have a bunch of geographic locations specified by lat-long coordinates. > What's an easy way to calculate geographic distance between any two poin

Re: [R] integration

2011-04-11 Thread Ravi Varadhan
It does. See `lower' and `upper' arguments. Why are y and z not known? Say, you want the marginal of x, i.e. integrate over x. Now, y and z are fixed. You fix them at different values, but they are known. Ravi. --- Ravi Varadhan, Ph.D. Ass

[R] Geographic distance between lat-long points in R?

2011-04-11 Thread Scott Chamberlain
Dear R, I have a bunch of geographic locations specified by lat-long coordinates. What's an easy way to calculate geographic distance between any two points? OR, perhaps there is a function for calculating a distance matrix for K sites? Sincerely, Scott Chamberlain [[alternativ

[R] heatmap clustering dendrogram export

2011-04-11 Thread Amos Folarin
Hi boyang zhe, The dendrogram is stored in the object returned from heatmap.2 #e.g. x <- heatmap.2(matrix(1:9,3)) dend.row <- x$rowDendrogram class(dend.row) [1] "dendrogram" plot(tmp$rowDendrogram) Amos Folarin -- Forwarded message -- From: boyang zhe To: r-help@r-proj

Re: [R] Edate and EOmonth

2011-04-11 Thread Dirk Eddelbuettel
On 11 April 2011 at 10:55, Whit Armstrong wrote: | I think Dirk has recently done some things w/ boost date time as an Rcpp | based project bdt. | | http://cran.r-project.org/web/packages/RcppBDT/ChangeLog It's on CRAN too at http://cran.r-project.org/web/packages/RcppBDT/ It may get an

Re: [R] Fitting controlled released data

2011-04-11 Thread Uwe Ligges
On 10.04.2011 21:22, EmaDaCuz wrote: Hi, I am new to the forum/mailing list. I have been using R for a while and I find it incredible. I was just wondering whether someone has ever written a library to calculate the best fit of experimental data to some controlled release models, having only t

Re: [R] Edate and EOmonth

2011-04-11 Thread Whit Armstrong
I think Dirk has recently done some things w/ boost date time as an Rcpp based project bdt. http://cran.r-project.org/web/packages/RcppBDT/ChangeLog -Whit On Mon, Apr 11, 2011 at 10:11 AM, Jorge Nieves wrote: > Hi, > > I was wondering if anyone could point me to the excel look alike "Edate" >

[R] Edate and EOmonth

2011-04-11 Thread Jorge Nieves
Hi, I was wondering if anyone could point me to the excel look alike "Edate" and "eomonth" functions in R. I have found the "timeLastDayInMonth" and "timeFirstDayInMonth" in the "timeDate" package. However, I am looking for a bit more flexibility. I would like to be able to obtain dates and EOM d

Re: [R] Converting edgelist to symmetric matrix

2011-04-11 Thread Gary Weissman
Hi Shafique, If your edgelist is in the form of a text file (elist.csv) that looks like this: from, to, weight vertex1, vertex2, 3 vertex2, vertex3, 2.3 vertex4, vertex1, 1.2 ... you can convert that to a matrix using library(igraph) edge.list <- read.csv(elist.csv,header=TRUE) g <- graph.da

Re: [R] Quantile Regression and R

2011-04-11 Thread Sheldrick, Peter (Specialty Casualty UW Support)
Pls disregard...I have it figured out. Thank you. Regards, Peter D. Sheldrick Hartford Financial Services Group > _ > From: Sheldrick, Peter (Specialty Casualty UW Support) > Sent: Friday, April 08, 2011 9:53 AM > To: 'r-help@R-project.

[R] [R-pkgs] plyr: version 1.5

2011-04-11 Thread Hadley Wickham
# plyr plyr is a set of tools for a common set of problems: you need to __split__ up a big data structure into homogeneous pieces, __apply__ a function to each piece and then __combine__ all the results back together. For example, you might want to: * fit the same model each patient subsets of

Re: [R] Converting edgelist to symmetric matrix/ plotting sparse network with lots of nodes

2011-04-11 Thread Mike Marchywka
> Date: Sat, 9 Apr 2011 14:34:28 -0700 > From: kmshafi...@yahoo.com > To: r-help@r-project.org > Subject: [R] Converting edgelist to symmetric matrix > > Hi, > I have network data in the form of a couple of edgelists containing weights in > the format "x,y,weight" whereby x represents row head

Re: [R] Yearly aggregates and matrices

2011-04-11 Thread mathijsdevaan
Solved the problem: I guess I was still using the main version of zoo. Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/Yearly-aggregates-and-matrices-tp3438140p3441723.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] About Tinn-R

2011-04-11 Thread JCFaria
Dear Marcos, Sorry, It is very difficult for me to know what happened on your computer! The fact is that the structure of the ini are corrupted. In this place Tinn-R stores all user preferences and configurations. It will really necessary to rename (or remove: in this case all your prior configu

[R] Polar Plots

2011-04-11 Thread ogbos okike
Dear List, Following the link below ( http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=plotrix:clock24.plot) I got an interesting polar plots which displayed my data and the time of observation. Thank you very much for providing such details. However, I have two set of data which I wish to display in

Re: [R] Coding matrix equation

2011-04-11 Thread Petr Savicky
On Mon, Apr 11, 2011 at 08:43:03AM +0100, matthew.r.robin...@sheffield.ac.uk wrote: > Hi all, > > I have two matrices: > > G<-matrix(c(2.0, 0.5, 0.5, 0.5, 2.0, 0.5, 0.5, 0.5,2.0),3,3) > P<-matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5,1.0),3,3) > > and I want to run this equation to get a new

[R] Package fgui returns error: Object of type closure is not subsettable

2011-04-11 Thread nikhil abhyankar
Hello All, I have written three functions. First: To input user specified SAS dataset and plot the boxplots of relevant variables. Second: Extract the number of hours, minutes etc. from a variable describing a time-point using regular expressions. E.g. 'Per1, Day 2, 24 Hour' would be

[R] multiple comparisons with generalised least squares

2011-04-11 Thread Sandy Adriaenssens
Dear R users, I have used the following model: M1 <- gls(Nblad ~ Concentration+Season + Concentration:Season, data=DDD, weights=varIdent(form=~ 1 | Season*Concentration)) to assess the effect of Concentration and Season on nitrogen uptake by leaves (Nblad). I accounted for the difference in vari

Re: [R] pseudo-R by hand

2011-04-11 Thread Achim Zeileis
On Mon, 11 Apr 2011, Sacha Viquerat wrote: hello dear list! since we want to do a model analysis and some people would like to see pseudo-R^2 values for different types of glm of a logistic regression, i've decided to write a function that computes either nagelkerkes normed pseudo-R or cox & s

Re: [R] glm with multiple vars

2011-04-11 Thread dirknbr
Sascha Thanks that works. Dirk -- View this message in context: http://r.789695.n4.nabble.com/glm-with-multiple-vars-tp3438095p3441476.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] Question about levels/as.numeric

2011-04-11 Thread John Kane
--- On Sun, 4/10/11, Rolf Turner wrote: > From: Rolf Turner > Subject: Re: [R] Question about levels/as.numeric > To: r-help@r-project.org > Received: Sunday, April 10, 2011, 9:48 PM > On 11/04/11 10:08, Peter Ehlers > wrote: > > > > "Checking" anything with Excel is never much use. > > >

[R] Comparing execution times

2011-04-11 Thread Alaios
Dear all, In my 'simple' computer I was running some experiments to help me understand how faster a multicore lapply will be. I thought it might be interesting for some people to look at the results. Even though are not accurate, still might be a good indicator how much improvement there can be

[R] pseudo-R by hand

2011-04-11 Thread Sacha Viquerat
hello dear list! since we want to do a model analysis and some people would like to see pseudo-R^2 values for different types of glm of a logistic regression, i've decided to write a function that computes either nagelkerkes normed pseudo-R or cox & snells pseudo-R. however, i am not clear as i

[R] Mclapply and print statement

2011-04-11 Thread Alaios
Dear all. I am using the mclapply function to split my code to the many cores my system has. It seems that is working fine. This is the parallel version of lcapply. The only problem that I seem to have is that the printf cannot print messages. The ideal to me is to have fro my function an outpu

Re: [R] rtmvt

2011-04-11 Thread Tóth Dénes
Hi there, Since you failed to provide us with data and sessionInfo(), I can only guess that for some reason you call the rtmvt.rejection function instead of rtmvt.gibbs. Just look at the code of rtvmt by typing: rtmvt There you can see that it is a wrapper for rtmvt.rejection or rtmvt.gibbs. You

[R] heatmap clustering dendrogram export

2011-04-11 Thread boyang zhe
Hi, I am a beginner for R. I had use gplots to generate a heatmap as following: >heatmap.2(matrix, col=topo.colors(75), dendrogram="column", Rowv=FALSE, trace="none", key=TRUE, keysize=0.8, density.info="none", cexRow=0.2, cexCol=0.6) It work well. It generate heatmap whith rcolumn clustering d

Re: [R] How do I make this faster?

2011-04-11 Thread Paul Hiemstra
On 04/11/2011 10:28 AM, Andreas Borg wrote: > Hi Hasan, > > I'd be happy to help you, but I am not able to run your code. You use > commandArgs to retrieve arguments of the R program, but which ones do > you actually provide? > > Best regards, > > Andreas > > Hasan Diwan schrieb: >> I was on vacati

Re: [R] plot layout with several plots ON plot area of previous plot

2011-04-11 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/04/11 18:47, Greg Snow wrote: > Some of the functions that were the first in the TeachingDemos > package were originally written to help me visualize something, so it > is not just teachers demoing, but people demoing to themselves. It > has bec

Re: [R] Help with basic loop

2011-04-11 Thread Ivan Calandra
Well, I was quite blind not to change 1 to 1000 in runif() and use replicate()!! It gets even faster if you create prob first. Ivan Le 4/11/2011 10:53, Dennis Murphy a écrit : Hi: Let's assume the lengths of each vector are the same so that they can be multiplied. Here's the timing on my mac

Re: [R] Help with basic loop

2011-04-11 Thread Dennis Murphy
Hi: Let's assume the lengths of each vector are the same so that they can be multiplied. Here's the timing on my machine: > system.time(replicate(1000, { prob<-numeric(1000) + + for (n in 1:1000) { + task1 <- runif(1, min=0.8, max= 0.9) + task2 <- runif(1, min=0.75, max= 0.85) + task3 <- runif(1,

Re: [R] Password-protect R script files

2011-04-11 Thread Ivan Calandra
On Windows at least, you could set it as "read only". The user can save an edited copy of it but cannot modify the original script. Le 4/11/2011 09:36, Petr Savicky a écrit : On Sun, Apr 10, 2011 at 10:48:19PM +0530, Vijayan Padmanabhan wrote: There was a question in R forum very long time bac

  1   2   >