Re: [R] Rgraphviz

2007-11-15 Thread Robert Gentleman
Hi, Most likely you are mixing and matching things that do not play nicely together. Since you did not give us details on just what you did ("I have re-installed", is so vague as to be of no value, please provide accurate and complete descriptions of what you did when asking for help) You c

Re: [R] read complicated file

2007-11-15 Thread jim holtman
Here is one way of doing it. I put your data in a file and then read it in my lines and deleted everything upto END and then used textConnection to read the rest of the data. When I looked at the first 82 values, then seem to have started at the correct place, but I did see the value you expected

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread jim holtman
If what you want to do is to 'remove' from 'x' all the occurrances of the matching values in 'z' and then create a new sequence, here is a way of doing it: > x <- c(3,3,4,4,4,4,5,5,6,7,8,8,9) > z <- c(1,2,3,4,4,5,5,5) > #want to remove the matching number in 'z' from 'x' > # determine which number

Re: [R] Equal confidence interval arrowhead lengths across multiple-paneled lattice plots with free y-scales

2007-11-15 Thread Deepayan Sarkar
On Nov 15, 2007 8:08 PM, Bob Farmer <[EMAIL PROTECTED]> wrote: > Hi. > I've got a lattice plot with multiple panels and two groups superimposed > on each panel. Each panel has an independently scaled y-axis (scales = > list(relation = "free")). > > I've successfully put up 95%CI error bars using p

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Greg Snow
You might try looking at the tkrplot package, it uses win.metafile and captures the graphics device into a variable (which is then put into a tk lable, but you could probably do something else with it). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTEC

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread Gabor Grothendieck
And here is a slightly shorter variation that encodes the sequence number as the last two digits and then removes it at the end: xx <- 100 * x + seq(x) - match(x, x) zz <- 100 * z + seq(z) - match(z, z) setdiff(xx, zz) %/% 100 On Nov 15, 2007 4:54 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread Gabor Grothendieck
We can append a row of 0's to handle that case: with(rle(as.vector(rbind(prova, 0))), table(lengths[values == 1])) On Nov 15, 2007 11:36 AM, Marc Schwartz <[EMAIL PROTECTED]> wrote: > Ah...OK. I misunderstood then. I thought that you wanted the number of > runs of 1's in each column. > > This i

