Re: [R] MATLAB vrs. R

2010-10-10 Thread Peter Dalgaard
On 10/11/2010 07:46 AM, Craig O'Connell wrote: > > I need to find the area under a trapezoid for a research-related project. I > was able to find the area under the trapezoid in MATLAB using the code: > function [int] = myquadrature(f,a,b) > % user-defined quadrature function > % integrate data

Re: [R] textConnection on List

2010-10-10 Thread Santosh Srinivas
I think "unlist" did the trick ... I used tmpData <- unlist (tmpTxtList) tmp_MF_Data_F <- read.table(textConnection(tempTxt), sep=';', quote = '') write.table(tmp_MF_Data_F,file="MF_Data_F.txt", append=T, sep ="|", col.names=F, row.names=F, quote=F) -Original Message- From: Santos

[R] MATLAB vrs. R

2010-10-10 Thread Craig O'Connell
I need to find the area under a trapezoid for a research-related project. I was able to find the area under the trapezoid in MATLAB using the code: function [int] = myquadrature(f,a,b) % user-defined quadrature function % integrate data f from x=a to x=b assuming f is equally spaced over the i

[R] textConnection on List

2010-10-10 Thread Santosh Srinivas
I'm trying to optimize some code that I have I have a list of delimited text in a list (see below). I want to do a read.table via a text connection so that I can get the delimited values into a table ... Something like ... tmp_MF_Data_F <- read.table(textConnection(tmpTxtList), sep=';', quote =

Re: [R] Create single vector after looping through multiple data frames with GREP

