Re: [R] SPlus to R

2011-10-05 Thread Joshua Wiley
Hi Scott, I am not familiar with S-Plus (though many aspects are quite similar to R). I will say that your function looks approximately correct. I am not familiar with the ss.rand function. I searched, and found some things that I suspect are similar in the packages MBESS, but without knowing

Re: [R] How to subset() from data frame using specific rows

2011-10-05 Thread Petr PIKAL
On Tue, 4 Oct 2011, Sarah Goslee wrote: You asked for pointers, and didn't provide a reproducible example, so I offered a pointer. Sarah, I did not realize that your pointer was to the factor component of the subset() command. I think the most parsimonious thing for me

Re: [R] Running a GMM Estimation on dynamic Panel Model using plm-Package

2011-10-05 Thread MicahD
Hi bstudent, I've had the same problem and I wish there was a definitive answer as this seems to be the #1 problem with the package and pgmm would be awesome for economists if we could figure out how to work it! I'm no expert on GMM, but from what I've gathered from other posts, the problem may

Re: [R] Create combinations of rows

2011-10-05 Thread Enrico Schumann
?expand.grid Am 05.10.2011 00:21, schrieb darkgaze: I don't quite know how to word what I want, but if I have (1, 2, 3); (a, b, c); (x, y) I want: 1 a x 1 b x 1 c x 1 a y 1 b y 1 c y 2 a ... and so forth What is the appropriate command? Best, Don -- View this message in context:

[R] How to get the hazard of coxph (not cumulative hazard)

2011-10-05 Thread koshihaku
Dear all, I think the coxph and survfit.coxph can give the cumulative hazard of cox model. But is there any method to calculate the hazard Lambda(t)=lambda_0(t)*exp{beta*X(t)}? Any suggestion will be great help. Thank you very much! Koshihaku -- View this message in context:

[R] (no subject)

2011-10-05 Thread William Claster
Hi. I am trying to install using the following. Can someone suggest what is wrong? I am using Windows 7 64bit, and R 2.10.1 ('C:\Users\Bill\Desktop\DMwR_0.2.1.zip', repos=NULL ) Warning in install.packages(C:UsersBillDesktopDMwR_0.2.1.zip, repos = NULL) :   argument 'lib' is missing: using

[R] cuhre usage ?? multidimensional integration

2011-10-05 Thread sevenfrost
my=function(x){ len=1 for(i in 1:len){ y[i]=x[i] } g=1 w=NULL t=NULL for(i in 1:len)w[i]=x[i+len] for(i in 1:len)t[i]=x[i+2*len] for(i in 1:len)g=g*dnorm(y[i])*dnorm(w[i])*dnorm(z[i]) return(g) } cuhre(6,1,my,rep(-100,6),rep(100,6)) Error in crff(match.call(), integrand, cuhre, libargs, ...) :

Re: [R] Is the output of survfit.coxph survival or baseline survival?

2011-10-05 Thread koshihaku
Dear all, Your advices was a great help to my study.Thank you very much! -- View this message in context: http://r.789695.n4.nabble.com/Is-the-output-of-survfit-coxph-survival-or-baseline-survival-tp3861919p3873512.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] SPlus to R

2011-10-05 Thread Spencer Graves
When R was invented, nearly all of the core R functions were written to produce exactly the same answers as those returned by S-Plus. Some very minor exceptions were made for time series functions, for example, where better algorithms in R produced slightly better fits. There may be

Re: [R] experimenting (like Weka Experimenter)

2011-10-05 Thread Marcel.
Hello, i think you are speaking of a general workflow environment which can execute R methods and arrange different statistical methods in a flow (graph). Here is a list of links of such (OpenSource) programms. *Knime:* http://www.knime.org/ http://www.knime.org/ *RapidMiner*

Re: [R] (no subject)

2011-10-05 Thread ONKELINX, Thierry
Dear William, Please use a more informative subject line (as the posting guide asks you to do). Backslash have a special function. In file paths you need to use either double backslashes or forward slashes. 'C:\\Users\\Bill\\Desktop\\DMwR_0.2.1.zip' 'C:/Users/Bill/Desktop/DMwR_0.2.1.zip'

Re: [R] (no subject)

