[R] Point patterns and igraph

2009-09-08 Thread juanita choo
Hi, I have a data set consisting of the x and y coordinate locations of 1600 points. I would like to generate a graph using the functions in igraph. However the graph making functions in igraph requires the data to be in the form of an adjacency matrix. I'd like some advice on how to convert my

[R] Truncating (not rounding) scientific value in R

2009-09-08 Thread Gundala Viswanath
How can I truncate the scientific value keeping two digits decimal. For example from: 6.95428812397439e-35 into 6.95e-35 -E.W. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2

2009-09-08 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
See the respective help files. The continuity correction only affects the normal approximation in wilcox.test. With this small samples sizes, the default evaluation is exact, so it doesn't change anything. In contrast, kruskal.test is incapable to compute exact values but always uses the

Re: [R] Point patterns and igraph

2009-09-08 Thread Gábor Csárdi
Juanita, On Tue, Sep 8, 2009 at 8:02 AM, juanita choojuanitac...@gmail.com wrote: Hi, I have a data set consisting of the x and y coordinate locations of 1600 points. I would like to generate a graph using the functions in igraph. However the graph making functions in igraph requires the

[R] Re : calling combinations of variable names

2009-09-08 Thread justin bem
may be this can work testfun-function(x) { rval= k-length(x) for (i in 1: k) rval-paste(rval,x[i],sep=-) rval } v1-paste(evalr,1:4,sep=) eval-expand.grid(w=v1,x=v1,y=v1,z=v1) n-dim(eval)[1] results-rep(, n) for (i in 1:n) { row-unique(unlist(eval[i,])) if (length(row)=3)

Re: [R] Omnibus test for main effects in the face ofaninteraction containing the main effects.

2009-09-08 Thread Mark Difford
Hi John, When Group is entered as a factor, and the factor has two levels, the ANOVA table gives a p value for each level of the factor. This does not (normally) happen so you are doing something strange. ## From your first posting on this subject

Re: [R] Truncating (not rounding) scientific value in R

2009-09-08 Thread Daniel Malter
x=0.01345778543577 signif(x,3) - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Gundala Viswanath Gesendet: Tuesday, September 08,

Re: [R] How can I change characteristics of a cca biplot in R

2009-09-08 Thread Gavin Simpson
On Mon, 2009-09-07 at 12:49 +0300, Rousi Heta wrote: Hi, I´m doing cca for a community data set in R and I have made a biplot for my data. Otherwise everything seems to be allright but the biplot is so messy I can´t read it well enough or publish it. I would like to get the row numbers

[R] [R-pkgs] R meets apache ant

2009-09-08 Thread Romain Francois
Hello, This is to announce the first release of the ant R package, which has been pushed to CRAN yesterday, and should reach your mirror and your platform soon. The package provides an R-aware version of the famous build tool from the apache project. http://ant.apache.org/ The package

Re: [R] 3d scatter with trend line and errors

2009-09-08 Thread Uwe Ligges
scatterplot3d() in package scatterplot3d can do, probably also plot3d() in rgl and others. Uwe Ligges oleg lugovoy wrote: Hello, Can anyone suggest a way to draw a plot similar to the example from Matlab (

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
After further investigation it appears that the problem is specific to my Vista PC. I am able to get the correct results using R 2.9.2 on a Window XP 64bit machine. However i do not know why this does not work on my Vista PC. The following was done after rebooting Vista. From CMD.exe I ran the

Re: [R] Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2

2009-09-08 Thread Thomas Farrar
OK, I get it now. Thank you very much! Cheers, Tom On Tue, Sep 8, 2009 at 8:20 AM, Meyners,Michael,LAUSANNE,AppliedMathematics michael.meyn...@rdls.nestle.com wrote: See the respective help files. The continuity correction only affects the normal approximation in wilcox.test. With this

[R] Derivative of nonparametric curve

2009-09-08 Thread FMH
Dear All, I'm looking for a way on computing the derivative of first and second order of a smoothing curve produced by a nonprametric regression. For instance, if we run the R script below, a smooth nonparametric regression curve is produced. provide.data(trawl) Zone92   - (Year == 0 Zone ==

[R] Data in Array

2009-09-08 Thread FMH
Dear All, I have some data which were stored in few  matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15,

Re: [R] Google's R Style Guide (has become S3 vs S4, in part)

2009-09-08 Thread Martin Maechler
Martin Morgan mtmor...@fhcrc.org on Tue, 01 Sep 2009 09:07:05 -0700 writes: spencerg wrote: Bryan Hanson wrote: Looks like the discussion is no longer about R Style, but S3 vs S4? yes nice topic rename! To that end, I asked more or less the same question a

[R] [OT] _ inserted in postings

2009-09-08 Thread Ted Harding
Sorry if this is too OT, but there is a particular relevance to postings to R-help. Of recent times, I have received several postings via R-help (and some other mailing-lists) in which the _ character is inserted where, presumably, a space, , was intended. An example (received this morning) is

Re: [R] Data in Array

2009-09-08 Thread Schalk Heunis
have you tried rbind? On Tue, Sep 8, 2009 at 11:16 AM, FMHkagba2...@yahoo.com wrote: Dear All, I have some data which were stored in few  matrices with different orders. Let have three different matrices a, b and c, which have the same number of column but different number of row. a -

Re: [R] plot positive predictive values

2009-09-08 Thread r2L
Hi, Thanks for the hint! Of course, you are correct. Here is a link with some background for others with tired heads: http://luna.cas.usf.edu/~mbrannic/files/regression/Logistic.html On Sep 4, 1:15 pm, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: You could use a glm with the binomial

[R] Changing font to times for EMF graphics

2009-09-08 Thread Werner Wernersen
Hi, sorry for the simple question. I am usually able to change the font for PDF graphics with pdf.options(family=Times) However, I have found no way yet to get an emf file with a times font. I also tried a detour by using pstoedit to convert a pdf with the desired font to an emf but even there

Re: [R] Changing font to times for EMF graphics

2009-09-08 Thread Prof Brian Ripley
Do you have 'times' in a format suitable for EMF? If so you can select it for win.metafile() as for any other windows() device. You would need a TrueType version, and I suspect you do under the name 'Times New Roman'. See ?windowsFonts: my memory is that family=serif gives you that font.

[R] Very basic question regarding plot.Design...

2009-09-08 Thread Petar Milin
Hello ALL! I have a problem to plot factor (lets say gender) as a line, or at least both line and point, from ols model: ols1 - ols(Y ~ gender, data=dat, x=T, y=T) plot(ols1, gender=NA, xlab=gender, ylab=Y, ylim=c(5,30), conf.int=FALSE) If I convert gender into discrete numeric predictor, and

Re: [R] [OT] _ inserted in postings

2009-09-08 Thread Ted Harding
On 08-Sep-09 10:40:18, Duncan Murdoch wrote: On 08/09/2009 6:09 AM, (Ted Harding) wrote: Sorry if this is too OT, but there is a particular relevance to postings to R-help. Of recent times, I have received several postings via R-help (and some other mailing-lists) in which the _ character

Re: [R] How can I change characteristics of a cca biplot in R

2009-09-08 Thread Jari Oksanen
Gavin Simpson gavin.simpson at ucl.ac.uk writes: On Mon, 2009-09-07 at 12:49 +0300, Rousi Heta wrote: Hi, I´m doing cca for a community data set in R and I have made a biplot for my data. Otherwise everything seems to be allright but the biplot is so messy I can´t read it well

[R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
I have a text file similar to this (separated by spaces): x - DF12 This is an example 1 This DF12 This is an 1232 This is DF14 This is 12334 This is an DF15 This 23 This is an example and I know the field lengths of each variable (there is 5 variables in this data set), which are: varlength -

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Barry Rowlingson
On Tue, Sep 8, 2009 at 12:53 PM, Lauri Nikkinenlauri.nikki...@iki.fi wrote: I have a text file similar to this (separated by spaces): x - DF12 This is an example 1 This DF12 This is an 1232 This is DF14 This is 12334 This is an DF15 This 23 This is an example and I know the field lengths

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Duncan Murdoch
On 9/8/2009 7:53 AM, Lauri Nikkinen wrote: I have a text file similar to this (separated by spaces): x - DF12 This is an example 1 This DF12 This is an 1232 This is DF14 This is 12334 This is an DF15 This 23 This is an example and I know the field lengths of each variable (there is 5

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
Thanks, I tried it but I got varlength - c(2, 2, 18, 5, 18) read.fwf(c:temppi.txt, widths=varlength) V1 V2 V3V4 V5 1 DF 12 This is an exampl e 1 T his 2 DF 12 This is an 1232 T his is 3 DF 14 This is 12334 Thi s is an 4 DF 15 This 23 This is a n exa mple

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread jim holtman
Can you post how you would like it. On Tue, Sep 8, 2009 at 8:07 AM, Lauri Nikkinenlauri.nikki...@iki.fi wrote: Thanks, I tried it but I got varlength - c(2, 2, 18, 5, 18) read.fwf(c:temppi.txt, widths=varlength)  V1 V2                 V3    V4   V5 1 DF 12  This is an exampl e 1 T  his 2

Re: [R] Data in Array

2009-09-08 Thread FMH
Yes, but what actually i want to have is an array that might store these different matrices. - Original Message From: Schalk Heunis schalk.heu...@enerweb.co.za To: FMH kagba2...@yahoo.com Cc: r-help@r-project.org Sent: Tuesday, September 8, 2009 11:16:29 AM Subject: Re: [R] Data in

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Duncan Murdoch
On 9/8/2009 8:07 AM, Lauri Nikkinen wrote: Thanks, I tried it but I got varlength - c(2, 2, 18, 5, 18) read.fwf(c:temppi.txt, widths=varlength) V1 V2 V3V4 V5 1 DF 12 This is an exampl e 1 T his 2 DF 12 This is an 1232 T his is 3 DF 14 This is 12334 Thi s is

[R] RODBC version 1.3-0 crashes with systemtables using SQL server 2000

2009-09-08 Thread Irskens Michael
Dear all, I need to test for the existence of an index on a table. This cannot be done with sqlPrimaryKeys as it is not a primary key. Therefore I select directly from the systemtable of SQL-Server 2000 named sysindexes. This works well with RODBC Version 1.2-5 but not with version 1.3-0. Here

Re: [R] [OT] _ inserted in postings

2009-09-08 Thread Duncan Murdoch
On 08/09/2009 6:09 AM, (Ted Harding) wrote: Sorry if this is too OT, but there is a particular relevance to postings to R-help. Of recent times, I have received several postings via R-help (and some other mailing-lists) in which the _ character is inserted where, presumably, a space, , was

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
Sure, here you go structure(list(V1 = structure(c(1L, 1L, 1L, 1L), .Label = DF, class = factor), V2 = c(12L, 12L, 14L, 15L), V3 = structure(c(4L, 3L, 2L, 1L), .Label = c(This, This is, This is an, This is an example ), class = factor), V4 = c(1L, 1232L, 12334L, 23L), V5 =

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Ben Bolker
I don't think you described your problem precisely. You implied that you wanted the field lengths to be (2,2,18,5,18) -- which is what you got with read.fwf -- but it looks like what you meant is something more like: field 1: first two characters field 2: characters 3-4 field 3: all

Re: [R] Character manipulation using strsplit vectorization

2009-09-08 Thread David Winsemius
On Sep 8, 2009, at 12:39 AM, Steven Kang wrote: Dear R users, Suppose I have a data set with inconsistent names for a field. I desire to make these to consistent names. i.e University of New Jersey, New Jersey Uni, New Jersey University (3 different inconsistent names) to The University

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
This data is from database and the maximum length of a field is defined. I mean that every column has a maximum length and I want to use this maximum length as a separator. So if one cell in that column is shorter than the maximum, cell should be padded with white spaces or something like that.

[R] Inverse Mills in clustered (multilevel) cross-sectional panel data

2009-09-08 Thread saurav pathak
Dear R saviors, kindly address to this problem, I would really appreciate any takers. I am trying to resolve this issue of IMR in clustered (multilevel) cross-sectional panel data for more than two months now,. The characteristics of my dataset are as follows: - some 900 000 individuals -

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread jim holtman
This bears no relationship to what you were first asking. It look like you want to split the leading 4 characters into two groups of two and then split the remaining data into three parts based on numerics in the middle. Is this correct? On Tue, Sep 8, 2009 at 8:15 AM, Lauri

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Duncan Murdoch
On 9/8/2009 8:21 AM, Lauri Nikkinen wrote: This data is from database and the maximum length of a field is defined. I mean that every column has a maximum length and I want to use this maximum length as a separator. So if one cell in that column is shorter than the maximum, cell should be padded

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Philipp Pagel
On Tue, Sep 08, 2009 at 02:53:11PM +0300, Lauri Nikkinen wrote: I have a text file similar to this (separated by spaces): x - DF12 This is an example 1 This DF12 This is an 1232 This is DF14 This is 12334 This is an DF15 This 23 This is an example and I know the field lengths of each

Re: [R] Tinn-R setup

2009-09-08 Thread Steve_Friedman
Kevin, I did the same installation a week or two ago. The same downloading process occurred, but not so many iterations. I don't know if it was normal or not , but the system seems to work very well. Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National

[R] Ridge and PLS grouping property

2009-09-08 Thread linda garcia
Dear all, I have collected the standardize regression coefficients of Ridge and PLS. As theory says that Ridge and PLS can retain the grouping property. How can I see such grouping properties in a data sets i.e group of correlated variables will get similar coefficients. But how

Re: [R] Very basic question regarding plot.Design...

2009-09-08 Thread Frank E Harrell Jr
Petar Milin wrote: Hello ALL! I have a problem to plot factor (lets say gender) as a line, or at least both line and point, from ols model: ols1 - ols(Y ~ gender, data=dat, x=T, y=T) plot(ols1, gender=NA, xlab=gender, ylab=Y, ylim=c(5,30), conf.int=FALSE) If I convert gender into discrete

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
Thanks for the suggestion, but I don't have an access to this database, I just got this messy file. -L 2009/9/8 Duncan Murdoch murd...@stats.uwo.ca: On 9/8/2009 8:21 AM, Lauri Nikkinen wrote: This data is from database and the maximum length of a field is defined. I mean that every column

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Petr PIKAL
Hi what about reading each line by readLine and then split it to desired portions? x-paste(letters, collapse=) substring(x, c(1,3,5),c(2,4,15)) Regards Petr r-help-boun...@r-project.org napsal dne 08.09.2009 14:21:53: This data is from database and the maximum length of a field is

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Philipp Pagel
On Tue, Sep 08, 2009 at 03:21:53PM +0300, Lauri Nikkinen wrote: This data is from database and the maximum length of a field is defined. I mean that every column has a maximum length and I want to use this maximum length as a separator. So if one cell in that column is shorter than the

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
Thanks Petr, I tried something like this con - file(C:temppi.txt, r, blocking = FALSE) g - readLines(con) close(con) sta - c(1, 3, 5, 19) sto - c(2, 4, 18, 100) do.call(rbind, lapply(g, function(x) substring(x, sta, sto))) [,1] [,2] [,3] [,4] [1,] DF 12 This is an ex

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
UPDATE: I'm not sure why, but on my Windows XP 64bit machine, I ran the same code again and this time it is not working even though it worked previously. This has been done using the Rgui --vanilla command. x - c(Weekly sales figures to 30 August 2008 published 5 September, Weekly sales

Re: [R] About create dataset permanently in package

2009-09-08 Thread Steve Lianoglou
Hi Yan, Before I try to answer your question: please send R questions to the r- help mailing list (cc'd here). You will likely get your answer more quickly (since I'm not the only one looking at it) and it might help other people who get stuck on a similar situation by finding the answer

Re: [R] Data separated by spaces, getting data into R using fiel

2009-09-08 Thread Ted Harding
On 08-Sep-09 12:21:53, Lauri Nikkinen wrote: This data is from database and the maximum length of a field is defined. I mean that every column has a maximum length and I want to use this maximum length as a separator. So if one cell in that column is shorter than the maximum, cell should be

[R] sparse vectors

2009-09-08 Thread Robin Hankin
Hi I deal with long vectors almost all of whose elements are zero. Typically, the length will be ~5e7 with ~100 nonzero elements. I want to deal with these objects using a sort of sparse vector. The problem is that I want to be able to 'add' two such vectors. Toy problem follows. Suppose I

[R] Regarding SVM using R

2009-09-08 Thread Abbas R. Ali
Hi Steve   I am facing a little problem in predict function which is I think mismatch of dimension. Infacted area is covered by ***.   svm = function() {  library(RODBC) # load RODBC library for database access  channel = odbcConnect(demo_dsn, sa, 1234)  # connecting to the database

Re: [R] Regarding SVM using R

2009-09-08 Thread Steve Lianoglou
Hi, On Sep 8, 2009, at 9:09 AM, Abbas R. Ali wrote: Hi Steve I am facing a little problem in predict function which is I think mismatch of dimension. Infacted area is covered by ***. svm = function() { library(RODBC) # load RODBC library for database access channel =

[R] [R-pkgs] New package: rms

2009-09-08 Thread Frank E Harrell Jr
This is to announce a new package rms on CRAN. rms goes along with my book Regression Modeling Strategies. The home page for rms is http://biostat.mc.vanderbilt.edu/rms, or go directly to http://biostat.mc.vanderbilt.edu/Rrms for information just about the software. rms is a re-write of

Re: [R] sparse vectors

2009-09-08 Thread Dimitris Rizopoulos
one simple way could be: sparse.vec - function (..., fun = sum) { lis - list(...) values - unlist(lapply(lis, [[, value)) inds - factor(unlist(lapply(lis, [[, index))) out - tapply(values, inds, FUN = fun) list(index = as.numeric(levels(inds)), values = out) } a - list(index

[R] Unexpected behavior in friedman.test and ks.test

2009-09-08 Thread atconsta-rhelp
I have to start by saying that I am new to R, so I might miss something crucial here. It seems to me that the results of friedman.test and ks.test are wrong. Now, obviously, the first thing which crossed my mind was it can't be, this is a package used by so many, someone should have observed,

Re: [R] sparse vectors

2009-09-08 Thread Steve Lianoglou
Hi, On Sep 8, 2009, at 9:06 AM, Robin Hankin wrote: Hi I deal with long vectors almost all of whose elements are zero. Typically, the length will be ~5e7 with ~100 nonzero elements. I want to deal with these objects using a sort of sparse vector. Would using sparse matrices (from the

Re: [R] NA in cca (vegan)

2009-09-08 Thread Jari Oksanen
Gavin Simpson gavin.simpson at ucl.ac.uk writes: On Fri, 2009-09-04 at 17:15 +0200, Kim Vanselow wrote: Dear all, I would like to calculate a cca (package vegan) with species and environmental data. One of these environmental variables is cos(EXPOSURE). The problem: for flat releves

Re: [R] sparse vectors

2009-09-08 Thread Martin Maechler
Robin == Robin Hankin rk...@cam.ac.uk on Tue, 08 Sep 2009 14:58:49 +0100 writes: Robin Hi guys Robin thanks for this, it works fine, but I'm not sure the Matrix package does Robin what I want: a = sparseMatrix(i=c(20, 30, 10), j=rep(1, 3), x=c(2.2, 3.3, 4.4))

Re: [R] Data in Array

2009-09-08 Thread jim holtman
Not sure what you mean by 'store', but you can use a list: a - matrix(1, nrow = 5, ncol = 1) b - matrix(2, nrow = 10, ncol = 1) c - matrix(3, nrow = 15, ncol = 1) myList - list(a, b, c) str(myList) List of 3 $ : num [1:5, 1] 1 1 1 1 1 $ : num [1:10, 1] 2 2 2 2 2 2 2 2 2 2 $ : num [1:15,

[R] barplot with lines instead of bars

2009-09-08 Thread Rafael Moral
Dear useRs, I want to plot the following barplot with lines instead of bars. Is there a way? data - data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48))) d - t(data[,2:4]) barplot(d, beside=TRUE) Regards, Rafael.

Re: [R] Fitting a linear model with a break point

2009-09-08 Thread Vito Muggeo (UniPa)
dear Dan, As far as I know, the strucchange package can be helpful for you.. On the other hand, if your regression function is continuous at the unknown break points to be estimated, you could try the segmented package. Hope this helps you, vito Daniel Brewer ha scritto: Hello, I would

Re: [R] Regarding SVM using R

2009-09-08 Thread Steve Lianoglou
Hi, On Sep 8, 2009, at 9:56 AM, Abbas R. Ali wrote: my dimentions of trining set dim(trainingset) = 7 x 96 and dim (validation) = 3 x 96 other thing if i want to predicit trainingset accuracy it is also giviing me same error. Now its no issue of dimentions from my side. 1. Please keep

Re: [R] Regarding SVM using R

2009-09-08 Thread Steve Lianoglou
Hi, On Sep 8, 2009, at 9:28 AM, Abbas R. Ali wrote: by using predict(model.ksvm, validationset, ...) I am facing following error: Error: '...' used in an incorrect context No. I didn't mean to explicitly use ..., sorry. Actually, I had a two line fix here, but I'm looking back at your

Re: [R] barplot with lines instead of bars

2009-09-08 Thread ONKELINX, Thierry
Here is a solutions using ggplot2 and reshape library(reshape) library(ggplot2) data - data.frame(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)) Molten - melt(data, id.vars = k) ggplot(Molten, aes(x = k, y = value, colour = variable)) +

[R] Pharmacokinetic and pharmacodynamic modeling and simulation

2009-09-08 Thread Dick Verkerk
Pharmacokinetic and pharmacodynamic modeling and simulation By Dr. Jan Freijer September 24, 2009 Amsterdam, The Netherlands http://www.can.nl/events/details.php?id=57 This course is aimed at users of R or S-PLUS in the bio-pharmaceutical sciences who would like to use R for

Re: [R] sparse vectors

2009-09-08 Thread Benilton Carvalho
library(Matrix) a = sparseMatrix(i=c(20, 30, 1), j=rep(1, 3), x=c(2.2, 3.3, 4.4)) b = sparseMatrix(i=c(3, 30), j=rep(1, 2), x=c(0.1, 0.1), dims=dim(a)) theSum = a+b summary(theSum) hth, b On Sep 8, 2009, at 10:19 AM, Henrique Dallazuanna wrote: Try this: abMerge - merge(a, b, by

Re: [R] sparse vectors

2009-09-08 Thread Ted Harding
On 08-Sep-09 13:06:28, Robin Hankin wrote: Hi I deal with long vectors almost all of whose elements are zero. Typically, the length will be ~5e7 with ~100 nonzero elements. I want to deal with these objects using a sort of sparse vector. The problem is that I want to be able to 'add' two

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Barry Rowlingson
On Tue, Sep 8, 2009 at 1:52 PM, Lauri Nikkinenlauri.nikki...@iki.fi wrote: But this is not the solution I was looking for. Thanks. I think the only way you'll get the solution you are looking for is if you can let us have a copy of the original input file, or at least the first few lines - and

Re: [R] Re : calling combinations of variable names

2009-09-08 Thread Helter Two
Thanks to Justin, Baptiste, and Sebed for your answers. The solutions work well. I have been putting them to good use today: the code now works wonderfully and I learnt some useful tricks! thanks, Peter -Original Message- From: justin bem [justin_...@yahoo.fr] Sent: 9/8/2009 9:06:23

Re: [R] Unexpected behavior in friedman.test and ks.test

2009-09-08 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Alex, It's mainly speculation, as I cannot check the Excel add-in nor Vassar, but I'll give it a try. For the Friedman-test: Results of R coincide with those reported by Hollander Wolfe, which I'd take as a point in favor of R. In any case, my guess is that ties are handled differently

[R] output layout question

2009-09-08 Thread Roger Leenders
Win7, R-2.9.1 Dear list, I have a large (nxm) matrix which is the output of an analysis. Since it is so large, I would like to use output formatting to make it easier to find particular values and patterns in the matrix. In particular, I want to print the matrix as follows: - cells with a

[R] Incomplete time series

2009-09-08 Thread Bryan
Hi list, I have a data frame with a Date column and a Price column - for example: Date Price 01/01/2009 5.45 01/03/2009 6.53 01/04/2009 7.55 01/06/2009 6.76 01/08/2009 4.12 01/18/2009 5.87 ... As you can see, there are days for which I don't have any data.

[R] SPSS Statistics-R Integration Plug-In

2009-09-08 Thread Michael Chajewski
Dear All, Has anyone tried to use this plug-in? Since I am running R-2.9.1 it will not even let me install it. Further, since I am running Windows I cannot use the R provided R-2.7.0 Linux installation file from the archive (tried to install it through cygwin and it was a mess). Suggestions?

[R] Fitting a linear model with a break point

2009-09-08 Thread Daniel Brewer
Hello, I would like to test some data to see whether it has the shape of a step function (i.e. y1 up until x_th and then y2 where x_th is the threshold). The threshold x_th is unknown and the x values can only take discrete values (0,1,2,3,4). An example would be: data-

Re: [R] Averaging rows if a condition is true.

2009-09-08 Thread A Ezhil
Thanks a lot, Mohamed. Kind regards, Ezhil --- On Mon, 9/7/09, Mohamed Lajnef mohamed.laj...@inserm.fr wrote: From: Mohamed Lajnef mohamed.laj...@inserm.fr Subject: Re: [R] Averaging rows if a condition is true. To: A Ezhil ezhi...@yahoo.com Cc: r-help@r-project.org Date: Monday,

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
Ok, I think that I have to give up and try to get this data separated by some char. It seem pretty much impossible to separate those fields. Thanks for your help and efforts. -L 2009/9/8 Lauri Nikkinen lauri.nikki...@iki.fi: This is the file (see the attachment) that represents the problem I'm

[R] Re : R-crash when loading workspace - Windows

2009-09-08 Thread sebed1110-divers
Hi Actually there is no more trouble with R 2.9.2 version. I was using 2.5.0 and really needed to update! Thanks anyway Edwige De : William Dunlap wdun...@tibco.com Envoyé le : Mardi, 8 Septembre 2009, 18h12mn 59s Objet : RE: [R] R-crash when loading

[R] makefile for sweave

2009-09-08 Thread Welma Pereira
Hello, I have the following makefile. The problem is that the bibliography doesn t work. Any help would be appreciated! I really don t don t what to do..:-( # The sources of the report (tex, Rnw and other files (e.g. bib, idx)) TEX_CMPS = Report problem RNW_CMPS = prop1 prop2 ExeExps OTHER =

[R] optim() argument scoping: passing parameter values into user's subfunction

2009-09-08 Thread Szumiloski, John
Dear useRs, I have a complicated function to be optimized with optim(), and whose parameters are passed to another function within its evaluation. This function allows for the parameters to enter as arguments to various probability distribution functions. However, I am violating some scoping

Re: [R] Data separated by spaces, getting data into R using fiel

2009-09-08 Thread Ted Harding
Lauri, Having looked at your example file, and examined its byte-by-byte content, it is a plain ASCII file which gives exactly the same layout as you originally posted. This, along with the field-width information you originally supplied, is not sufficient to determine a unique dcomposition into

[R] Confusion on use of permTS() in 'perm'

2009-09-08 Thread Robert A. LaBudde
Consider the following simple example using R-2.9.0 and 'perm' 2.9.1: require('perm') p- c(15,21,26,32,39,45,52,60,70,82) g- c('y','n','y','y', rep('n',6)) #Patients ranked 1,3,4 receive treatment permTS(p ~ g, alternative = 'two.sided', method='exact.ce') #find p-value by complete

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread David Winsemius
On Sep 8, 2009, at 12:00 PM, Lauri Nikkinen wrote: Ok, I think that I have to give up and try to get this data separated by some char. It seem pretty much impossible to separate those fields. Thanks for your help and efforts. The solution that Henrique offered seems to be a complete one:

Re: [R] Data separated by spaces, getting data into R using field lengths

2009-09-08 Thread Lauri Nikkinen
This is the file (see the attachment) that represents the problem I'm facing with the original file. I'm looking for some generic way to solve this problem. Thank you for your time. -L 2009/9/8 Barry Rowlingson b.rowling...@lancaster.ac.uk: On Tue, Sep 8, 2009 at 1:52 PM, Lauri

Re: [R] barplot with lines instead of bars

2009-09-08 Thread rafamoral
I'm sorry, but I think I was misunderstood. What I need is something like this: http://img525.imageshack.us/img525/2818/imagemyu.jpg Lines instead of bars Thanks! Rafael. ONKELINX, Thierry wrote: Here is a solutions using ggplot2 and reshape library(reshape) library(ggplot2) data -

Re: [R] Mantel test least square line

2009-09-08 Thread Jari Oksanen
swertie v_coudrain at voila.fr writes: Hello, I performed a Mantel test and plotted communitiy similarities. I would like to add a least square line. I thought about using abline taking as slope the r-statistic of the Mantel test and calculating the y-intercept analytically. Is this method

Re: [R] Data separated by spaces, getting data into R using fiel

2009-09-08 Thread Ted Harding
On 08-Sep-09 16:17:00, David Winsemius wrote: On Sep 8, 2009, at 12:00 PM, Lauri Nikkinen wrote: Ok, I think that I have to give up and try to get this data separated by some char. It seem pretty much impossible to separate those fields. Thanks for your help and efforts. The solution that

[R] Count number of different patterns (Polytomous variable)

2009-09-08 Thread Biedermann, Jürgen
Hi there, Does anyone know a method to calculate the number of different patterns in a given data frame. The variables are of polytomous type and not binary (for the latter i found a package called countpattern which unfortunately only functions for binary variables). V1 V2 V3 0 3 1

[R] cbind formula definition

2009-09-08 Thread Biedermann, Jürgen
Hi there, I have the following problem: I have a package called polLCA which has the following syntax: poLCA(formula, data) and needs the following formula definition: formula - cbind(V1,V2,V3,...) So far so good. What I tried now was the following: #Get data with the read.table fuction

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-08 Thread Tony Breyal
SOLVED. Thanks to a reply off-list it appears that the 'space' in published 11 is actually some kind of multibyte character. If I physically delete the 'space' and replace it by using the spacebar on my keyboard, then strsplit() behaves as expected. I had got the text from a hyperlink and copy

[R] strange results in summary and IQR functions

2009-09-08 Thread Chunhao Tu
Dear R users, Something is strange in summary and IQR. Suppose, I have a data set and I would like to find the Q1, Q2, Q3 and IQR. x-c(2,4,11,12,13,15,31,31,37,47) summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 2.00 11.25 14.00 20.30 31.00 47.00 IQR(x) [1] 19.75

[R] Mapping factors to a new set of factors

2009-09-08 Thread james.arnold
Hello, I am trying to map a factor variable within a data frame to a new variable whose entries are derived from the content of the original variable and there are fewer factors in the new variable. That is, I'm trying to set up a surjection. After first thinking that this would be a common

Re: [R] extracting pvalues from ttest

2009-09-08 Thread 1Rnwb
okay fixed it by putting c in quote marks. 1Rnwb wrote: Hello, I am using B as a vector to store all the t.tests. since i am a newbie to both R and statistics I am not sure if B is the list. Also I see c used in the do.call formula and do not know what it is being used for. I used

Re: [R] strange results in summary and IQR functions

2009-09-08 Thread Erik Iverson
It's all simply a matter of definitions, and there are many who disagree. See ?quantile , specifically the type argument. Since IQR does not appear to have a type argument, you could easily write your own versions of these that do what SAS does (assuming that is your goal). With x defined

Re: [R] barplot with lines instead of bars

2009-09-08 Thread hadley wickham
What's the difference between a line and a thin bar? Hadley On Tue, Sep 8, 2009 at 12:17 PM, rafamoralrafa_moral2...@yahoo.com.br wrote: I'm sorry, but I think I was misunderstood. What I need is something like this: http://img525.imageshack.us/img525/2818/imagemyu.jpg Lines instead of

[R] Ada package question

2009-09-08 Thread pramil cheriyath
Hi, I am using ada to predict a data set with 36 variables ada(x~.,data=train,iter=Iter, control=rpart.control(maxdepth=4,cp=-1,minsplit=0,xval=0)) can any one tell me in in laymans terms maxdepth- how do you set this, how do you change this to improve predictions success cp- same question

Re: [R] Data separated by spaces, getting data into R using fiel

2009-09-08 Thread Lauri Nikkinen
Well, yeah, Henrique's solutions works fine with this data. Thanks for that, although this is not so generic solutions which I was looking after. As I originally posted, I was looking for solution which uses the field-width information, as Ted pointed out. But as I already mentioned, it seems that

Re: [R] Ellipse: Major Axis Minor Axis

2009-09-08 Thread Jari Oksanen
Vishal vishalps at gmail.com writes: Jari, thanks for the quick answer. sqrt(eigen(cov.trob(mydataforellipse)$cov)$values) what will this return? For my data, I get: sqrt(eigen(cov.trob(r)$cov)$values) [1] 1.857733e-05 4.953181e-06 Is this Left hand value the major or the

Re: [R] Count number of different patterns (Polytomous variable)

2009-09-08 Thread Jorge Ivan Velez
Dear Jürgen, If x is your data, here are two suggestions: # Suggestion 1 length(unique( apply(x, 1, paste, sep=, collapse=) ) ) # [1] 2 # Suggestion 2 res - as.data.frame( xtabs( ~. , as.data.frame( x ) ) ) dim(res[res$Freq 0,])[1] # [1] 2 HTH, Jorge 2009/9/8 Biedermann, Jürgen

Re: [R] Count number of different patterns (Polytomous variable)

2009-09-08 Thread Dimitris Rizopoulos
try this: DF - data.frame(V1 = c(0,1,1), V2 = c(3,2,2), V2 = c(1,0,0)) DF nrow(unique(DF)) I hope it helps. Best, Dimitris Biedermann, Jürgen wrote: Hi there, Does anyone know a method to calculate the number of different patterns in a given data frame. The variables are of polytomous

  1   2   >