Re: [R] kalman filter estimation

2007-11-15 Thread Prof Brian Ripley
On Thu, 15 Nov 2007, [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),

[R] histogram plot as step function

2007-11-15 Thread Hakim Tafer
Hi I want to plot a histogram (not cumulative!) as a step-function. Any idea how achieve this? Thank you __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] what is the right way to obtain frequencies of vector values?

2007-11-15 Thread Dieter Menne
Vlad Skvortsov vss at 73rus.com writes: Let's say I have vector x with positive integer values ranging from 1 to N. I need to obtain another vector y of size N where y[i] contains the number of times value i occurs in x. It is in a sense similar to hist() (with appropriate number of breaks)

Re: [R] Error while calculating AOV

2007-11-15 Thread Dieter Menne
apsawant apsawant at yahoo.com writes: I am trying to run a simple example script to calculate AOV. Below is the script file (aov.R) I am trying to execute: aov.R -- aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color +

[R] negative binomial lmer

2007-11-15 Thread H. Skaug
If lmer() does not do it, you can try: http://otter-rsch.com/admbre/examples/glmmadmb/glmmADMB.html It handles negative binomial responce (but you may have to remove data entries involving NA manually). Regards, hans Hi I am running an lmer which works fine with family=poisson mixed.model

[R] read complicated file

2007-11-15 Thread William Simpson
Dear R experts, I have been given data files in the following configuration and have been puzzling about how to read them in. First I will give a snippet of the beginning of file: Data File: W Para File: GABOR_0.gor v 10.6, Date : 29/10/2007 Time : 13:33 3.00 5.000 Noise SD(deg):

Re: [R] histogram plot as step function

2007-11-15 Thread David Scott
On Thu, 15 Nov 2007, Hakim Tafer wrote: Hi I want to plot a histogram (not cumulative!) as a step-function. Any idea how achieve this? Thank you Well if I understand you correctly you can do this. x-rnorm(100) par(mfrow=c(2,1)) hist(x) histRes - hist(x,plot=FALSE) xvals - histRes$breaks

Re: [R] convex optimization package for R, specifically semidefinite programming

2007-11-15 Thread Hans W Borchers
Hi there, I do assume you are talking about the CVXOPT (and CVXMOD) Python package(s). Please note that CVXOPT only contains _interfaces_ to the solvers in MOSEK, because these are commercial products (as Roger Koenker already has mentioned). There appear to be some Python/Scipy-based solvers

[R] Package to make stepwise model selection using F or Chisq test

2007-11-15 Thread Ronaldo Reis Junior
Hi, I looking for a method that use F or Chisq test instead of AIC in a stepwise modelo selection. I try the grasp package using the grasp.step.anova, but It dont work. library(grasp) Carregando pacotes exigidos: gam Carregando pacotes exigidos: splines Carregando pacotes exigidos: mda

Re: [R] problem with png()