2011-10-05 Thread sina.r
Hi William Try double backslashes \\ or / (see FAQ 2.16: http://cran.r-project.org/bin/windows/base/rw-FAQ.html) install.packages(C:\\Users\\rusa\\DMwR_0.2.1.zip, repos = NULL) Regards, Sina -- View this message in context: http://r.789695.n4.nabble.com/no-subject-tp3873600p3873738.html Sent

Re: [R] need help on melt/cast

2011-10-05 Thread Paul Hiemstra
On 09/22/2011 01:54 PM, Eugene Kanshin wrote: Hello, I need to convert dataframe from: ID T0 T1 T2 A1 2 3 B4 5 6 C7 8 9 to: ID Variable Value A T0 1 A T1 2 A T2 3 B T0 4 B T1 5 B

Re: [R] SPlus to R

2011-10-05 Thread Patrick Burns
I had thought that the problem might be: return(ne=ne1) since R doesn't support that any more. But when I tried it, I got results (just without the name on the output). Better would be to change that line to: list(ne=ne1) ('return' is seldom necessary in either R or S+.) I'd suggest putting

Re: [R] experimenting (like Weka Experimenter)

2011-10-05 Thread Paul Hiemstra
On 10/05/2011 03:02 AM, William Claster wrote: Hi. I am not that good at R but I was wondering if there is either a tool or a strategy for testing many different models in R in a batch. I have used something in Weka called the Experimenter interface which helps with doing this kind of

Re: [R] Problems loading package hydroTSM

2011-10-05 Thread Paul Hiemstra
Hi, What happens when you update R under win7 to 2.12.1? And take a look at the posting guide [1] for tips on what kind of information you need to provide. Especially a sessionInfo() under both Mac and Windows would be useful cheers, Paul [1] http://www.R-project.org/posting-guide.html On

Re: [R] SPlus to R

2011-10-05 Thread Barry Rowlingson
On Wed, Oct 5, 2011 at 2:53 AM, Scott Raynaud scott.rayn...@yahoo.com wrote: I'm trying to convert an S-Plus program to R.  Since I'm a SAS programmer I'm not facile is either S-Plus or R, so I need some help.  All I did was convert the underscores in S-Plus to the assignment operator -. 

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread Paul Hiemstra
On 10/05/2011 04:27 AM, andrewH wrote: Dear folks, I’m trying to build a function to create and make available some variables I frequently use for testing purposes. Suppose I have a function that takes some inputs and creates (internally) several named objects. Say, fun1 - function(x, y,

Re: [R] texi2dvi problem when compiling incorrect Latex code

2011-10-05 Thread syrvn
Hi Ista, thanks for you reply. If I understod correctly you run your R within Eclipse but as the Lunch Type you use Rterm rather than RJ. I changed my configuration so that R is now lunched as Rterm and NOT as RJ and I also removed the quite=FALSE from my configuration. Unfortunately, I still

[R] optimize R code: replace for loop

2011-10-05 Thread Chris82
Dear R Users, at the moment I am trying to optimize an R script. testvec - c(0,1,0,1,1,1,1,0,0,1,0,1,0) sum.testvec - vector() tempsum - 1 for (e in 1:length(testvec)){ sum.testvec[e] - tempsum+testvec[e] tempsum - sum.testvec[e] } final.sum - c(1,sum.testvec) Is there an option to do

Re: [R] optimize R code: replace for loop

2011-10-05 Thread ONKELINX, Thierry
You can vectorize it using cumsum. cumsum(c(1, testvec)) all.equal(final.sum, cumsum(c(1, testvec))) -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Chris82 Verzonden: woensdag 5 oktober 2011 11:50 Aan: r-help@r-project.org

[R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Renaud Gaujoux
Hi, I am having troubles sourcing a file from our local network from R. It looks like this file are not properly accessed by 'source', even they can be downloaded with download.file. (See below my settings and some tests I did). I ended up with a work around, but I would like to understand

Re: [R] break.axis all range of data

2011-10-05 Thread Jim Lemon
On 10/05/2011 09:52 AM, Heverkuhn Heverkuhn wrote: Hello R users, I have a plot type=b with x axis at=(1:36), I would like to increase the distance between x tick-marks 8 and 9, and not connect the points x=8 and x=9. I can do the second thing, setting type=p and then drawing the lines, but

Re: [R] [R-SIG-Finance] AsOf join in R

2011-10-05 Thread Brian G. Peterson
On Tue, 2011-10-04 at 23:41 -0400, Robert A'gata wrote: AsOf(A,B) should return A B 2011-09-0110 1.1 2011-09-0915 1.1 # (because latest value B prior to 2011-09-09 is 1.1) 2011-09-1020 1.5 2011-09-1525 1.7 How do I write

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Prof Brian Ripley
On Wed, 5 Oct 2011, Renaud Gaujoux wrote: Hi, I am having troubles sourcing a file from our local network from R. It looks like this file are not properly accessed by 'source', even they can be downloaded with download.file. (See below my settings and some tests I did). I ended up with a

Re: [R] Strange error msg when plotting a graphics

2011-10-05 Thread Prof Brian Ripley
On Tue, 4 Oct 2011, Eduardo M. A. M. Mendes wrote: Dear R-Users I have come across the error that apparently has nothing to do with command itself. Here is the error (w - matrix (or vector) e testXaxis - dates). plot(data.frame(testXaxis,w),col=blue,ylab=Q, [m3/s],xlab=Data, +

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Renaud Gaujoux
From the help page ?file I -- had -- read the following: For ‘url’ the description is a complete URL, including scheme (such as ‘http://’, ‘ftp://’ or ‘file://’). Proxies can be specified for HTTP and FTP ‘url’ connections: see ‘download.file’. From the internet.info messages it seems that the

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Hans Ekbrand
On Wed, Oct 05, 2011 at 12:44:12PM +0200, Renaud Gaujoux wrote: Is source supposed to work through a proxy? This worked for me: Sys.setenv(http_proxy=http://192.168.0.252:8118;) source(http://pc5.socio.gu.se:84/enkel-kurva.r;, echo = T) my.vectory = c(1,30,2,3,3,4) my.vectorx =

[R] Vector-subsetting with ZERO - Is behavior changeable?

2011-10-05 Thread Johannes Graumann
Dear All, I have trouble generizising some code. index - 0 sapply(list(c(1,2,3),c(1,2),c(1)),function(x){x[max(length(x)-index,0)]}) Will yield a wished for vector like so: [1] 3 2 1 But in this case (trying to select te second to last element in each vector of the list) index - 1

[R] lattice-dotplot: resize axis

2011-10-05 Thread René Mayer
dear all, I want to make a dotplot with ratings from Items in 6 ItemsGroups. I reordered the items by rating within each group. I plotted the items by rating conditional on ItemGroup. The ordering works as I wanted but my y-aches labels (items) within each ItemGroup are now unequally spaced,

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Prof Brian Ripley
On Wed, 5 Oct 2011, Renaud Gaujoux wrote: From the help page ?file I -- had -- read the following: For ‘url’ the description is a complete URL, including scheme (such as ‘http://’, ‘ftp://’ or ‘file://’). Proxies can be specified for HTTP and FTP ‘url’ connections: see ‘download.file’. So

[R] help with regexp

2011-10-05 Thread Jannis
Dear list memebers, I am stuck with using regular expressions. Imagine I have a vector of character strings like: test - c('filename_1_def.pdf', 'filename_2_abc.pdf') How could I use regexpressions to extract only the 'def'/'abc' parts of these strings? Some try from my side yielded no

Re: [R] help with regexp

2011-10-05 Thread Albert-Jan Roskam
Hello!   library(gsubfn) test - c('filename_1_def.pdf', 'filename_2_abc.pdf') gsubfn((.+_)([a-z]+)(\\.pdf), \\2, test) Cheers!! Albert-Jan ~~ All right, but apart from the sanitation, the medicine, education, wine, public

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Renaud Gaujoux
On 05/10/2011 13:45, Prof Brian Ripley wrote: On Wed, 5 Oct 2011, Renaud Gaujoux wrote: From the help page ?file I -- had -- read the following: For ‘url’ the description is a complete URL, including scheme (such as ‘http://’, ‘ftp://’ or ‘file://’). Proxies can be specified for HTTP and FTP

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Prof Brian Ripley
On Wed, 5 Oct 2011, Renaud Gaujoux wrote: On 05/10/2011 13:45, Prof Brian Ripley wrote: On Wed, 5 Oct 2011, Renaud Gaujoux wrote: From the help page ?file I -- had -- read the following: For ‘url’ the description is a complete URL, including scheme (such as ‘http://’, ‘ftp://’ or

[R] Does it exist a function for this?

2011-10-05 Thread lunarossa
I have this kind of matrix, with thousands of cases. A 2 apple A 2 peach A 3 peach B 1 pear B 4 peach B 4 beef B 7 beef C 1 peach D 2 apple D 5 peach I have to distinguish, from the other rows, the rows with peach and this is not a problem. I also have to discriminate the rows with

[R] Which function for this?

2011-10-05 Thread lunarossa
I have a matrix like this 0.05 0.13 1.2 0 0 0 0 0 red 0 0 0 0 0 0 0 0 white 0 0.06 0 0 0 0 0 0 blue If only 1 number in the first 8 columns is more than 0, in a new variable I write 1, if they're all 0 or less, I write 0, so 0.05 0.13 1.2 0 0 0 0 0 red 1 0 0 0

[R] unable to install 'pasilla' package on R

2011-10-05 Thread sridhar
I am trying to install or load pasilla package on R. i am getting the following error. Please let me know how to install pasilla on R. biocLite(pasilla) Using R version 2.13.2, biocinstall version 2.8.4. Installing Bioconductor version 2.8 packages: [1] pasilla Please wait... Installing

[R] Weird behaviour of tab characters in a string in R (vs Python)

2011-10-05 Thread Johnny Paulo
Hello, I wanted to parse some information from a text, where fields are tab separated. When I copy the text into an R session (under emacs) like: mystring - field1 field2 field3 the tab character is replaced by a single space! For ex, if I type mystring, I get: field1 field2 field3 The tabs

[R] kriging shapefiles

2011-10-05 Thread Leynnard Rey Matillano
Hi! Im new to R and I need to interpolate a shapefile using kriging. I've been able to plot/read the shapefile using the package maptools or rgdal. I've searched the internet for sample codes but most of the kriging codes that I've found done in R is done using txtfiles or CSVs.  An example

[R] anova.pgls not working for factors in univariate analyses

2011-10-05 Thread Dryhurst, Sarah
Hi there, I am running simple univariate analyses via CAPER and when trying to obtain a summary of my model using: anova.pgls(model1) It works for my analyses containing continuous explanatory variables but not for those containing categorical explanatory variables (both have a

Re: [R] optimize R code: replace for loop

2011-10-05 Thread Albert-Jan Roskam
Hello,   I'd do: ave(testvec, FUN=cumsum)+1 But in R everything can be done in a trillion different ways. ;-) Cheers!! Albert-Jan ~~ All right, but apart from the sanitation, the medicine, education, wine, public order,

Re: [R] SPlus to R

2011-10-05 Thread Scott Raynaud
Hope I did this right.  I repeated what I'd done before:   1) Opened script 2) Selected run all (this produced my inital post   Then as suggested I:   3) Typed ls() 4) Saw that the function was present and issued sshc(100,10)   Here's what I got:   ls() [1] c.searchd convex    Epower    nef  

[R] repeating categorical variable codes

2011-10-05 Thread Richard Iles
I would appreciate help in knowing how to repeat categorical variable code given in column=A, by the number in a matching column=B. For example, I have a categorical variable code attributed to a household=A and want to replicate the code for all member of the household, as given in column=B. I

Re: [R] How to subset() from data frame using specific rows

2011-10-05 Thread Rich Shepard
On Wed, 5 Oct 2011, Petr PIKAL wrote: Hm. I seldom use such approach. In your original request you said you want split your data to smaller data frames based on sites Petr, I need the additional information in the database, too. From what we know it is difficult to say if there is some

Re: [R] rolling regression

2011-10-05 Thread Darius H
Hello everyone, I would like assistance with updating a snippet I have written to do a recursive out-of-sample portfolio optimization. The trouble I am having is with the fact that the return on the riskless asset is time varying and so is different in each period. This is what I have

[R] mean of 3D arrays

2011-10-05 Thread Martin Batholdy
Hi, I have multiple three dimensional arrays. Like this: x1 - array(rnorm(1000, 1, 2), dim=c(10, 10, 10)) x2 - array(rnorm(1000, 1, 2), dim=c(10, 10, 10)) x3 - array(rnorm(1000, 1, 2), dim=c(10, 10, 10)) Now I would like to compute the mean for each corresponding cell. As a result I want to

Re: [R] SPlus to R

2011-10-05 Thread Kevin E. Thorpe
On 10/05/2011 07:44 AM, Scott Raynaud wrote: Hope I did this right. I repeated what I'd done before: 1) Opened script 2) Selected run all (this produced my inital post Then as suggested I: 3) Typed ls() 4) Saw that the function was present and issued sshc(100,10) Here's what I got: ls()

[R] unload a library while testing?

2011-10-05 Thread Rainer M Krug
Hi I am testing a package, and after I make changes, I have to close R and open R again to load the new version (same version number) of the package I am working on. So my question: is there a function which removes a package, i.e library(myPackage) Package is loaded unlibrary(myPackage)

Re: [R] SPlus to R

2011-10-05 Thread Uwe Ligges
On 05.10.2011 13:44, Scott Raynaud wrote: Hope I did this right. I repeated what I'd done before: 1) Opened script 2) Selected run all (this produced my inital post Then as suggested I: 3) Typed ls() 4) Saw that the function was present and issued sshc(100,10) Here's what I got: ls()

Re: [R] texi2dvi problem when compiling incorrect Latex code

2011-10-05 Thread Ista Zahn
I think we need more details about your setup. It works as I described (prints errors then returns to R prompt) in all configurations I've tried, including th Linux terminal, Emacs ESS, Eclispse statET console setup, I couldn't get RJ workign). What operating system are you using? R version?

Re: [R] unable to install 'pasilla' package on R

2011-10-05 Thread Martin Morgan
On 10/05/2011 01:31 AM, sridhar wrote: I am trying to install or load pasilla package on R. i am getting the following error. Please let me know how to install pasilla on R. biocLite(pasilla) Using R version 2.13.2, biocinstall version 2.8.4. Installing Bioconductor version 2.8 packages: [1]

Re: [R] Behaviour of 'source' with URLs and proxy

2011-10-05 Thread Renaud Gaujoux
So source() always reads a URL using the internal method, because it reads them chunk by chunk, and I suppose the other methods of download.file (wget, etc...) do not support (?). I guess the only way of finding out where the reading process gets stuck is to get into the C code and add more

Re: [R] help with regexp

2011-10-05 Thread Eik Vettorazzi
Hi Jannis, just use the backreferences in gsub, see ?gsub, - replacement test - c('filename_1_def.pdf', 'filename_2_abc.pdf') gsub(.*_([A-z]+)\\.pdf, \\1, test) hth. Am 05.10.2011 13:56, schrieb Jannis: Dear list memebers, I am stuck with using regular expressions. Imagine I have a

Re: [R] mean of 3D arrays

2011-10-05 Thread R. Michael Weylandt michael.weyla...@gmail.com
(x1+x2+x3)/3 I'm not aware of a pmean function but it wouldn't be hard to homebrew one if you are comfortable with the ... argument I'll draft one up and send it along Michael Weylandt On Oct 5, 2011, at 9:00 AM, Martin Batholdy batho...@googlemail.com wrote: Hi, I have multiple three

Re: [R] unload a library while testing?

2011-10-05 Thread Eik Vettorazzi
Hi Rainer, for better or worse unlibrary actually is done by detach in R, ?detach #first example cheers Am 05.10.2011 15:04, schrieb Rainer M Krug: Hi I am testing a package, and after I make changes, I have to close R and open R again to load the new version (same version number) of the

Re: [R] unload a library while testing?

2011-10-05 Thread Ista Zahn
Hi Rainer, On Wed, Oct 5, 2011 at 9:04 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I am testing a package, and after I make changes, I have to close R and open R again to load the new version (same version number) of the package I am working on. So my question: is there a function which

Re: [R] unload a library while testing?

2011-10-05 Thread Rainer M Krug
On Wed, Oct 5, 2011 at 3:15 PM, Eik Vettorazzi e.vettora...@uke.de wrote: Hi Rainer, for better or worse unlibrary actually is done by detach in R, ?detach #first example cheers ARG I looked at detach, tried it, didn't work, because I overlooked the package: part. Thanks a lot,

Re: [R] How to subset() from data frame using specific rows

2011-10-05 Thread Rich Shepard
On Wed, 5 Oct 2011, Rich Shepard wrote: First thing this morning I'm upgrading to 2.13.2 and hoping that this fixes an issue that just showed up yesterday afternoon: not being able to access function help pages. For example, I tried ?subset and ?split because I thought the latter is really

Re: [R] break.axis all range of data

2011-10-05 Thread Heverkuhn Heverkuhn
The problem with that function is that it does not really separate the 2parts of the graph but it inserts , when style is gap, a blank strip that cover axis and points. So for example if a insert it at 8 and I set the gap of length 5 , it would cancel al the point from 8 to 10. Thanks On Oct 5,

Re: [R] break.axis all range of data

2011-10-05 Thread Heverkuhn Heverkuhn
..all the point from 8 to 13. On Wed, Oct 5, 2011 at 8:28 AM, Heverkuhn Heverkuhn heverk...@gmail.comwrote: The problem with that function is that it does not really separate the 2parts of the graph but it inserts , when style is gap, a blank strip that cover axis and points. So for example

Re: [R] mean of 3D arrays

2011-10-05 Thread R. Michael Weylandt michael.weyla...@gmail.com
As promised ### Untested pmean - function(...){ dotArgs - list(...) l - length(dotArgs) if( l == 0L ) stop(no arguments) temp - dotArgs[[1]] if ( l 1L ) {for(i in 2L:l) {temp - temp + dotArgs[[i]]}} temp/l } Clunky but gets the job done. Its still too early for me to

[R] Odp: repeating categorical variable codes

2011-10-05 Thread Petr PIKAL
Hi I would appreciate help in knowing how to repeat categorical variable code given in column=A, by the number in a matching column=B. For example, I have a categorical variable code attributed to a household=A and want to replicate the code for all member of the household, as given in

Re: [R] How to subset() from data frame using specific rows

2011-10-05 Thread Petr PIKAL
Hi On Wed, 5 Oct 2011, Petr PIKAL wrote: Hm. I seldom use such approach. In your original request you said you want split your data to smaller data frames based on sites Petr, I need the additional information in the database, too. But you do not loose them, your data frame is

Re: [R] texi2dvi problem when compiling incorrect Latex code

2011-10-05 Thread syrvn
Hi Ista, it's weird I don't know why this happens. I tried so many different ways but now finally I found a solution. I wrote a little shell script: pdflatex -halt-on-error body.tex bibtex body.aux pdflatex -halt-on-error body.tex pdflatex -halt-on-error body.tex which does the job. So my

Re: [R] repeating categorical variable codes

2011-10-05 Thread Petr PIKAL
Hi Petr, Thank you for the reply. Unfortunately my repetition is not uniform, but dependent on values given in column B, which varies by each row. Does this make it any clearer? Not much. let say A - letters[1:10] B - sample(1:3, 10, replace =TRUE) A [1] a b c d e f g h i j B

Re: [R] SPlus to R

2011-10-05 Thread Barry Rowlingson
On Wed, Oct 5, 2011 at 12:44 PM, Scott Raynaud scott.rayn...@yahoo.com wrote: Hope I did this right.  I repeated what I'd done before: 1) Opened script 2) Selected run all (this produced my inital post Then as suggested I: 3) Typed ls() 4) Saw that the function was present and issued

Re: [R] How to subset() from data frame using specific rows

2011-10-05 Thread Rich Shepard
On Wed, 5 Oct 2011, Petr PIKAL wrote: But you do not loose them, your data frame is cut according to sites variable and put into a list I know this, Petr. But adding them to the database table ensures that the information is there, too. This brings up another question, but I should put

Re: [R] F-values in nested designs

2011-10-05 Thread Marcus Nunes
Dennis, thanks for your help. I've read your email and the references you gave and things are more clear to me. Best, Marcus On Tue, Oct 4, 2011 at 19:28, Dennis Murphy djmu...@gmail.com wrote: Hi: INB4: if I have a nested design with treatment A and treatment B within A, F-values are

Re: [R] help with regexp

2011-10-05 Thread Gabor Grothendieck
On Wed, Oct 5, 2011 at 7:56 AM, Jannis bt_jan...@yahoo.de wrote: Dear list memebers, I am stuck with using regular expressions. Imagine I have a vector of character strings like: test - c('filename_1_def.pdf', 'filename_2_abc.pdf') How could I use regexpressions to extract only the

Re: [R] SPlus to R

2011-10-05 Thread William Dunlap
It looks like this code was written for S+ 4.5 (aka '2000') or before, which was based on S version 3. Try changing return(name1=value1, name2=value2) to return(list(name1=value1, name2=value2)) In S+ from 5.0 onwards return(name=value) or return(name1=value1, name2=value2) throws away the

[R] Populate a matrix

2011-10-05 Thread fernando.cabrera
Hi guys I have vectors x - c(1,2,3,4) and y - c(4,3,9) and would like to generate a matrix which has 3 rows (length(y)) and 4 columns (length(x)), and each row is the corresponding y element repeated length(x) times. 4,4,4,4 3,3,3,3 9,9,9,9 Thanks. Fernando Álvarez

Re: [R] Populate a matrix

2011-10-05 Thread Samuel Le
mat - matrix(ncol = length(x), nrow = length(y)) for(i in 1:length(x)) { mat[,i] = y} HTH, Samuel -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of fernando.cabr...@nordea.com Sent: 05 October 2011 17:11 To: r-help@r-project.org

Re: [R] Populate a matrix

2011-10-05 Thread R. Michael Weylandt
matrix(rep(y, each=length(x)), nrow=length(y), byrow=TRUE) or less explicitly matrix(y, nrow=length(y),ncol=length(x)) Michael On Wed, Oct 5, 2011 at 12:11 PM, fernando.cabr...@nordea.com wrote: Hi guys I have vectors x - c(1,2,3,4) and y - c(4,3,9) and would like to generate a matrix

[R] converting 3D array to a data-frame (with coordinate-columns x, y, z)

2011-10-05 Thread Martin Batholdy
Hi, I am still struggling with three dimensional arrays. Now I would like to convert a three dimensional array into a data-frame with the coordinate-columns: x, y, z and a value-column. And I definitely don't want to loop over every element, since this would be very resource intensive for

Re: [R] Populate a matrix

2011-10-05 Thread R. Michael Weylandt
One more version: somewhere in the middle of the explicitness scale, matrix(rep(y, times = length(x)), nrow=length(y)) On Wed, Oct 5, 2011 at 12:17 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: matrix(rep(y, each=length(x)), nrow=length(y), byrow=TRUE) or less explicitly  

Re: [R] converting 3D array to a data-frame (with coordinate-columns x, y, z)

2011-10-05 Thread R. Michael Weylandt
reshape::melt does this I think Michael On Wed, Oct 5, 2011 at 12:20 PM, Martin Batholdy batho...@googlemail.com wrote: Hi, I am still struggling with three dimensional arrays. Now I would like to convert a three dimensional array into a data-frame with the coordinate-columns: x, y, z

Re: [R] mean of 3D arrays

2011-10-05 Thread Dennis Murphy
Hi: There are a few ways to do this. If you only have a few arrays, you can simply add them and divide by the number of arrays. If you have a large number of such arrays, this is inconvenient, so an alternative is to ship the arrays into a list and use the Reduce() function. For your example, L

Re: [R] SPlus to R

2011-10-05 Thread William Dunlap
I think you only have to change the multi-argument returns to call list. You can remove the name from the single argument return, as it will be ignore return(name=value) - return(value) return(n1=v1, n2=v2) - return(list(n1=v1, n2=v2)) (I say I think because I don't have easy access to S+

Re: [R] Populate a matrix

2011-10-05 Thread Rainer Schuermann
m - matrix( rep( y, length( x ) ), length( y ), length( x ) ) On Wednesday 05 October 2011 18:11:18 fernando.cabr...@nordea.com wrote: Hi guys I have vectors x - c(1,2,3,4) and y - c(4,3,9) and would like to generate a matrix which has 3 rows (length(y)) and 4 columns (length(x)), and

Re: [R] Vector-subsetting with ZERO - Is behavior changeable?

2011-10-05 Thread William Dunlap
You can use [1] on the output of FUN to ensure that exactly one value (perhaps NA from numeric(0)[1]) is returned. E.g. index - 1 sapply(list(c(1,2,3),c(1,2),c(1)),function(x){x[max(length(x)-index,0)][1]}) [1] 2 1 NA I'll also put in a plug for vapply, which throws an error if FUN

Re: [R] Does it exist a function for this?

2011-10-05 Thread Tal Galili
Hi, I am not sure I understand your question. Are you asking how to find the rows that satisfies the condition of the second row? Something like: (let's say the data.frame is called X) X[,1] == A X[,2] == 2 X[,3] == peach ? Contact

Re: [R] Running a GMM Estimation on dynamic Panel Model using plm-Package

2011-10-05 Thread Paul Johnson
On Sun, Jun 12, 2011 at 2:43 PM, bstudent marc.ruet...@gmx.de wrote: Hello, although I searched for a solution related to my problem I didn´t find one, yet. My skills in R aren´t very large, however. For my Diploma thesis I need to run a GMM estimation on a dynamic panel model using the pgmm

Re: [R] Tinn-R

2011-10-05 Thread Paul Johnson
On Tue, Oct 4, 2011 at 1:25 PM, Charles McClure cmccl...@atrcorp.com wrote: I am new to R and have recently tried Tinn-R with very mixed and unexpected results.  Can you point me to a Tinn-R tutorial on the web or a decent reference book? In my experience, TINN-R does not work so well, and

[R] speed up this algorithm (apply-fuction / 4D array)

2011-10-05 Thread Martin Batholdy
Hi, I have this sample-code (see above) and I was wondering wether it is possible to speed things up. What this code does is the following: x is 4D array (you can imagine it as x, y, z-coordinates and a time-coordinate). So x contains 50x50x50 data-arrays for 91 time-points. Now I want to

Re: [R] reporting multiple objects out of a function

2011-10-05 Thread andrewH
Thanks for the response, Paul! But I thought these dumped the variables into the global environment. Is that not correct? I want to make them available in the calling environment, without making them available in the global environment, unless that is where the function is called. This is my bow

Re: [R] Tinn-R

2011-10-05 Thread Leandro Marino
*Paul, I use Tinn-r and i didn't see anything hard to configure it. You have to install the R, then the Tinn-r. After you have to open Tinn-r go to R Configure Permanent . This procedure will open the Rprofile.site file, if you want you can change some parameters and save. After that you have

[R] Party extract BinaryTree from cforest?

2011-10-05 Thread Chris Hane
Hello, I want to plot one of the trees from a cforest object: data(iris) cf - cforest(Species, data=iris) From the docs, cf@ensemble contains a list of BinaryTrees: ensemble: Object of class list, each element being an object of class BinaryTree ../../party/help/BinaryTree%2dclass. So I want to

[R] Advice in model construction

2011-10-05 Thread Chris Mcowen
Dear list, I am unsure how to structure my model, i have tried something and it makes sense but i am unsure if i am interpreting it correctly? i have a continuous response variable - the observed quantity of evolutionary history - EH Then i have a number of species which have a hierarchical

Re: [R] SPlus to R

2011-10-05 Thread Barry Rowlingson
On Wed, Oct 5, 2011 at 4:54 PM, Scott Raynaud scott.rayn...@yahoo.com wrote: It seems I have things set up correctly.  I suspect that the arguments sshc(100,10) are the isuue.  It seems that the 100,10 is not necessary since the code itself specifies the arguments.  It runs and produces a power

Re: [R] SPlus to R

2011-10-05 Thread William Dunlap
I took the original code, changed all return() calls of the form return(n1=v1,n2=v2) to return(list(n1=v1,n2=v2)) and then sshc(10,100) chugged away and produced some plots and returned something with no errors. It took a couple of minutes. I also changed T-TRUE and F-FALSE, as that makes the

Re: [R] speed up this algorithm (apply-fuction / 4D array)

2011-10-05 Thread William Dunlap
I corrected your code a bit and put it into a function, f0, to make testing easier. I also made a small dataset to make testing easier. Then I made a new function f1 which does what f0 does in a vectorized manner: x - array(rnorm(50 * 50 * 50 * 91, 0, 2), dim=c(50, 50, 50, 91)) xsmall -

[R] How to make an orderly matrix from geostatistical data?

2011-10-05 Thread Tariq
Hi everybody, I used the krige.conv command (geoR package) to create a new data set. The input was a matrix with three spatial coordinates (x, y, z) in the first three columns and the value of a variable in the last column. The output is... a weird sequence of numbers. How can I make this output

Re: [R] mean of 3D arrays

2011-10-05 Thread David Winsemius
On Oct 5, 2011, at 8:14 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: (x1+x2+x3)/3 I'm not aware of a pmean function but it wouldn't be hard to homebrew one if you are comfortable with the ... argument I'll draft one up and send it along pmean - function(lis)

[R] Subsetting a data frame with multiple values and exclusions.

2011-10-05 Thread natalie.vanzuydam
Hi all, I realise that the convention is to provide a working example of my problem but the data are of a sensitive nature so I'm not able to do that in this case. I need to query a database for multiple search terms: db - structure(list(ind = c(ind1, ind2, ind3, ind4), test1 = c(1, 2, 1.3,

[R] best way to further analyse a mixed model?

2011-10-05 Thread Panagiotis
Hi, I want to ask which way is more effective to further analyse (multiple comparisons) a mixed model repeated measures anova with 2 fixed factor and 1 random? anova(lme(expr~treatment*age,random=~1|trial, data) Is searching for an effect of one factor in each of the subsamples defined by the

[R] variance ratio test

2011-10-05 Thread rauf ibrahim
Hello, I am looking for a code in R for the variance ratio test statistic (the Lo and Mackinlay version or any other versions). Does anybody have such a code they can share or know a library in which I can find this function? Basically I have a number of time series which I need to check for

[R] stepwise sum

2011-10-05 Thread behave
dear R-Community is there a function which sums data stepwise exp: 2 1 4 5 Desired result 2 = 2 2+1 = 3 2+1+4 = 7 2+1+4+5 = 12 Is there a built in function for this? Thx Dom -- View this message in context: http://r.789695.n4.nabble.com/stepwise-sum-tp3874606p3874606.html Sent from the

[R] gamm: problems with corCAR1()

2011-10-05 Thread Karel V
Dear all, I’m analyzing this dataset containing biodiversity indices, measured over time (Week), and at various contaminant concentrations (Treatment). We have two replicates (Replicate) per treatment. I’m looking for the effects of time (Week) and contaminant concentration (Treatment) on

Re: [R] SPlus to R

2011-10-05 Thread Scott Raynaud
Ok, I chased down all the problems.  This is my last output:   sshc(100,10) [1] 0.8000 0.7908 0.7844 0.7773 0.7785 0.7989 [1]  5.37 10.29 13.27 13.04  9.66  3.54 [1] old.abs.dev= 0.0701944484789673 [1] abs.dev= 0.034407699378335 [1] 0.8000 0.8030 0.8057 0.8041 0.8035 0.8180 [1]  5.37 10.87

  1   2   >