Re: [R] Vegan dataframe not acting nicely

2008-04-11 Thread Gavin Simpson
On Thu, 2008-04-10 at 20:59 -0400, stephen sefick wrote: > This is what my data looks like > > DOC TOC TKN > RM119mFeb-06 1 23 > RM61mFeb-06 246 > > I have this both in a .csv and .txt I have read this in with Your data can'

Re: [R] Types in grouped multi-panel (lattice) xyplot

2008-04-11 Thread Dieter Menne
Deepayan Sarkar gmail.com> writes: > > Try > > xyplot(val ~ loc | mouse, data = df, > >groups=valtype, > >type=c("p","l"), >distribute.type = TRUE, > >col=c("black", "blue")) For all who like me had difficulties finding distribute.type in the docs: it is document

[R] error from building a package

2008-04-11 Thread Aimin Yan
I am trying someone's example to build a R package, but I get some errors, Can someone help me to figure it out? thanks, * using log directory '/home/aiminy/myrpackages/roots.Rcheck' * using R version 2.6.1 (2007-11-26) * checking for file 'roots/DESCRIPTION' ... OK * this is package 'roots' ver

Re: [R] Vegan plotting- color help

2008-04-11 Thread Gavin Simpson
On Thu, 2008-04-10 at 23:34 -0400, stephen sefick wrote: > I have looked all over the internet for being able to color sites > differently in a plot of an MDS (metaMDS)- I would like to color the > different sites in the ordination plot (plot or ordiplot). I have set > the matrix up so that my si

[R] Error in fromchar(as.character(x)) : character string is not in a standard unambiguous format

2008-04-11 Thread Bob Green
Hello, I was hoping for advice regarding resolving the above error. I have a csv file that contains the following variable: $ Order.Made.Date : Factor w/ 299 levels "1-Apr-08","1-Aug-05",..: 278 285 91 286 159 132 108 261 282 147 ... I want to calculate a variable named F.length, whic

Re: [R] two graphs in one figure?