2010-10-10 Thread Michael Bedward
Hi Simon, The function below should do it or at least get you started... getPlotData <- function (datalist, response, times) { qdata <- sapply(datalist[times], function(df) { irow <- grepl(response, df$Response) df[irow, 2:5] } ) # qdata is a matrix with rows Q1:Q4 and

Re: [R] Number of occurences of a character in a string

2010-10-10 Thread Michael Sumner
Literally: length( gregexpr(";", b)[[1]]) But more generally, in case b has more than one element: sapply(gregexpr(";", b), length) ?gregexpr On Mon, Oct 11, 2010 at 3:18 PM, Santosh Srinivas < santosh.srini...@gmail.com> wrote: > New to R ... which is a function to most effectively search

Re: [R] Number of occurences of a character in a string

2010-10-10 Thread Christian Raschke
> length(gregexpr(";", b)[[1]]) [1] 5 This works as long as the substrings you are searching for don't overlap. Christian On 10/10/2010 11:18 PM, Santosh Srinivas wrote: New to R ... which is a function to most effectively search the number of occurrences of a character in a string? b<- c

[R] Number of occurences of a character in a string

2010-10-10 Thread Santosh Srinivas
New to R ... which is a function to most effectively search the number of occurrences of a character in a string? b <- c("jkhrikujhj345hi5hiklfjsdkljfksdio324j';;'lfd;g'lkfit34'5;435l;43'5k") I want the number of semi-colons ";" in b? Thanks. __ R-he

[R] rearrange command in quantreg package

2010-10-10 Thread Dimitris.Kapetanakis
Dear all, I want to use the "rearrange" command which is based on Chernozhukov et al paper and is included in the quantreg package. So, I run a quantile regression in which I included dummy variables for state and years in order to estimate the respective fixed effects quantile regression. The p

Re: [R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread Steve Taylor
You might have to use segments() to place the line segments precisely. ?segments >>> From: Henrik Bengtsson To:Peter Alspach CC:r-help Date: 11/Oct/2010 1:23p Subject: Re: [R] Line Type Specification: lty="" but lty=""? Thanks both, but unfortunately not. Here is a better illustration on w

Re: [R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread Henrik Bengtsson
Thanks both, but unfortunately not. Here is a better illustration on what I want to achieve; xs <- c(0,1,2,3); ys <- c(-1,0,0,1); lty <- c("FF11", "1FF1"); plot(NA, xlim=c(0,3), ylim=c(-1,1)); lines(xs, ys, col="red", lwd=2, lty=lty[1]); lines(xs, -ys, col="blue", lwd=2, lty=lty[2]); except that

[R] CRAN (and crantastic) updates this week

2010-10-10 Thread Crantastic
CRAN (and crantastic) updates this week New packages Updated packages BradleyTerry2 (0.9-3), COUNT (1.1.1), DeducerPlugInScaling (0.0-6) This email provided as a service for the R community by http://crantastic.org. Like it? Hate it? Please let us know: crana

Re: [R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread Peter Alspach
Tena koe Henrik Not exactly what you are requesting but you could draw a solid line and then the dashed line over the top: plot(1:10, panel.first=abline(0, 1, col='red', lwd=2), panel.last=abline(0, 1, col='blue', lty='88', lwd=2)) or plot(1:10) abline(0, 1, col='red', lwd=2) abline(0, 1, col

Re: [R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread David Winsemius
On Oct 10, 2010, at 5:50 PM, Henrik Bengtsson wrote: Hi, Section 'Line Type Specification' in help(par) explains how you can do custom line types. For example: plot(NA, xlim=c(0,1), ylim=c(0,1)); abline(h=1/2, col="blue", lwd=2, lty="88"); will draw a dashed line segment where the line is c

[R] Line Type Specification: lty="" but lty=""?

2010-10-10 Thread Henrik Bengtsson
Hi, Section 'Line Type Specification' in help(par) explains how you can do custom line types. For example: plot(NA, xlim=c(0,1), ylim=c(0,1)); abline(h=1/2, col="blue", lwd=2, lty="88"); will draw a dashed line segment where the line is composed of 8 units of "on" (blue color) and 8 units of "o

Re: [R] venneuler (java?) color palette 0 - 1

2010-10-10 Thread Paul Murrell
Hi On 11/10/2010 9:01 a.m., Karl Brand wrote: Dear UseRs and DevelopeRs It would be helpful to see the color palette available in the venneuler() function. The relevant par of ?venneuler states: "colors: colors of the circles as values between 0 and 1" -which explains color specification, bu

Re: [R] Help reading table rows into lists

2010-10-10 Thread Gabor Grothendieck
On Sun, Oct 10, 2010 at 3:29 PM, Alison Waller wrote: > Thanks Gabor and Jeffrey, > > and thanks for explaining the differences.  I think I'll go with Jeffery's > as I think I want entries for COGs with no pathway. > My second post does handle that case. -- Statistics & Software Consulting GKX

Re: [R] Help reading table rows into lists

2010-10-10 Thread Alison Waller
Thanks Gabor and Jeffrey, and thanks for explaining the differences. I think I'll go with Jeffery's as I think I want entries for COGs with no pathway. Alison On 10-Oct-10, at 8:59 PM, Jeffrey Spies wrote: sapply(dat, function(x){ tmp<-unlist(strsplit(x, '\t', fixed=T)) out <- list(t

[R] venneuler (java?) color palette 0 - 1

2010-10-10 Thread Karl Brand
Dear UseRs and DevelopeRs It would be helpful to see the color palette available in the venneuler() function. The relevant par of ?venneuler states: "colors: colors of the circles as values between 0 and 1" -which explains color specification, but from what pallette? Short of trial and erro

Re: [R] Help reading table rows into lists

2010-10-10 Thread Gabor Grothendieck
On Sun, Oct 10, 2010 at 2:59 PM, Jeffrey Spies wrote: > To get just the list you wanted, Gabor's solution is more elegant, but > here's another using the apply family.  First, your data: > > dat <- > scan(file="/g/bork8/waller/test_COGtoPath.txt",what="character",sep="\n") > > I expect dat to be

Re: [R] Hausman test for endogeneity

2010-10-10 Thread Holger Steinmetz
Dear Arne, this looks promising! Thank you very much. Best, Holger -- View this message in context: http://r.789695.n4.nabble.com/Hausman-test-for-endogeneity-tp2969522p2970564.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

Re: [R] Help reading table rows into lists

2010-10-10 Thread Jeffrey Spies
To get just the list you wanted, Gabor's solution is more elegant, but here's another using the apply family. First, your data: dat <- scan(file="/g/bork8/waller/test_COGtoPath.txt",what="character",sep="\n") I expect dat to be a vector of strings where each string is a line of values separated

Re: [R] Matching long strings ... was Re: Memory management in R

2010-10-10 Thread Martin Morgan
On 10/10/2010 11:00 AM, David Winsemius wrote: > > On Oct 10, 2010, at 11:35 AM, Martin Morgan wrote: > >> On 10/10/2010 07:11 AM, David Winsemius wrote: >>> >>> On Oct 10, 2010, at 9:27 AM, Lorenzo Isella wrote: >>> > I already offered the Biostrings package. It provides more robust >>>

Re: [R] Matching long strings ... was Re: Memory management in R

2010-10-10 Thread David Winsemius
On Oct 10, 2010, at 11:35 AM, Martin Morgan wrote: On 10/10/2010 07:11 AM, David Winsemius wrote: On Oct 10, 2010, at 9:27 AM, Lorenzo Isella wrote: I already offered the Biostrings package. It provides more robust methods for string matching than does grepl. Is there a reason that you

Re: [R] Help reading table rows into lists

2010-10-10 Thread Gabor Grothendieck
On Sun, Oct 10, 2010 at 11:40 AM, Alison Waller wrote: > Hi all, > > I have a large table mapping thousands of COGs(groups of genes) to pathways. > # Ex > COG0001 patha   pathb   pathc > COG0002 pathd   pathe > COG0003 pathe   pathf   pathg   pathh > ## > > I would like to combine this information

Re: [R] segfault caused by `icfit` in `interval` package

2010-10-10 Thread Uwe Ligges
On 10.10.2010 19:10, Yuliya Matveyeva wrote: On the main site I have only found R-2.11.1.tar.gzto be the latest release (the latest stable release as far as I understand it). But unfortunately it doesn't pass the `make check` on my system (

Re: [R] segfault caused by `icfit` in `interval` package

2010-10-10 Thread Yuliya Matveyeva
The package version is Version: 1.0-1.0 as reported by the packageDescription("interval"). 2010/10/10 Uwe Ligges > Please try with the R-2.12.0 ReleaseCandidate and thwe most recent version > of the package (please report its version number!). > > If it still fails, it may be a good idea to cont

Re: [R] segfault caused by `icfit` in `interval` package

2010-10-10 Thread Yuliya Matveyeva
On the main site I have only found R-2.11.1.tar.gzto be the latest release (the latest stable release as far as I understand it). But unfortunately it doesn't pass the `make check` on my system (that is probably the reason why the `emerge` comm

Re: [R] Create single vector after looping through multiple data frames with GREP

2010-10-10 Thread Simon Kiss
Hello all, I changed the subject line of the e-mail, because the question I''m posing now is different than the first one. I hope that this is proper etiquette. However, the original chain is included below. I've incorporated bits of both Ethan and Brian's code into the script below, but th

Re: [R] Memory management in R

2010-10-10 Thread Mike Marchywka
> Date: Sun, 10 Oct 2010 15:27:11 +0200 > From: lorenzo.ise...@gmail.com > To: dwinsem...@comcast.net > CC: r-help@r-project.org > Subject: Re: [R] Memory management in R > > > > I already offered the Biostrings package. It provides more robust > > me

[R] Help reading table rows into lists

2010-10-10 Thread Alison Waller
Hi all, I have a large table mapping thousands of COGs(groups of genes) to pathways. # Ex COG0001 patha pathb pathc COG0002 pathd pathe COG0003 pathe pathf pathg pathh ## I would like to combine this information into a big list such as below COG2PATHWAY<- list (COG0001 = c ("

Re: [R] Matching long strings ... was Re: Memory management in R

2010-10-10 Thread Martin Morgan
On 10/10/2010 07:11 AM, David Winsemius wrote: > > On Oct 10, 2010, at 9:27 AM, Lorenzo Isella wrote: > >> >>> I already offered the Biostrings package. It provides more robust >>> methods for string matching than does grepl. Is there a reason that you >>> choose not to? >>> >> >> Indeed that is

Re: [R] segfault caused by `icfit` in `interval` package

2010-10-10 Thread Uwe Ligges
Please try with the R-2.12.0 ReleaseCandidate and thwe most recent version of the package (please report its version number!). If it still fails, it may be a good idea to contact the package maintainer of interval first. Uwe Ligges On 10.10.2010 17:33, Yuliya Matveyeva wrote: Dear R commu

[R] segfault caused by `icfit` in `interval` package

2010-10-10 Thread Yuliya Matveyeva
Dear R community, I am using the R package `interval` in order to perform some modelling tests of the NPMLE convergence in the case of censoring. So all I am doing is drawing a sample from exponential distribution, making it a censored sample and computing the NPMLE of its distribution function. B

Re: [R] Matching long strings ... was Re: Memory management in R

2010-10-10 Thread Lorenzo Isella
On 10/10/2010 04:11 PM, David Winsemius wrote: length(matchPattern(fut_string, past_string)@start ) == 0 Wow, thanks a lot! I am still testing this, but it looks like this is a good replacement for grepl. Definitely, since I am not a life scientist even from afar by training, this solution/an

Re: [R] Package "prabclus" not available?

2010-10-10 Thread Christian Hennig
Works for me for both the London mirror as well as CRAN master. May I guess that you are under R < 2.10.x on that machine? Oh yes, need to update this first. Thanks. Solved. The error message could be more informative, though... Christian Uwe On 10.10.2010 14:48, Christian Hennig wrote:

Re: [R] Package "prabclus" not available?

2010-10-10 Thread Uwe Ligges
Works for me for both the London mirror as well as CRAN master. May I guess that you are under R < 2.10.x on that machine? Uwe On 10.10.2010 14:48, Christian Hennig wrote: Hi there, I just tried to install the package prabclus on a computer running Ubuntu Linux 9.04 using install.packages fr

Re: [R] Hausman test for endogeneity

2010-10-10 Thread Arne Henningsen
Hi Holger On 10 October 2010 15:36, Holger Steinmetz wrote: > After inspecting the options, I *guess* that systemfit > is what I need. > However, I absolutely don't understand how it works. I searched long for a > detailed documentation (beyond the rather cryptic standard documentation) > but fou

[R] Matching long strings ... was Re: Memory management in R

2010-10-10 Thread David Winsemius
On Oct 10, 2010, at 9:27 AM, Lorenzo Isella wrote: I already offered the Biostrings package. It provides more robust methods for string matching than does grepl. Is there a reason that you choose not to? Indeed that is the way I should go for and I have installed the package after som

Re: [R] R: rulefit error on Linux

2010-10-10 Thread Uwe Ligges
On 07.10.2010 10:55, noclue_ wrote: R version 2.8.1 (2008-12-22) on Linux 64-bit I am trying to run 'rulefit' function (Rule based Learning Ensembles). but I got the following error - rulefit(x,y) Warning: This program is an suid-root program or is being run by the root user. The full text

Re: [R] Hausman test for endogeneity

2010-10-10 Thread Holger Steinmetz
Dear Liviu, thank you very much. After inspecting the options, I *guess* that systemfit is what I need. However, I absolutely don't understand how it works. I searched long for a detailed documentation (beyond the rather cryptic standard documentation) but found none. Has anybody references/adv

Re: [R] Memory management in R

2010-10-10 Thread Lorenzo Isella
I already offered the Biostrings package. It provides more robust methods for string matching than does grepl. Is there a reason that you choose not to? Indeed that is the way I should go for and I have installed the package after some struggling. Since biostring is a fairly complex package

Re: [R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-10 Thread Gabor Grothendieck
On Sun, Oct 10, 2010 at 8:09 AM, David Winsemius wrote: > > On Oct 10, 2010, at 5:27 AM, vanilla fantasy wrote: > >> Just trying to be clearer on the problem faced, the dates in the 1st >> colume become 1,2,3,4 in excel as below, the screenshot of how data appears >> in excel is attached. > > I ca

Re: [R] Parallel processing

2010-10-10 Thread Tal Galili
Hello Partha, Both questions are answered here: http://www.r-statistics.com/2010/04/parallel-multicore-processing-with-r-on-windows/ I would also recommend you to have a look here: http://www.r-statistics.com/20

[R] Parallel processing

2010-10-10 Thread Partha Sinha
1.what is the application to install for to speed up processing for multicore processor in windows environment? 2. how to compute time for executing a particular a code? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list h

[R] Package "prabclus" not available?

2010-10-10 Thread Christian Hennig
Hi there, I just tried to install the package prabclus on a computer running Ubuntu Linux 9.04 using install.packages from within R. This gave me a message: Warning message: In install.packages("prabclus") : package ‘prabclus’ is not available I tried to do this selecting two different CRAN mi

[R] trycatch examples

2010-10-10 Thread Santosh Srinivas
Dear R-group, I am looking for some good examples on trycatch. Any pointers? The help manual seems quite limited. Thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

Re: [R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-10 Thread David Winsemius
On Oct 10, 2010, at 5:27 AM, vanilla fantasy wrote: Just trying to be clearer on the problem faced, the dates in the 1st colume become 1,2,3,4 in excel as below, the screenshot of how data appears in excel is attached. I can affirm that there was at one time a jpg since you copied me an

Re: [R] GC verbose=false still showing report

2010-10-10 Thread Duncan Murdoch
On 09/10/2010 9:59 PM, Robin Jeffries wrote: invisible(gc()) worked perfectly. Thanks Jeff. @ Josh: I know how to toggle showing/hiding command echos, but I haven't figured out how to toggle on/off any printed output. Use "results=hide" as an Sweave option, e.g. <>= gc() @ Duncan Murdoch

Re: [R] same random numbers in different sessions

2010-10-10 Thread Duncan Murdoch
On 10/10/2010 4:30 AM, Liviu Andronic wrote: Hello On Sun, Oct 10, 2010 at 1:16 AM, jim holtman wrote: You need to set the set.seed yourself. There are some simulation where I do want the same numbers generated and can use the set.seed to set it to a know value. If you want something random

Re: [R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-10 Thread vanilla fantasy
Just trying to be clearer on the problem faced, the dates in the 1st colume become 1,2,3,4 in excel as below, the screenshot of how data appears in excel is attached. Open High Low Close Volume 1 18937.45 19187.61 18937.45 19002.86 0 2 1

Re: [R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-10 Thread vanilla fantasy
Thanks David. You mentioned that I need to insert an extra cell and move the header over one position. I tried for a few times but still coudnt figure out how. Can you pls advise? Many thanks. On Sun, Oct 10, 2010 at 11:55 AM, David Winsemius wrote: > > On Oct 9, 2010, at 10:54 PM, missvanilla wr

Re: [R] same random numbers in different sessions

2010-10-10 Thread Liviu Andronic
Hello On Sun, Oct 10, 2010 at 1:16 AM, jim holtman wrote: > You need to set the set.seed yourself.  There are some simulation > where I do want the same numbers generated and can use the set.seed to > set it to a know value.  If you want something random each time, then > use the time of day in t

Re: [R] same random numbers in different sessions

2010-10-10 Thread Liviu Andronic
Dear all Thanks for all the pointers. On Sat, Oct 9, 2010 at 11:39 PM, Daniel Nordlund wrote: > Could you be reloading a workspace at start-up that is setting the seed?   > What happens if you start R using the --vanilla option? > It seems that this is the culprit. For some reason, my $HOME sessi