[R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
From: sigalit mangut-leiba <[EMAIL PROTECTED]> Date: Nov 15, 2007 3:24 PM Subject: Re: [R] a repetition of simulation To: r-help <[EMAIL PROTECTED]> Hello, In addition to my question a few days ago, Now I have a matrix of the coefficients, how can I see all the P.Values ( Pr(>|z|)) of the covariat

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Josh Tolley
On Nov 15, 2007 2:41 PM, Michael Lawrence <[EMAIL PROTECTED]> wrote: > This is possible using the cairoDevice package and RGtk2. > > Turning an R graphic into a raw vector of bytes: > > library(cairoDevice) > library(RGtk2) > > # create a pixmap and tell cairoDevice to draw to it > > pixmap <- gdkP

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread Marc Schwartz
Ah...OK. I misunderstood then. I thought that you wanted the number of runs of 1's in each column. This is actually easier, _if_ there is not an overlap of 1's from the end of one column to the start of the next column: res <- rle(as.vector(prova)) > res Run Length Encoding lengths: int [1:11]

Re: [R] how to extract the elements of a list of vectors in a fixed position?

2007-11-15 Thread Dimitris Rizopoulos
try this: v <- list(c(1,2), c(3,4), 5, c(-3:3)) sapply(v, "[", i = 2) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32

Re: [R] kalman filter estimation

2007-11-15 Thread Giovanni Petris
Kalman filter for general state space models, especially in its naive version, is known for its numerical instability. This is the reason why people developed square root filters, based on Cholesky decomposition of variance matrices. In package dlm the implementation of Kalman filter is based on

Re: [R] Using plotmath expressions in lattice key text

2007-11-15 Thread Deepayan Sarkar
On Nov 15, 2007 7:12 PM, Bert Gunter <[EMAIL PROTECTED]> wrote: > > Folks: > > delta <- 1:5 > > I would like to put 5 separate lines of text of the form "10 %+-% delta[i]" > into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol > and delta[i] is the ith value of delta. > > The

Re: [R] how to extract the elements of a list of vectors in a fixedposition?

2007-11-15 Thread Rolf Turner
On 16/11/2007, at 9:44 AM, Greg Snow wrote: > > > [snip] >> >> or (I can't resist) >> >> unlist(lapply(v,function(x,i){x[i]},i=2)) # For more >> flexibility. > > Well, if we are not resisting the fun ones then try: > > sapply( v, `[`, i=2) Admittedly *much* cooler than my some

[R] Why is model.matrix creating 2 columns for boolean?

2007-11-15 Thread Ross Boylan
I have a data frame "reading" that includes a logical variable "OLT" along with response variable "Reading" and predictor "True" (BOTH are numeric variables; it's "True" as in the true value). When I suppress the intercept, model.matrix gives me OLTTRUE and OLTFALSE columns. Why? Can I do anythi

Re: [R] group mean, minus each row's value

2007-11-15 Thread Greg Snow
Try: > w <- ave(x,g) > n <- ave(x,g, FUN=length) > wnew <- (w*n - x)/(n-1) Or > s <- ave(x,g, FUN=sum) > n <- ave(x,g, FUN=length) > wnew <- (s-x)/(n-1) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > --

Re: [R] R Help

2007-11-15 Thread Rolf Turner
On 15/11/2007, at 6:05 PM, Bryan Klingaman wrote: > Ya, I was wondering if anyone knows how to use R and can do some > computing with it. I have a problem that involves implementing the > EM Algorithm for censored normal data. So I was wondering if > anyone knows how to code a problem inv

Re: [R] how to assign a group mean to individual cases?

2007-11-15 Thread Greg Snow
For the first question use ave along with mean like Gabor suggested. For the second question (finding the mean with that value removed) you can use ave with the sum function ("ave(x, group, FUN=sum)") to find the sum rather than the average, then use ave again with the length function to find out

Re: [R] Help with K-means Clustering

2007-11-15 Thread Roberto Perdisci
Hi, if you use the function kmean in the package stats, for example clust <- kmeans(data, k, iter.max = 10) where k is the number of desired cluster, kmeans will choose the first k centers randomly. Because of this random initialization, after iter.max iteration the solution may converge to diff

Re: [R] Multiply each column of array by vector component

2007-11-15 Thread Greg Snow
?sweep -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Thursday, November 15, 2007 10:50 AM > To: r-

Re: [R] Plot problem

2007-11-15 Thread Julian Burgos
Hi Allen, Its difficult to know what is the problem without knowing what type of object is 'Disease.FL'. plot() is a generic function and it will act differently depending on the type of object you are passing to it. As always, you should provide 'provide commented, minimal, self-contained,

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread Marc Schwartz
On Thu, 2007-11-15 at 17:53 +0100, A M Lavezzi wrote: > thank you. > I did not think about the case of overlapping of > 1's from the end of one column to the start of the next, > this would actually be a problem > > In the simulations I am running each column > corresponds to the path followed

Re: [R] Generating these matrices going backwards

2007-11-15 Thread Chris Stubben
Sorry, I wasn't sure what you meant. This way will return more than one answer, right? N<-c(1,2,1,3) R<-c(1.75,3.5,1.75,1.3125) ## get all 126 combinations of five 0's and four 1's for matrix cbn<-as.matrix(expand.grid( rep( list(0:1), 9))) cbn<- cbn[rowSums(cbn)==4,] ans<-list() ctr<-0 ## lo

Re: [R] sample nth day data in each month

2007-11-15 Thread Emmanuel Charpentier
Carles Fan a écrit : > Dear all > > i have a time series containing trading dates and historical stock prices: > Date Price > 10-Jan-2007 100 > 11-Jan-2007 101 > 13-Jan-2007 99 > .. > .. > .. > 10-Nov-2007 200 > > i want to sample every 21st data of each month: > 21-Ja

Re: [R] Romoving elements from a vector. Looking for the oppositeof c(), New user

2007-11-15 Thread Peter Alspach
Thomas > Not sure i explained it good enough. Ill try with an example > > say > > x=[3,3,4,4,4,4,5,5,6,8] > z=[3,4,4,5,5] > > what i want to get after removing z from x is something like > x=[3,4,4,6,8] This will work, but I imagine there are better ways (assuming z is always a subset of x)

Re: [R] map - mapproj : problem of states localisation

2007-11-15 Thread Ray Brownrigg
On Fri, 16 Nov 2007, Tom Minka wrote: > I haven't seen the original code, but the problem with Ray's code is that > the two projections are not synchronized. Specifically, they are using > different (default) values for the orientation. To synchronize the > projections, either specify the orienta

[R] syntax for a 3-level nlme model

2007-11-15 Thread Christine Calmes
I am writing to verify the syntax that I am using to test a 3-level > model with a random intercept at the second level (participant in my > model) versus a model with a random slope and intercept at this > level. Specifically, I am testing a 3 level model in which time > (WEEK) is nested in

Re: [R] Multiply each column of array by vector component

2007-11-15 Thread Marc Schwartz
On Thu, 2007-11-15 at 17:50 +, [EMAIL PROTECTED] wrote: > Hi, > > I've got an array, say with i,jth entry = A_ij, and a vector, say with jth > entry= v_j. I would like to multiply each column of the array by the > corresponding vector component, i,e. find the array with i,jth entry > > A_ij

Re: [R] help

2007-11-15 Thread David Scott
On Wed, 14 Nov 2007, Nadine Mugusa wrote: > Hi everyone, > Can someone help me with root bisection algorithm? > Nadine > Well you really should read the posting guide because this is not a very informative enquiry. However if what you really want to do is find the root of an equation you shou

Re: [R] sample nth day data in each month

2007-11-15 Thread Gabor Grothendieck
On Nov 15, 2007 12:54 PM, Carles Fan <[EMAIL PROTECTED]> wrote: > Dear all > > i have a time series containing trading dates and historical stock prices: > Date Price > 10-Jan-2007 100 > 11-Jan-2007 101 > 13-Jan-2007 99 > .. > .. > .. > 10-Nov-2007 200 > > i want to samp

[R] HELP: How to subtract a vector out of each row of a matrix or array

2007-11-15 Thread Geoffrey Zhu
Hi All, I am having great trouble doing something pretty simple. Here is what I did: > x <- read.table("clipboard") > dim (x) [1] 126 10 > typeof(x) [1] "list" > w <- array(x) > typeof(w) "list" Q1: How come after constructing an array out of the list, the type of the array is still "list"?

Re: [R] How to deal with character(0)?

2007-11-15 Thread Duncan Murdoch
On 11/15/2007 4:54 PM, Gang Chen wrote: > I want to identify whether a variable is character(0), but get lost. > For example, if I have > > > dd<-character(0) > > the following doesn't seem to serve as a good identifier: > > > dd==character(0) > logical(0) > > So how to detect character(0)?

[R] R Help

2007-11-15 Thread Bryan Klingaman
Ya, I was wondering if anyone knows how to use R and can do some computing with it. I have a problem that involves implementing the EM Algorithm for censored normal data. So I was wondering if anyone knows how to code a problem involving the EM Algorithm in R, and then estimate the parameters,

Re: [R] Ancova doesn't return test statistics

2007-11-15 Thread Gustaf Rydevik
On Nov 15, 2007 4:36 PM, Johan A. Stenberg <[EMAIL PROTECTED]> wrote: > Dear all, > > I'm quite sure that this is a stupid question, but I'll ask anyway. > I want to perform an ANCOVA with two continuous factors and three > categorical factors. > > Plant population growth rate (GR) = dependent vari

Re: [R] generate combination set

2007-11-15 Thread Adrian Dusa
Using your "set", wouldn't it be simpler like this? t(apply(combn(7,2), 2, function(x) set[x])) Hth, Adrian On Thursday 15 November 2007, [EMAIL PROTECTED] wrote: > There are a number of packages that do this, but here is a simple > function for choosing subsets: > > subsets <- function(n, r) {

Re: [R] Normalizing data

2007-11-15 Thread Ramon Diaz-Uriarte
Maybe Joren means that the y axis has values greater than 1? If that is the case, that is certainly not evidence of any problem; the density can have values larger than 1 and still integrate to 1. (And, just as a silly example, try "dnorm(0, mean = 0, sd = 0.1)"). Best, R. On Nov 15, 2007 11:0

Re: [R] Ancova doesn't return test statistics

2007-11-15 Thread Richard M. Heiberger
Your model is fully saturated. It specifies terms that use up all degrees of freedom. There are no degrees of freedom left over for a Residual term and therefore there is no denominator for the tests. When you drop one term, then those degrees of freedom are left over, that is they form the Res

Re: [R] Writing a helper function that takes in the dataframe and variable names and then does a subset and plot

2007-11-15 Thread Emmanuel Charpentier
Dear Daniel, May I point you to Thomas Lumley's paper in R News 2001-3 ("Programmer’s Niche: Macros in R\n Overcoming R’s virtues) and to the defmacro utility of the gtools package ? HTH Emmanuel Charpentier Daniel Myall a écrit : > Hi, > > I have a lar

Re: [R] generate combination set

2007-11-15 Thread Adrian Dusa
On Thursday 15 November 2007, [EMAIL PROTECTED] wrote: > Actually, (now that I know about combn), a better way is > > t(matrix(set[combn(7,2)], nrow = 2)) Indeed, or to avoid transposing: matrix(set[combn(7,2)], ncol = 2, byrow=T) Adrian -- Adrian Dusa Romanian Social Data Archive 1, Schitu Ma

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread John Kane
I think you've read Thomas's request in reverse. and what he want is: x[!x %in% z] Thanks for the %in% approach BTW. --- Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > On Nov 15, 2007, at 9:15 AM, Thomas Fr��jd wrote: > > > Hi > > > > I have three vectors say x, y, z. One of them, x > c

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Emmanuel Charpentier
Just an couple of ideas that might or might not work ... Josh Tolley a écrit : > I'm using R embedded in PostgreSQL (via PL/R), and would like to use > it to create images. It works fine, except that I have to create every > image in a file (owned by and only readable by the PostgreSQL server), >

Re: [R] How to deal with character(0)?

2007-11-15 Thread Gang Chen
Thanks a lot for all who've provided suggestions! Gang On Nov 15, 2007, at 5:09 PM, Duncan Murdoch wrote: > On 11/15/2007 4:54 PM, Gang Chen wrote: >> I want to identify whether a variable is character(0), but get >> lost. For example, if I have >> > dd<-character(0) >> the following doesn't

Re: [R] How to deal with character(0)?

2007-11-15 Thread Erik Iverson
see ?is.character and ?length something like #not tested dd <- character(0) is.character(dd) & length(dd) == 0 should do it. Gang Chen wrote: > I want to identify whether a variable is character(0), but get lost. > For example, if I have > > > dd<-character(0) > > the following doesn't s

Re: [R] Normalizing data

2007-11-15 Thread jim holtman
I am not sure what you mean when you say it does not integrate to 1. Here are a couple of cases, and it seems fine to me: > x <- density(1:30) > str(x) List of 7 $ x: num [1:512] -11.0 -10.9 -10.8 -10.7 -10.6 ... $ y: num [1:512] 6.66e-05 7.22e-05 7.84e-05 8.49e-05 9.20e-05 ...

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread Gabor Grothendieck
Try this. xx and zz are the same as x and z except they have a sequence number appended. We then do a setdiff and remove the sequence numbers. > xx <- paste(x, seq(x) - match(x, x)) > zz <- paste(z, seq(z) - match(z, z)) > dd <- setdiff(xx, zz) > as.numeric(sub(" .*", "", dd)) [1] 3 4 4 6 7 8 8

Re: [R] How to deal with character(0)?

2007-11-15 Thread Gabor Csardi
is.character(dd) && length(dd) == 0 should do it i think. Gabor On Thu, Nov 15, 2007 at 04:54:45PM -0500, Gang Chen wrote: > I want to identify whether a variable is character(0), but get lost. > For example, if I have > > > dd<-character(0) > > the following doesn't seem to serve as a good

[R] How to deal with character(0)?

2007-11-15 Thread Gang Chen
I want to identify whether a variable is character(0), but get lost. For example, if I have > dd<-character(0) the following doesn't seem to serve as a good identifier: > dd==character(0) logical(0) So how to detect character(0)? Thanks, Gang __

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Gabor Grothendieck
This works on Windows: dev.control(displaylist="enable") # enable display list plot(1:10) myplot <- recordPlot() # load displaylist into variable You can now store myplot and later fetch it and play it back via myplot # or if not from the console print(myplot) On Nov 15, 2007 4:07 PM, Josh Tol

Re: [R] Graphics device storable in a variable

2007-11-15 Thread Michael Lawrence
This is possible using the cairoDevice package and RGtk2. Turning an R graphic into a raw vector of bytes: library(cairoDevice) library(RGtk2) # create a pixmap and tell cairoDevice to draw to it pixmap <- gdkPixmapNew(w=500, h=500, depth=24) asCairoDevice(pixmap) # make a dummy plot plot(1:1

[R] homogenity inside groups

2007-11-15 Thread Petr PIKAL
Dear all I would like to show my audience that some variables are homogenous inside groups but different outside. I can use by with summary for all variables by(iris[,1:4], iris$Species, summary) what can be quite messy in case of more than few variables and about 8 groups or densityplot fo

Re: [R] Problems working with large data

2007-11-15 Thread jim holtman
A little more information might be useful. If your matrix is numeric, then a single copy will require about 250MB of memory. What type of system are you on and how much memory do you have? When you say you are having problems, what are they? Is it a problem reading the data in? Are you getting

Re: [R] RMySQL installation problem

2007-11-15 Thread Prof Brian Ripley
On Thu, 15 Nov 2007, Tao Shi wrote: > > Hi List, > > I'm running R2.5.1 on WinXP. Downloaded RMySQL_0.6-0.zip from > http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.6/ and the > installation seemed fine. However, when I tried to load the package, the > error occured: > > >> utils:::m

Re: [R] where is library file

2007-11-15 Thread Casey,Richard
Thanks Brian. I installed libf2c for the x86_64 server, and then R and Bioconductor both installed without error, so apparently it was missing the library files. Back in business. Richard Casey, PhD Rocky Mountain Regional Center of Excellence fo

[R] Graphics device storable in a variable

2007-11-15 Thread Josh Tolley
I'm using R embedded in PostgreSQL (via PL/R), and would like to use it to create images. It works fine, except that I have to create every image in a file (owned by and only readable by the PostgreSQL server), and then use PostgreSQL to read from that file and return it to the client. It would be

Re: [R] problem with png()

2007-11-15 Thread Ingo Holz
Dear Brian, sorry, library(lattice) is loaded, when I start R, so I forgot to add this. I get "Ingo's title" if I plot directly to the screen. However, I do not get it if I use png() or I lose it if I save from the plot (screen). Ingo On 15 Nov 2007 at 10:30, Prof Brian Ripley wrote: > Wo

[R] Writing a helper function that takes in the dataframe and variable names and then does a subset and plot

2007-11-15 Thread Daniel Myall
Hi, I have a large dataframe than I'm writing functions to explore, and to reduce cut and paste I'm trying to write a function that does a subset and then a plot. Firstly, I can write a wrapper around a plot: plotwithfits <- function(formula, data, xylabels=c('','')) { xyplot(formula, data

Re: [R] HELP: How to subtract a vector out of each row of a matrix or array

2007-11-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Zhu > Sent: Thursday, November 15, 2007 10:45 AM > To: r-help@r-project.org > Subject: [R] HELP: How to subtract a vector out of each row > of a matrix or array > > Hi All, > > I am having g

Re: [R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
Thank you for all your comments, Sigalit. On 11/15/07, Johannes Hüsing <[EMAIL PROTECTED]> wrote: > > Excuse me, but I think your code deserves some comments. Unfortunately, > the history of postings is in reverse order, so I'll address your > first question first: > > > > >>> The simulation look

Re: [R] how to extract the elements of a list of vectors in a fixedposition?

2007-11-15 Thread Greg Snow
[snip] > > or (I can't resist) > > unlist(lapply(v,function(x,i){x[i]},i=2)) # For more > flexibility. Well, if we are not resisting the fun ones then try: sapply( v, `[`, i=2) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED]

Re: [R] a repetition of simulation

2007-11-15 Thread Julian Burgos
summary(log_v) Julian sigalit mangut-leiba wrote: > Hello, > In addition to my question a few days ago, > Now I have a matrix of the coefficients, > how can I see all the P.Values (Pr(>|z|)) of the covariates from the 1000 > iterations? > I tried names(log_v) and couldn'n find it. > Thank you, >

Re: [R] Rgui Windows command history

2007-11-15 Thread Duncan Murdoch
On 11/15/2007 12:55 PM, Loren Engrav wrote: > With the Mac and R.app, there is a window to the right of the console > wherein all commands are display and can be re-chosen by double clicking. > > Does a similar feature exist with Windows and Rgui? Or have I missed it > somewhere? history() will

Re: [R] generate combination set

2007-11-15 Thread Bill.Venables
Actually, (now that I know about combn), a better way is t(matrix(set[combn(7,2)], nrow = 2)) Bill V. -Original Message- From: Adrian Dusa [mailto:[EMAIL PROTECTED] Sent: Thursday, 15 November 2007 11:55 PM To: Venables, Bill (CMIS, Cleveland) Cc: [EMAIL PROTECTED]; r-help@r-project.or

Re: [R] not R question : alternative to logistic regression

2007-11-15 Thread Ben Bolker
MARK LEEDS-3 wrote: > > I was just curious if anyone knew of an alternative model to logistic > regression where the probabilities seems pretty linear to the predictor > rather than having that S shape that probit and logit assume. > > Well, the logistic curve is very close to linear over

Re: [R] a repetition of simulation

2007-11-15 Thread Johannes Hüsing
Excuse me, but I think your code deserves some comments. Unfortunately, the history of postings is in reverse order, so I'll address your first question first: > > >>> The simulation looks like this: > > >>> > > >>> z <- 0 > > >>> x <- 0 > > >>> y <- 0 > > >>> aps <- 0 > > >>> tiss <- 0 > > >>> fo

Re: [R] not R question : alternative to logistic regression

2007-11-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Thursday, November 15, 2007 12:04 PM > To: r-help@r-project.org > Cc: [EMAIL PROTECTED] > Subject: [R] not R question : alternative to logistic regression > > I was just cu

[R] RMySQL installation problem

2007-11-15 Thread Tao Shi
Hi List, I'm running R2.5.1 on WinXP. Downloaded RMySQL_0.6-0.zip from http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.6/ and the installation seemed fine. However, when I tried to load the package, the error occured: > utils:::menuInstallLocal() package 'RMySQL' successfully unpa

Re: [R] update matrix with subset of it where only row names match

2007-11-15 Thread Martin Waller
jim holtman wrote: > Lets take a look at your solution: > >> mat1 <- matrix(0, nrow=10, ncol=3) >> dimnames(mat1) <- list(paste('row', 1:10, sep=''), LETTERS[1:3]) >> mat2 <- matrix(1:3, ncol=1, dimnames=list(c('row3', 'row7', 'row5'), "B")) >> mat2 > B > row3 1 > row7 2 > row5 3 >> mat1[rown

[R] Equal confidence interval arrowhead lengths across multiple-paneled lattice plots with free y-scales

2007-11-15 Thread Bob Farmer
Hi. I've got a lattice plot with multiple panels and two groups superimposed on each panel. Each panel has an independently scaled y-axis (scales = list(relation = "free")). I've successfully put up 95%CI error bars using panel.arrows (and some help from the mailing list). My question is whet

[R] not R question : alternative to logistic regression

2007-11-15 Thread markleeds
I was just curious if anyone knew of an alternative model to logistic regression where the probabilities seems pretty linear to the predictor rather than having that S shape that probit and logit assume. Maybe there is there some kind of other GLM that could accomplish that. Any textbook refere

Re: [R] Using plotmath expressions in lattice key text

2007-11-15 Thread Sundar Dorai-Raj
Bert Gunter said the following on 11/15/2007 1:12 PM: > Folks: > > delta <- 1:5 > > I would like to put 5 separate lines of text of the form "10 %+-% delta[i]" > into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol > and delta[i] is the ith value of delta. > > The construct

Re: [R] how to extract the elements of a list of vectors in a fixed position?

2007-11-15 Thread Rolf Turner
On 16/11/2007, at 7:05 AM, carol white wrote: > Hi, > How is it possible to extract athe elements of a list of vectors in > a fixed position? suppose that I have a list of 2-element vectors, > how can I extract the 2nd element of all vectors in the list? Can > it be done with indexing and n

[R] Normalizing data

2007-11-15 Thread Joren Heit
Hello, I have a data set of about 300.000 measurements made by an STM which should apporximately fix a normal (Gaussian) distribution. I have imported the data in R and used plot(density()) to get a nice plot of the distribution which in fact looks like a real Gaussian. However, the integral over

Re: [R] no applicable method for "names"

2007-11-15 Thread Bartjoosen
I think you have an object x which doensn't allow to give names. If you use names(z) it will work. To see what kind of object x is: class(x) Regards Bart Schiller Judith 1541 EB wrote: > > hi, > > after installing R-2.6.0 the function "names" doesn't work anymore on my > windows xp machine.

[R] help

2007-11-15 Thread Nadine Mugusa
Hi everyone, Can someone help me with root bisection algorithm? Nadine - [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] how to extract the elements of a list of vectors in a fixed position?

2007-11-15 Thread carol white
Hi, How is it possible to extract athe elements of a list of vectors in a fixed position? suppose that I have a list of 2-element vectors, how can I extract the 2nd element of all vectors in the list? Can it be done with indexing and not by element name? Thanks carol So in this example, I wa

[R] Help with K-means Clustering

2007-11-15 Thread Alejandro Rodríguez
Hello, I'm new using R. I'm trying to develop a K-means Clustering with R for some data I have, however each time I use that instruction with the same data my cluster means, clustering vector and within cluster sum of square change and I don't understand why because I use the same parameters and

[R] Using plotmath expressions in lattice key text

2007-11-15 Thread Bert Gunter
Folks: delta <- 1:5 I would like to put 5 separate lines of text of the form "10 %+-% delta[i]" into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol and delta[i] is the ith value of delta. The construct: lapply(delta,function(d)bquote(10%+-%.(d))) appears to produce a li

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread Marc Schwartz
Jim, The one issue with those is that they remove duplicate elements in each vector before applying their logic. Thus, would not likely work here: x <- c(3,3,4,4,4,4,5,5,6,8) z <- c(3,4,4,5,5) In effect, you end up with: > unique(x) [1] 3 4 5 6 8 > unique(z) [1] 3 4 5 Thus: > setdiff(x, z)

Re: [R] Rgui Windows command history

2007-11-15 Thread Prof Brian Ripley
On Thu, 15 Nov 2007, Loren Engrav wrote: > With the Mac and R.app, there is a window to the right of the console > wherein all commands are display and can be re-chosen by double clicking. > > Does a similar feature exist with Windows and Rgui? Or have I missed it > somewhere? You have. history

Re: [R] kalman filter estimation

2007-11-15 Thread Giovanni Petris
> > You can live with it, but > > be aware that it is there. My suggestion is to start the optimization > > from several different initial values and compare maximized values of > > the likelihood. Simulated annealing may be used to better explore the > > parameter space. > > Yes. Are you aware

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread jim holtman
You can also check out the 'set' operations: setdiff, intersect, union. On Nov 15, 2007 12:08 PM, John Kane <[EMAIL PROTECTED]> wrote: > I think you've read Thomas's request in reverse. and > what he want is: > x[!x %in% z] > > Thanks for the %in% approach BTW. > > --- Charilaos Skiadas <[EMAIL PR

Re: [R] Multiply each column of array by vector component

2007-11-15 Thread Henrique Dallazuanna
If i understand your question, you can do: x <- matrix(1:10, 2) y <- sample(10,5) apply(x, 1, function(.x)mapply(y, .x, FUN="*")) On 15/11/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I've got an array, say with i,jth entry = A_ij, and a vector, say with jth > entry= v_j. I would

[R] Rgui Windows command history

2007-11-15 Thread Loren Engrav
With the Mac and R.app, there is a window to the right of the console wherein all commands are display and can be re-chosen by double clicking. Does a similar feature exist with Windows and Rgui? Or have I missed it somewhere? Thank you. [[alternative HTML version deleted]] ___

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread Marc Schwartz
Thanks Gabor. Nice solution. Marc On Thu, 2007-11-15 at 12:35 -0500, Gabor Grothendieck wrote: > We can append a row of 0's to handle that case: > > with(rle(as.vector(rbind(prova, 0))), table(lengths[values == 1])) > > > > On Nov 15, 2007 11:36 AM, Marc Schwartz <[EMAIL PROTECTED]> wrote: >

Re: [R] Multiply each column of array by vector component

2007-11-15 Thread Benilton Carvalho
?sweep b On Nov 15, 2007, at 12:50 PM, [EMAIL PROTECTED] wrote: > Hi, > > I've got an array, say with i,jth entry = A_ij, and a vector, say with > jth > entry= v_j. I would like to multiply each column of the array by the > corresponding vector component, i,e. find the array with i,jth entry >

Re: [R] Multiply each column of array by vector component

2007-11-15 Thread Gabor Grothendieck
On Nov 15, 2007 12:50 PM, <[EMAIL PROTECTED]> wrote: > Hi, > > I've got an array, say with i,jth entry = A_ij, and a vector, say with jth > entry= v_j. I would like to multiply each column of the array by the > corresponding vector component, i,e. find the array with i,jth entry > > A_ij * v_j > >

[R] sample nth day data in each month

2007-11-15 Thread Carles Fan
Dear all i have a time series containing trading dates and historical stock prices: Date Price 10-Jan-2007 100 11-Jan-2007 101 13-Jan-2007 99 .. .. .. 10-Nov-2007 200 i want to sample every 21st data of each month: 21-Jan-2007 101 21-Feb-2007 111 21-Mar-2007 131 ..

[R] Multiply each column of array by vector component

2007-11-15 Thread M . T . Charemza
Hi, I've got an array, say with i,jth entry = A_ij, and a vector, say with jth entry= v_j. I would like to multiply each column of the array by the corresponding vector component, i,e. find the array with i,jth entry A_ij * v_j This seems so basic but I can't figure out how to do it without a lo

Re: [R] kalman filter estimation

2007-11-15 Thread Paul Gilbert
Giovanni Petris wrote: > Kalman filter for general state space models, especially in its naive > version, is known for its numerical instability. This is the reason > why people developed square root filters, based on Cholesky > decomposition of variance matrices. In package dlm the implementati

[R] Error with read.delim & read.csv

2007-11-15 Thread Peter Waltman
Hi - I'm reading in a tab delimited file that is causing issues with read.delim. Specifically, for a specific set of lines, the last entry of the line is misread and considered to be the first entry of a new row (which is then padded with 'NA's' ). Specifically: tmp <- read.delim( "troub

Re: [R] kalman filter estimation

2007-11-15 Thread Paul Gilbert
[EMAIL PROTECTED] wrote: > Hi, > > Following convention below: > y(t) = Ax(t)+Bu(t)+eps(t) # observation eq > x(t) = Cx(t-1)+Du(t)+eta(t) # state eq > > I modified the following routine (which I copied from: > http://www.stat.pitt.edu/stoffer/tsa2/Rcode/Kall.R) to accommodate u(t), an > exoge

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread A M Lavezzi
thank you. I did not think about the case of overlapping of 1's from the end of one column to the start of the next, this would actually be a problem In the simulations I am running each column corresponds to the path followed by an agent across states of a stochastic process, so I would like t

Re: [R] combine two dataframe

2007-11-15 Thread Greg Snow
Here is another approach: > tmp <- expand.grid( 1:nrow(B), 1:nrow(A) ) > out <- cbind( A[tmp[,2],], B[tmp[,1],] ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL P

[R] font formating

2007-11-15 Thread José Alberto Monteiro
I am tryindo to do a very simple thing but cannont find how to do it anywhere. I need to formap part of my title as subscript ans superscript. How can I do it? Thanks a lot in advance José -- MSc José Alberto F. Monteiro Botanisches Institut Universität Basel [[alternative HTML version d

Re: [R] ESRI Shapefile for EU-25

2007-11-15 Thread Greg Snow
Here are some sites that I found with maps of europe (or more, but eourope is included). I don't know how up to date these are, so check them out for yourself: http://www.vdstech.com/map_data.htm http://openmap.bbn.com/data/shape/timezone/ http://arcdata.esri.com/data_downloader/DataDownloader?p

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread Thibaut Jombart
Thomas Frööjd wrote: >Not sure i explained it good enough. Ill try with an example > >say > >x=[3,3,4,4,4,4,5,5,6,8] >z=[3,4,4,5,5] > >what i want to get after removing z from x is something like >x=[3,4,4,6,8] > > >On Nov 15, 2007 3:29 PM, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > >>On N

[R] Plot problem

2007-11-15 Thread affy snp
Dear list, I have a question about using plot(). I tried the code: https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] counting strings of identical values in a matrix

2007-11-15 Thread A M Lavezzi
Dear Marc thank you so much! One thing: writing xx=[1,2,1,1] is not a typo: I read it as the count of runs of different length starting from 1. In "prova" I have 1 run of length one, 2 runs of length two, 1 run of length three and 1 run of length four. Can I abuse of your time and ask how to

[R] quadratic solver, constrained problem

2007-11-15 Thread Sven Lautenbach
Dear all, I am locking for a quadratic solver in R beeing able to solve the following sort of problem: minimize || y - Xmatrix u ||^2     subject to:     Amatrix u <= Bbound and u >= lowbound While the functions pcls{mgcv} and solve.QP{quadprog} can handle the first part of the con

Re: [R] Romoving elements from a vector. Looking for the opposite of c(), New user

2007-11-15 Thread Thomas Frööjd
Not sure i explained it good enough. Ill try with an example say x=[3,3,4,4,4,4,5,5,6,8] z=[3,4,4,5,5] what i want to get after removing z from x is something like x=[3,4,4,6,8] On Nov 15, 2007 3:29 PM, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > > On Nov 15, 2007, at 9:15 AM, Thomas Fröö

  1   2   >