2008-04-11 Thread Jim Lemon
Anne-Katrin Link wrote: > Dear all, > > how can I plot a line graph and a bar graph in one single figure? I tried > to combine "barplot" and "plot". Even though they both have the same > x-values (1 to 55), it just doesnt look as if they match in their scale > (the barplot is much wider than t

Re: [R] Adding average into a matplot?

2008-04-11 Thread -Halcyon-
Thanks all for your online help and emails. It works fine now! H -Halcyon- wrote: > > Hi all, > > > I have a matrix which is filled with simulation results for several years. > Example of an output (7 years, 4 simulations): > > [,1] [,2] [,3] [,4] > [1,] 500 500 500 500 > [2,

[R] Help load a package into R

2008-04-11 Thread Rasanga Ruwanthi
Dear R List, I want to download kinship_1.2_S.tar.gz in http://mayoresearch.mayo.edu/mayo/research/biostat/splusfunctions.cfm to R. Once save this file to C:\, how I could load into R? I am working in Windows XP. Usually what I do is, I go to "packages" and then "install packages from local zip

Re: [R] Help load a package into R

2008-04-11 Thread Prof Brian Ripley
There is a 'kinship' package on CRAN, with DESCRIPTION file Package: kinship Version: 1.1.0-19 Date: 2008-2-19 Title: mixed-effects Cox models, sparse matrices, and modeling data from large pedigrees Author: Beth Atkinson ([EMAIL PROTECTED]) for pedigree functions. Terry Therneau ([EMAIL

Re: [R] Help load a package into R

2008-04-11 Thread Rasanga Ruwanthi
Thanks very much Paul. I found that I could install it by following "Packages" and then "install packages". However, I am not sure it is that latest version. Can Dr Terry Therneau confirm this please? Thanks Ruwanthi - Original Message From: Paul Hiemstra <[EMAIL PROTECTED]> To: Ra

Re: [R] error from building a package

2008-04-11 Thread Duncan Murdoch
On 11/04/2008 3:59 AM, Aimin Yan wrote: > I am trying someone's example to build a R package, > but I get some errors, Can someone help me to figure it out? There is one error with a fairly clear error message: > Error in firstlib(which.lib.loc, package) : >Tcl/Tk support is not available o

Re: [R] Error in fromchar(as.character(x)) : character string is not in a standard unambiguous format

2008-04-11 Thread Bob Green
Brian, Thanks for your reply. The data I have was downloaded from a government database so it now seems that the problem is how to convert all the records in the format '1-Apr-08' to the format 2008-04-11. I can ask the person working on the new version of this database whether they will use

[R] Odp: How to refer to rows using a vector of row names ?

2008-04-11 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 11.04.2008 12:46:11: > Hi, > > How to refer to rows using a vector of row names ? Not sure what you mean but rownames(data.frame) %in% vector of row names shall give you numbers of rows, which you can use for subsetting Regards Petr > > Thanks > Stanley >

[R] R_alloc vs. malloc

2008-04-11 Thread Søren Højsgaard
Dear list I have two (trivial) memory-questions related to a call with .C: If I allocate memory with R_alloc in a C-program (called with .C), will that memory "be taken from" the "available memory pool" (of a maximum of 4gb?) which R can allocate? (This is the impression I get from "Writing R e

Re: [R] Error in fromchar(as.character(x)) : character string is not in a standard unambiguous format

2008-04-11 Thread Prof Brian Ripley
On Fri, 11 Apr 2008, Bob Green wrote: > Brian, > > > Thanks for your reply. The data I have was downloaded from a > government database so it now seems that the problem is how to > convert all the records in the format '1-Apr-08' to the format 2008-04-11. ?as.Date tells you how: as.Date("1-Apr-0

Re: [R] Help load a package into R

2008-04-11 Thread Peter Dalgaard
Rasanga Ruwanthi wrote: > Thanks very much Paul. > > I found that I could install it by following "Packages" and then "install > packages". However, I am not sure it is that latest version. Can Dr Terry > Therneau confirm this please? > People do put information up for you to actually READ!

Re: [R] Error in fromchar(as.character(x)) : character string is not in a standard unambiguous format

2008-04-11 Thread Prof Brian Ripley
You need to give the format -- '1-Apr-08' might mean 2008-04-01 or 2001-04-08, and R refuses to guess. Please *do* read the help file (e.g. as.Date) before posting: the international standard format is 2008-04-11, and Australia has adopted that standard. On Fri, 11 Apr 2008, Bob Green wrote:

Re: [R] Help load a package into R

2008-04-11 Thread Paul Hiemstra
Rasanga Ruwanthi wrote: > Dear R List, > > I want to download kinship_1.2_S.tar.gz in > http://mayoresearch.mayo.edu/mayo/research/biostat/splusfunctions.cfm > to R. Once save this file to C:\, how I could load into R? I am working in > Windows XP. Usually what I do is, I go to "packages" and the

Re: [R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Ng Stanley
I tried that, it will work well if the vector contain unique row names. However, my vector contain duplicate row names. On Fri, Apr 11, 2008 at 6:53 PM, Petr PIKAL <[EMAIL PROTECTED]> wrote: > Hi > > > [EMAIL PROTECTED] napsal dne 11.04.2008 12:46:11: > > > Hi, > > > > How to refer to rows using

Re: [R] Help load a package into R

2008-04-11 Thread Peter Dalgaard
Paul Hiemstra wrote: > Rasanga Ruwanthi wrote: > >> Dear R List, >> >> I want to download kinship_1.2_S.tar.gz in [.] >> From the website of the Mayo Clinic: >> >> """Although we realize that some will not have the expertise or perhaps >> the software to do the compilation, particularly

[R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Ng Stanley
Hi, How to refer to rows using a vector of row names ? Thanks Stanley [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.

Re: [R] Error in fromchar(as.character(x)) : character string is not in a standard unambiguous format

2008-04-11 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 11.04.2008 12:47:57: > Brian, > > > Thanks for your reply. The data I have was downloaded from a > government database so it now seems that the problem is how to > convert all the records in the format '1-Apr-08' to the format 2008-04-11. There is no need to

Re: [R] strsplit and sapply

2008-04-11 Thread Henrique Dallazuanna
Try: sapply(strsplit(TEXT, ';'), '[', 1) On Fri, Apr 11, 2008 at 8:12 AM, Dennis Fisher <[EMAIL PROTECTED]> wrote: > Colleagues, > > I have some text: >TEXT<- c("a", "bb;ccc", ";e;ff") > > I want to retrieve the portion of each element before the first > semicolon. I can

Re: [R] strsplit and sapply

2008-04-11 Thread Dimitris Rizopoulos
check this: TEXT <- c("a", "bb;ccc", ";e;ff") SPLIT <- strsplit(TEXT, ";") sapply(SPLIT, "[", 1) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +3

Re: [R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Petr PIKAL
Hi if you want to refer your data frame duplicated times then table(your vector) gives you unique names and number of occurrences. Then you can use the unique names for selection and values from table to replication. Regards Petr [EMAIL PROTECTED] [EMAIL PROTECTED] napsal dne 11.04.2008 13:

[R] strsplit and sapply

2008-04-11 Thread Dennis Fisher
Colleagues, I have some text: TEXT<- c("a", "bb;ccc", ";e;ff") I want to retrieve the portion of each element before the first semicolon. I can split each element using strsplit: SPLIT <- strsplit(TEXT, ";") This yields: > SPLIT [[1]] [1] "a" [[2]] [1] "bb

Re: [R] strsplit and sapply

2008-04-11 Thread Jonathan Baron
Here is a command I wrote to get the part of the email address before the @ sign. It works, but I don't know why. The variable called email is a vector of email addresses (not yet in character form, so that is why I need "as character"). names(Score) <- sapply(email,function(x) (strsplit(as.cha

Re: [R] densities from a list with data.frames

2008-04-11 Thread Richard . Cotton
> I have a list which consists of data frames (all data frames have the same > amount and type of columns but different length). > Now, I'd like to calculate for each data frame in the list the > density function > of the values of the fist column ($V1). > > This list could be an example: > >

Re: [R] R_alloc vs. malloc

2008-04-11 Thread Prof Brian Ripley
On Fri, 11 Apr 2008, Søren Højsgaard wrote: Dear list I have two (trivial) memory-questions related to a call with .C: On Windows, I presume from past questions from yourself. The answers really are completely Windows-specific, so please do remember to tell us your OS! If I allocate memor

Re: [R] function to calculate networkdays?

2008-04-11 Thread Henrique Dallazuanna
Try: networkdays <- function(start, end, holidays) { dates <- seq(as.Date(start), as.Date(end), by="day") if(missing(holidays))holidays <- 0 else holidays <- length(holidays) sum(as.numeric(format(dates, "%w") > 1)) - holidays } networkdays("2008-04-01", "2008-04-30") networkdays("2008-04-01",

[R] import user-defined missings

2008-04-11 Thread toater
Hi, How can I import user-defined missings from Spss? It works for me to import spss datasets via library(foreign) with read.spss or via library Hmisc by (spss.get). But no matter which way I do import the data, user-defined missings from Spss are always lost. (it makes no difference if there

Re: [R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Philipp Pagel
On Fri, Apr 11, 2008 at 07:00:10PM +0800, Ng Stanley wrote: > I tried that, it will work well if the vector contain unique row names. > However, my vector contain duplicate row names. how about # generate toy data frame d = data.frame(x=1:10, y=10:1) # set up a vector of row names v = c('1','3','

Re: [R] densities from a list with data.frames

2008-04-11 Thread Antje
Of course, I know, but I cannot apply the function "density" to a data frame (which is the element of the list) but to a vector coming from a data frame. That's my problem I'd like to solve... [EMAIL PROTECTED] schrieb: >> I have a list which consists of data frames (all data frames have the

[R] densities from a list with data.frames

2008-04-11 Thread Antje
Hi there, I have a list which consists of data frames (all data frames have the same amount and type of columns but different length). Now, I'd like to calculate for each data frame in the list the density function of the values of the fist column ($V1). This list could be an example: l <- lis

Re: [R] import user-defined missings

2008-04-11 Thread Prof Brian Ripley
You would need to study the source code and make appropriate changes. Had you supplied an example (see the footer of this message), some kind soul might have been prepared to make a patch for you. On Fri, 11 Apr 2008, [EMAIL PROTECTED] wrote: > Hi, > > How can I import user-defined missings fro

Re: [R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Ng Stanley
That should work well too if my row names are integers only. However, they are strings of alphanumeric characters On Fri, Apr 11, 2008 at 7:56 PM, Philipp Pagel <[EMAIL PROTECTED]> wrote: > On Fri, Apr 11, 2008 at 07:00:10PM +0800, Ng Stanley wrote: > > I tried that, it will work well if the vect

Re: [R] densities from a list with data.frames

2008-04-11 Thread Charilaos Skiadas
Did you try Richie's suggestion? The x[,1] part will pick out the first column of the data frame. Seems to do exactly what you asked for. Haris Skiadas Department of Mathematics and Computer Science Hanover College On Apr 11, 2008, at 7:57 AM, Antje wrote: > Of course, I know, but I cannot app

Re: [R] [SPAM] - Re: Relational Databases or XML? - Bayesian Filter detected spam

2008-04-11 Thread Doran, Harold
This does seem excellent, I should check CRAN more often than I do. OTOH, I really like element tree in python. One benefit there (for those who care) is that you can create an executable using py2exe that others can use if they don't have python on their machine. This is like sprinkling some "fair

Re: [R] How to refer to rows using a vector of row names ?

2008-04-11 Thread Philipp Pagel
> That should work well too if my row names are integers only. However, they > are strings of alphanumeric characters This has nothing to do with integers. Please try it. cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Lehrstuhl für Genomorientierte B

Re: [R] densities from a list with data.frames

2008-04-11 Thread Antje
Probably, I should read emails more carefully... sorry!!! Of course, this solves my problem. Thank you very much! Charilaos Skiadas schrieb: > Did you try Richie's suggestion? The x[,1] part will pick out the first > column of the data frame. Seems to do exactly what you asked for. > > Haris S

[R] Added Variable Plot for Cox Regression

2008-04-11 Thread Dalton, Jarrod
Greetings, I would like to know if anyone has had experience creating an added variable plot for a coxph model. This method is outlined - with tounge in cheek, quite rigorously - in Lindkvist (1999). Thanks much, Jarrod Dalton Biostatistician Department of Quantitative Health Science

Re: [R] Vegan plotting- color help

2008-04-11 Thread stephen sefick
that worked just fine. I missed the fact that the scores could be extracted- I am learning how to think like a programmer it is just taking time. Thank you very much for your help this is the code that I settled on: sol <- metaMDS(x, distance="jaccard") shrink <- FALSE ## see argument shrink

[R] time series regression

2008-04-11 Thread bereket weldeslassie
Hi Everyone, I am doing a time series regression (one dependent time series variable, 7 independent time series variables and 32 annual observations). I have the problem of cointegration, autocorrelation and multicollinearity. I am considering an error correction model of the form: diff(lnY(t))=a+

Re: [R] Vegan plotting- color help

2008-04-11 Thread Gavin Simpson
On Fri, 2008-04-11 at 10:43 -0400, stephen sefick wrote: > that worked just fine. I missed the fact that the scores could be > extracted- I am learning how to think like a programmer it is just > taking time. Thank you very much for your help > > this is the code that I settled on: > > sol <-

[R] Read text file subsetting rows

2008-04-11 Thread Zev Ross
Hi All, Can anyone direct me to a read function in R that will allow me to only read in rows of a text file that begin with a particular value such as the data below. I would read the entire file in and then limit, but the files were constructed such that the first two letters determine how ma

Re: [R] for loop help

2008-04-11 Thread Greg Snow
Tom, Bill Venables gave you references to important tools for dealing with for loops in R and they may be all the solution that you need. But here is a little more detail on what is going on in case you want/need more control in the future. Note that the R for loop is what some programers call

[R] Format regression result summary

2008-04-11 Thread Thiemo Fetzer
Hello to the whole group. I am a newbie to R, but I got my way through and think it is a lot easier to handle than other software packages (far less clicks necessary). However, I have a problem with respect to the summary of regression results. The summary function gives sth like: Residuals:

Re: [R] Read text file subsetting rows

2008-04-11 Thread Charles C. Berry
On Fri, 11 Apr 2008, Zev Ross wrote: > Hi All, > > Can anyone direct me to a read function in R that will allow me to only > read in rows of a text file that begin with a particular value such as > the data below. I would read the entire file in and then limit, but the > files were constructed suc

Re: [R] Format regression result summary

2008-04-11 Thread Chuck Cleland
On 4/11/2008 12:05 PM, Thiemo Fetzer wrote: > Hello to the whole group. > > I am a newbie to R, but I got my way through and think it is a lot easier to > handle than other software packages (far less clicks necessary). > > However, I have a problem with respect to the summary of regression resul

[R] Fwd: time series regression

2008-04-11 Thread bereket weldeslassie
Dear, I am doing a time series regression (one dependent time series variable, 7 independent time series variables and 32 annual observations). I have the problem of cointegration, autocorrelation and multicollinearity. I am considering an error correction model of the form: diff(lnY(t))=a+b1*lnY(

[R] dprep, nnet, qda

2008-04-11 Thread Rajdeep Das
Hello, I am trying to use dprep for my data analysis. Please let me know if feature selection methods such as sfs or sffs can be used with methods qda, nnet. PDF guide does not say anything about the methods. However, I know that the package does require nnet as part of its installation. Thanks in

Re: [R] Types in grouped multi-panel (lattice) xyplot

2008-04-11 Thread Deepayan Sarkar
On 4/11/08, Dieter Menne <[EMAIL PROTECTED]> wrote: > Deepayan Sarkar gmail.com> writes: > > > > Try > > > xyplot(val ~ loc | mouse, data = df, > > >groups=valtype, > > >type=c("p","l"), > >distribute.type = TRUE, > > > >col=c("black", "blue")) > > For all wh

Re: [R] Vegan plotting- color help

2008-04-11 Thread hadley wickham
> ## dummy group ID > group <- sample(rep(1:3, each = 4)) > ## create dummy grouping factor > group <- factor(group, labels = paste("group", 1:3)) > group > > # vector of colours > cols <- c("red", "blue", "green") > ## dummay data to plot > datx <- runif(12) > daty <- runif(12) > > ## p

[R] Legend position outside

2008-04-11 Thread Edwin Sendjaja
Hello, Is it possible to get the legend box outside the graphic? Kind regards, Edwin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

[R] Legend position outside

2008-04-11 Thread Edwin Sendjaja
Hello, Is it possible to get the legend box outside the graphic? Kind regards, Edwin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

[R] EM algorithm for multiple-locus haplotypes frequencies

2008-04-11 Thread Marcin Kozak
Hi all, I've been looking in R for an EM algorithm adjusted for multiple-locus haplotypes frequencies, but failed in 100%. Has anyone heard of anything of this kind in R? Thanks in advance, Marcin __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] Legend position outside

2008-04-11 Thread Greg Snow
Yes, here is one way: > plot(1:10, pch=1:2) > par(xpd=NA) > tmp.u <- par('usr') > legend(tmp.u[1], tmp.u[4], xjust=0, yjust=0, c('a','b'), pch=1:2) > You will probably want to increase the margins for a real case. See ?par and the 'xpd' entry for details on the clipping and ?legend for more det

[R] How to match some patterns in a matrix

2008-04-11 Thread ss
Dear all, I have a data frame called x2, which looks like: > dim(x2) [1] 2237 2 > x2[1:4,1:2] name id 1 STye hggd3 2 STy2 bffbd2 3 qw22ebdbdbbbd7 4 deffrdffnnshfd3 and a vector called

[R] Questions related to plotting boxplots of time series data

2008-04-11 Thread Thomas Adams
List, I have looked through several R books and searched the web to find answers to my questions with no results. I have a ensembles of time series data (essentially from Monte Carlo simulations) which I would like to summarize as a time series of boxplots. I don't know how to do this and I am

[R] Multinomial Logit Regression

2008-04-11 Thread _Fede_
Hi all, I have a dataset with a response variable with three categories (1, 2, 3) and a lot of continuous variables. I'd like to make a MLR with these variables. I've been watching the libraries nnet and zelig for this purpose but I don't understand them well. I use a training sample data to ma

Re: [R] How to match some patterns in a matrix

2008-04-11 Thread Bert Gunter
1. Strictly speaking, y is a one-column matrix if it has a non-null dim attribute (it also is a vector). 2. ?match or ?"%in%" tells you what to do. x2[x2[["name"]] %in% y,] is what you want. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ss Sen

[R] polygons on scatterplot3d

2008-04-11 Thread Jon Loehrke
Does anyone have any experience plotting complex polygons on a scatterplot3d display? I would like to present some spatially binned data in a 3-d type plot with background polygons (i.e.. a filled coastline map). I can get the coastline onto the plot window as a line type but cannot figur

Re: [R] polygons on scatterplot3d

2008-04-11 Thread Jon Loehrke
This is rather embarrassing, but the solution was fairly simple, thanks to Uwe and Martin for a GREAT PACKAGE. Anyhow, hope somebody else gets inspired at the very least Jon > library(scatterplot3d) > > # get a coastline > library(maps) > library(mapdata) > coast<-map('worldHires', c('usa

Re: [R] How to match some patterns in a matrix

2008-04-11 Thread ss
Dear Bert, Thanks a lot for help. I tried and got: > x2[x2[["name"]] %in% y,] [1] name id <0 rows> (or 0-length row.names) > Any suggestions? Alex On Fri, Apr 11, 2008 at 2:49 PM, Bert Gunter <[EMAIL PROTECTED]> wrote: > 1. Strictly speaking, y is a one-column matrix if it has a non-null dim

[R] SQL INSERT using RMySQL

2008-04-11 Thread Gregory. R. Warnes
Hi All, I've finally gotten around to database access using R. I'm happily extracting rows from a MySQL database using RMySQL, but am having problems appending rows to an existing table. What I *want* to do is to append rows to the table, allowing the database to automatically generate pri

Re: [R] Read text file subsetting rows

2008-04-11 Thread Zev Ross
Chuck, Thanks so much, these both work like a charm. The first method, though, is very, very slow for a large dataset (<100,000) while the second is reasonable in terms of speed. If you or anyone have any ideas for speeding up the import send them my way otherwise the: con2 <- pipe( 'grep "^RD

[R] conditioning inside an lapply

2008-04-11 Thread markleeds
This is probably basic but I want to condition based on the name of the component inside an lapply. So, in the simple example below, if .elem was x i want to do one thing but if it's y a different thing etc. Can someone tell me how to do that without using names(temp) as the thing one sends into t

Re: [R] conditioning inside an lapply

2008-04-11 Thread markleeds
>From: [EMAIL PROTECTED] >Date: 2008/04/11 Fri PM 04:16:56 CDT >To: [EMAIL PROTECTED] >Subject: [R] conditioning inside an lapply in my previous example, the last name in temp should have been z not x. i didn't intend to have duplicate names in temp. I apologize for any confusion that caused. >Th

[R] How to fill out some columns?

2008-04-11 Thread Jorge Velez
Dear R users, I'm working with 2 data sets which look like (for example) dx and dy in the next code: # Seed set.seed(4) # First data frame dx=matrix(rnorm(6*5),ncol=6) colnames(dx)=LETTERS[1:6] # Second data frame dy=matrix(rnorm(3*5),ncol=3) colnames(dy)=c('A','C','E') As you will notice, so

Re: [R] How to fill out some columns?

2008-04-11 Thread markleeds
>From: Jorge Velez <[EMAIL PROTECTED]> >Date: 2008/04/11 Fri PM 04:36:58 CDT >To: R >Subject: [R] How to fill out some columns? below works but my guess is that there's a better way. set.seed(4) dx=matrix(rnorm(6*5),ncol=6) colnames(dx)=LETTERS[1:6] dy=matrix(rnorm(3*5),ncol=3) colnames(dy)=c('

Re: [R] How to estimate a hazard ratio using an external hazard function

2008-04-11 Thread Montserrat Rue
Dear Professor Therneau, We have followed your advice and the results that we have obtained make a lot of sense. Thanks a lot! I would like to check if we took a correct approach to obtain the expected number of events. Since we had the hazard function as continuous (we used splines) we have obt

Re: [R] How to fill out some columns?

2008-04-11 Thread Gabor Grothendieck
Try this: as.matrix(replace(as.data.frame(0 * dx), colnames(dy), dy)) If dx were a data frame already we could eliminate as.data.frame and as.matrix so it would reduce to, in that case: replace(0 * dx, colnames(dy), dy)) # only if dx is data.frame On Fri, Apr 11, 2008 at 5:36 PM, Jorge Vel

Re: [R] conditioning inside an lapply

2008-04-11 Thread Romain Francois
Hi, I have this function (largely based on this post by Thomas Lumley : http://www.opensubscriber.com/message/[EMAIL PROTECTED]/6984642.html) > yapply function(X,FUN, ...) { index <- seq(length.out=length(X)) namesX <- names(X) if(is.null(namesX)) namesX <- rep(NA,length(X)) FUN <- m

[R] image processing and plotting at video rates ?

2008-04-11 Thread Philipp Fechteler
Hello R user I am using R now for some time and I like it a lot. I just started a new project where I am working with video streams at a resolution of 1024 x 768 pixels. I am reading the images out of a big raw file containing the uncompressed data. I do this via "readBin". As far as I have fo

Re: [R] QP.solve, QPmat, constraint matrix, and positive definite

2008-04-11 Thread jpolo
i found the posdefify, nearcor, and nearPD functions, but can't get things to work. when i tried nearPd, it gave me an dpoMatrix, but i don't know if it would have worked because it said: "31 x 31 Matrix of class "dpoMatrix" " right between $mat and the actual matrix and i don't know how to cut tha

Re: [R] SQL INSERT using RMySQL

2008-04-11 Thread Chris Stubben
Greg, If you have a MySQL table with an auto_increment field, you could just insert a NULL value into that column and the database will increment the key (it may not work in SQL STRICT mode, I'm not sure). I don't think there's any way to specify which columns you want to load data into using db

Re: [R] Legend position outside

2008-04-11 Thread Edwin Sendjaja
Hello Gred, I try to read R-Reference, but I cant understand it. What does par (xpd=NA)? and par('usr')) mean? Thank you. Kind regards, Edwin Am Freitag, 11. April 2008 19:19:24 schrieben Sie: > Yes, here is one way: > > plot(1:10, pch=1:2) > > par(xpd=NA) > > tmp.u <- par('usr') > > l

[R] Mapping file-Legend- from 2 Files/Tables

2008-04-11 Thread Edwin Sendjaja
Hello, I have got 2 Tables from different files: Table 1 (lets say file: Salesman.data) | ID | User_ID --- 1| 1 | 4 2| 2 | 6 3| 3 | 7 4| 4 | 2 5| 5 | 3 Table2 (file: Employee.data)

[R] Rmpi error messages

2008-04-11 Thread Elizabeth Bruch
Dear all, I installed Rmpi (without error messages), but when I try to load the library in R I get the following error message: > library(Rmpi) Error in dyn.load(file, ...) : unable to load shared library '/Users/ebruch/Library/R/2.6/library/ Rmpi/libs/i386/Rmpi.so': dlopen(/Users/ebruc