2007-11-15 Thread john seers (IFR)
Hi Ingo Your code worked for me and I did not lose the title. Not much help I know but my session details are below to compare. Windows XP ... Regards JS sessionInfo() R version 2.6.0 (2007-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United

Re: [R] negative binomial lmer

2007-11-15 Thread Bill.Venables
lmer will work with negative binomial models, provided you specify an explicit, scalar value for theta. Rather than family = negative.binomial(theta = x) try something like family=negative.binomial(theta = 2.5) (or whatever you wish specify as theta). Bill Venables. -Original Message-

Re: [R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
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, Sigalit. On 11/13/07, Julian Burgos [EMAIL PROTECTED] wrote:

Re: [R] Unable to save plot as .pdf , ps , eps

2007-11-15 Thread Benilton Carvalho
http://tolstoy.newcastle.edu.au/R/e2/help/07/10/27155.html b On Nov 15, 2007, at 8:11 AM, Luis Ridao Cruz wrote: R-help, Whenever I try to save a plot with extension .pdf , ps or eps I get the following error/warning message: plot(rnorm(10)) savePlot(test,type=pdf) Error in

[R] Unable to save plot as .pdf , ps , eps

2007-11-15 Thread Luis Ridao Cruz
R-help, Whenever I try to save a plot with extension .pdf , ps or eps I get the following error/warning message: plot(rnorm(10)) savePlot(test,type=pdf) Error in savePlot(test, type = pdf) : Invalid font type In addition: Warning messages: 1: In savePlot(test, type = pdf) : font family not

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

2007-11-15 Thread Charilaos Skiadas
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 contains observations on a variable. To x I want to append all observations from y and remove all from z. For appending c() is easily used x - c(x,y) But how do I remove all

Re: [R] generate combination set

2007-11-15 Thread Charilaos Skiadas
I must be missing something. What's wrong with: combn(set, 2) or if we must t(combn(set,2)), optionally with a function argument in the combn call if something is to be done with the pairs? So if you really wanted the outputs to be AB,AC etc, you would do: combn(set,2, paste, collapse=)

[R] Re : Unable to save plot as .pdf , ps , eps

2007-11-15 Thread justin bem
I simply use pdf(test.pdf) plot(rnorm(10)) dev.off() postscript(test.ps) plot(rnorm(10)) dev.off() Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 - Message d'origine De : Luis Ridao Cruz [EMAIL

Re: [R] no applicable method for names

2007-11-15 Thread John Kane
Actually names(z) works for me. More seriously I don't seem to have a problem with XP and 2.6.0. It may be a slightly wonky installation. You might want to try a re-install and see what happens. --- Schiller Judith 1541 EB [EMAIL PROTECTED] wrote: hi, after installing R-2.6.0 the

[R] counting strings of identical values in a matrix

2007-11-15 Thread A M Lavezzi
Hello I have this problem. I have a large matrix of this sort: prova [,1] [,2] [,3] [,4] [1,]3333 [2,]3331 [3,]1333 [4,]1113 [5,]3113 [6,]3113 [7,]1313 [8,]1333

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

2007-11-15 Thread Tom Minka
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 orientation parameter for both, or the second one

Re: [R] font formating

2007-11-15 Thread Eik Vettorazzi
you can do this with expression() as in plot(1:2,1:2,main=expression(x[k[j]])) see ?plotmath for some more possibilities of formating mathematical expressions. hth. José Alberto Monteiro schrieb: I am tryindo to do a very simple thing but cannont find how to do it anywhere. I need to

[R] Ancova doesn't return test statistics

2007-11-15 Thread Johan A. Stenberg
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 variable Seed reduction due to herbivory (SR) = continuous explanatory variable

Re: [R] font formating

2007-11-15 Thread Eik Vettorazzi
you may read, as suggested, ?plotmath and look at the examples example(plotmath) José Alberto Monteiro schrieb: Thanks a lot! Can I use it inside text( )? Like text(expression=()) -- MSc José Alberto F. Monteiro Botanisches Institut Universität Basel -- Eik Vettorazzi Institut für

[R] Problems working with large data

2007-11-15 Thread pedrosmarques
Hi, I'm working with a numeric matrix with 55columns and 581012 rows and I'm having problems in allocation of memory using some of the functions in R: for example lda, rda (library MASS), princomp(package mva) and mvnorm.etest (energy package). I've read tips to use less memory in

Re: [R] combine two dataframe

2007-11-15 Thread sun
Well, I admit I did not make it very clear. it was actually not sqldf that failed to be installed, that fact is that when I install sqdf, R did not find RSQLite(I have to check ) package which sqldf depends on on my linux box. I am using R-2.5/linux. Not sure if upgrading to 2.6 may help or

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

2007-11-15 Thread Marc Schwartz
On Thu, 2007-11-15 at 15:51 +0100, A M Lavezzi wrote: Hello I have this problem. I have a large matrix of this sort: prova [,1] [,2] [,3] [,4] [1,]3333 [2,]3331 [3,]1333 [4,]1113 [5,]3113 [6,]

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

2007-11-15 Thread Marc Schwartz
On Thu, 2007-11-15 at 16:36 +0100, Johan A. Stenberg 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 variable Seed

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ööjd

[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

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

2007-11-15 Thread affy snp
Dear list, I have a question about using plot(). I tried the code: pdf(mel_chr_all_13cancer_cghFLasso_all.pdf, height=6, width=11);plot( Disease.FL, index=1:4, type=All);dev.off(); and it went through well which outputed 4 plots for 4 samples in one page. But if I increase the numbers of

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 Nov 15, 2007, at

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/

[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

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

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

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 exogenous

[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

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 implementation

[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

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 This

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 A_ij

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: Ah...OK.

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 of any

[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

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

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

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

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

[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 list of

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

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 the

[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

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

[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

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

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

[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

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 curious if

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 for (i in 1:500){ z[i] - rbinom(1, 1, .6)

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, Sigalit.

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]

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

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:

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 great

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 looks like this:

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

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:

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

[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

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

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

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 9 On Nov

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), and

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 contains

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

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

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:05

[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? w -

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 variable

[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

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)? (length(dd)

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 sample every 21st

[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] 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-Jan-2007 101

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

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

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 should

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): z -

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 ## loop

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 by an

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 somewhat kludgy

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

  1   2   >