Re: [R] Plotting weather data

2008-10-29 Thread Daniel Malter
This certainly involves arranging multiple plots and plotting multiple variables within the same plot (in the upper graph). The lower plots looks rather standard and just have to be arranged right. Further, you have to put the labels (if they are desired). There is a book on R-graphics which may

Re: [R] lattice: overlap histogram

2008-10-29 Thread Ferry
Thank you Deepayan. Still on lattice, can the same overlap function be applied to categorical variable plot such as barchart? I mean, can I create an overlap barchart plot? On Tue, Oct 28, 2008 at 5:41 PM, Deepayan Sarkar [EMAIL PROTECTED]wrote: On Tue, Oct 28, 2008 at 4:31 PM, Ferry [EMAIL

Re: [R] get coordinates to multi file

2008-10-29 Thread Dieter Menne
Alessandro alessandro.montaghi at unifi.it writes: but I must processing several and several files and I wish to know the methodology to create a loop formula. Put your processing in a function, and call it like this datafiles = dir(../raw) for(file in datafiles) {

Re: [R] slightly OT: (un)supervised clustering?

2008-10-29 Thread viktoras didziulis
Thank you Dylan for the hints - I found them very useful, a good starting point for me to learn about clustering in R. Best wishes Viktoras __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] How to set read.table variables to vectors?

2008-10-29 Thread Leif Peterson
The summary stats for the xin and yin variables below are correct. However, if I use plot(xin,yin), an exception is thrown saying that object xin is not found. Also, it is apparent that I can't successfully replace the x and y vectors with values from xin and yin. The four plots on one

Re: [R] Dose Profile

2008-10-29 Thread Jim Lemon
Laura Bonnett wrote: Hi Everyone, I have data in a long format e.g. there is one row per patient but each follow-up appointment is included in the row. So, a snippet of the data looks like this: TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2 Time2 B1001029 LTG M 15719

Re: [R] Dose Profile

2008-10-29 Thread Laura Bonnett
Hi Jim, Thank you very much for your help. It is much appreciated. Bert, the reason I didn't ask someone at work is because none of us knew. The person I referred to in my email thought it might be possible but didn't know how. I can now inform everyone. Thanks, Laura On Wed, Oct 29, 2008

Re: [R] Repository missing hmisc

2008-10-29 Thread Michael Bibo
stephen sefick ssefick at gmail.com writes: I couldn't download this either with install.packages from two or three mirrors- I haven't tried since thinking that the binaries were being built for windows and mac ... If this isn't right I would be interested. I wondered about this to. If

Re: [R] Sweave, Bibtex, package references

2008-10-29 Thread Paolo Sonego
Dear Thierry, Thank you very much! As usual, I should have RTFM :-[ Kind Regards, Paolo ONKELINX, Thierry ha scritto: Paolo, Try using \nocite{*}. That will cite every entry in your bibliography. HTH, Thierry

Re: [R] Dose Profile

2008-10-29 Thread Eik Vettorazzi
you 'll may be interested in the drc package (a quick start would be http://www.bioassay.dk), where you get some nice plots and can fit appropriate models as well - very handy if you want to estimate effective doses. hth. Laura Bonnett schrieb: Hi Everyone, I have data in a long format

[R] Package arm

2008-10-29 Thread Erica Donnelly-Swift
I am having difficulty installing the arm package and would be grateful if anyone could give some advice. I have updated my computer to a Mac OS X version 10.5.5 ( processor: 2 x 2.8 GHz Quad-Core Intel Xeon) and I have downloaded R version 2.8.0 I have downloaded the package arm, but when i

Re: [R] Recommended R books by XLSolutions Corporation

2008-10-29 Thread Jim Lemon
Well, if you are really serious about this name business, it is much deeper than just current frequencies of names. Both the popularity of given personal names and their conjunction with family names varies over time (see http://www.galbithink.org/names.htm for a good discussion of the long

Re: [R] Suppressing internal grid in filled.contour

2008-10-29 Thread Dieter Menne
Jonathan Greenberg greenberg at ucdavis.edu writes: ..faint internal grid when running the following command to make a filled contour plot of some data I have (x,y,z being the inputs): filled.contour(interp(x,y,z,duplicate=strip, xo=seq(1800,3200,length=57), yo=seq(120,280,length=65)),

Re: [R] How to set read.table variables to vectors?

2008-10-29 Thread jim holtman
'xin' is an element of a dataframe and you must explicity reference it as such. See the Intro to R. plot(mydata$xin, mydata$yin) On Wed, Oct 29, 2008 at 4:29 AM, Leif Peterson [EMAIL PROTECTED] wrote: The summary stats for the xin and yin variables below are correct. However, if I use

Re: [R] R rockie

2008-10-29 Thread Steve_Friedman
Paul, Look for the An Introduction to R on the CRAN - R web site. The latest version, as far as I know, is Version 2.7.2 (2008-08-25). You might also want to examine the R Data Import/Export doc Both can be found here : http://cran.r-project.org/doc/manuals.html Steve Steve Friedman Ph. D.

[R] Help using tapply with multiple variables

2008-10-29 Thread Corey Sparks
Dear list, I have the function (as a simple example, which is actually part of a larger function) pres.test-function(N0=N0, N1=N1) { dt-5 r-log(N1/N0)/dt r } which calculates the annual growth rates in a population Where N0 is the population classified into age intervals, say 5

[R] problem with tune.rpart()

2008-10-29 Thread Claudio Conversano
Dear useRs, I am using the function tune.rpart() implemented in the e1071 package under R 2.7.1 on Windows XP. Sometimes, i.e., for some datasets, I get the following error: tune.rpart(dataset, data = dataset, cp = c(.005,.01,.02)) Error in table(pred, true.y) : all arguments must have

Re: [R] Incorrect order

2008-10-29 Thread bartjoosen
What's wrong with that result? you should look at the result as: first take the 3th element of a, then the first one, than the second one and then the fourth. if you do a[order(a)] then you get 15,20,30,40. I suppose you expected: rank(a) [1] 2 3 1 4 Good luck Bart lll73 wrote: I am

Re: [R] Help using tapply with multiple variables

2008-10-29 Thread Dimitris Rizopoulos
try this: lapply(split(dat, dat$country), function (x) { pres.test(x$pop1995, x$pop2000) }) I hope it helps. Best, Dimitris Corey Sparks wrote: Dear list, I have the function (as a simple example, which is actually part of a larger function) pres.test-function(N0=N0, N1=N1) {

Re: [R] Help using tapply with multiple variables

2008-10-29 Thread Henrique Dallazuanna
Try this: split(mapply(function(x, y)pres.test(x, y), DF$pop1995, DF$pop2000), DF$country) On Wed, Oct 29, 2008 at 10:19 AM, Corey Sparks [EMAIL PROTECTED]wrote: Dear list, I have the function (as a simple example, which is actually part of a larger function) pres.test-function(N0=N0,

Re: [R] help with doing a manipulation on a column of a data frame based on another column

2008-10-29 Thread joris meys
#this is my stab at - I am sure that I am missing something. If this doesn't make sense then please ask for more details. #This may show my low level of programing knowledge hester. - c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) value - rnorm(16) x - data.frame(value, hester.) z -

Re: [R] R rockie

2008-10-29 Thread John Kane
For a good, extemely basic, tutorial see http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html You might also want to have a look at http://zoonek2.free.fr/UNIX/48_R/all.html If you are familiar with SPSS or SAS then Bob Muenchen's paper in PDF form http://oit.utk.edu/scc/RforSASSPSSusers.pdf

[R] sessionInfo() error

2008-10-29 Thread Michael Friendly
[Using R 2.7.2 on Windows XP] After re-building our heplots package, I've begun to get the following error from sessionInfo(), even though it passes R CMD check and builds without errors: sessionInfo() Error in x$Priority : $ operator is invalid for atomic vectors In addition: Warning

[R] maximum device size

2008-10-29 Thread Nishan Sugathadasa
Hi, I would like to know how to get the maximum possible values that can be used for the dimensions of a device, For example windows(h=,w=), what are the maximum values that I can pass as parameters for w and h. environment info: platform: Windows XP SP2 R version: 2.7.1 Thanks Nishan

[R] builtin to filter a list?

2008-10-29 Thread Whit Armstrong
I know it's easy to write a simple loop to do this, but in the spirit of lapply, I thought I would ask if there is a builtin to filter or take a subset of a list based on a predicate in a similar way to the Erlang lists:filter/2 function: http://www.erlang.org/doc/man/lists.html#filter-2

Re: [R] Recommended R books by XLSolutions Corporation

2008-10-29 Thread Detlef Steuer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This is the bit where I get stuck. Drats!! I almost thought that you had gotten a hold on the elusive problem of estimating the population of R users We are legion! :-) I admit: that doesn't help with calculations ... Detlef

[R] Incorrect order

2008-10-29 Thread lll73
I am using the order function and the result seems to be incorrect: a-c(20,30,15,40) order(a) [1] 3 1 2 4 Any suggestions? Thanks, Laura -- View this message in context: http://www.nabble.com/Incorrect-order-tp20224993p20224993.html Sent from the R help mailing list archive at

Re: [R] Recommended R books by XLSolutions Corporation

2008-10-29 Thread Mitchell Maltenfort
I thought R users were measured in fractal dimensions...or is that fractious? On Wed, Oct 29, 2008 at 4:06 AM, Detlef Steuer [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This is the bit where I get stuck. Drats!! I almost thought that you had gotten a hold on

Re: [R] Incorrect order

2008-10-29 Thread ONKELINX, Thierry
Laura, Order works fine. The output tells you that the third element of a is the smallest, the first element is a second smallest, ... Try a[order(a)] that should be equal to sort(a). HTH, Thierry ir. Thierry

Re: [R] Incorrect order

2008-10-29 Thread Alain Guillet
Hi, I believe Bart answered to your question. What is the solution you are expecting? If you don't give us more explanations we cannot understand what is wrong for you. help(sort) |order| returns a permutation which rearranges its first argument into ascending or descending order, breaking

Re: [R] Pkg rgl: installation fails because of x11

2008-10-29 Thread Matthieu Stigler
Dear Duncan, Ben and Megha Thank you for your help! I tried sudo apt-get build-dep r-cran-rgl And so all necessitated package were installed and I could install rgl.. nice! Mat I believe the correct incantation is: sudo apt-get build-dep r-cran-rgl If that doesn't work, get back to us

[R] problem with impute.knn

2008-10-29 Thread Jianying Li
Dear all, This is my first time using this listserv and I am seeking help from the expert. OK, here is my question, I am trying to use impute.knn function in impute library and when I tested the sample code, I got the error as followingt: Here is the sample code: library(impute)

[R] Selecting cases for a grouping value to refill x and y vectors

2008-10-29 Thread Leif Peterson
The variable iter from read.table takes on values of 0,5,10,15, and 20. I am trying to pick off values of iter by assigning it to grp, and e.g. iter-5, then fill the x and y vectors and make plots of x,y for each value of iter (0) For some reason all of the plots are the same, so I am not

[R] how to restrict a parameter in optim()

2008-10-29 Thread Luis SAGAON TEYSSIER
Dear all, I'm trying to estimate some parameters with the optim() function but I need to restrict one parameter and I have not found how to do it. Could you help me please? my program is basically fn-function(s) initial-function(r) { cst-r[1] cst1-r[2] beta-r[3] rho-r[4] p1-r[5]

Re: [R] builtin to filter a list?

2008-10-29 Thread Gabor Grothendieck
Try: ?Filter e.g. Filter(function(x) x 0, x1) or using gsubfn's fn library(gsubfn) fn$Filter(~ x 0, x1) On Wed, Oct 29, 2008 at 9:06 AM, Whit Armstrong [EMAIL PROTECTED] wrote: I know it's easy to write a simple loop to do this, but in the spirit of lapply, I thought I would ask if

Re: [R] Recommended R books by XLSolutions Corporation

2008-10-29 Thread Marc Schwartz
Peter Dalgaard wrote: Drats!! I almost thought that you had gotten a hold on the elusive problem of estimating the population of R users I suspect that the Higgs Boson will be observed well before we get reasonable estimates on that figure...just need to get the LHC back online... ;-)

[R] How to get the duplicated elements from a vector?

2008-10-29 Thread Leon Yee
Dear all, How can I get the duplicated elements from a vector? For example, x - c(yes, no, yes, yes, no, not sure), how can I filter out all the elements which occured =2 times? Thanks for any help! Regards, Leon __ R-help@r-project.org

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Jorge Ivan Velez
Dear Leon, Perhaps: x - c(yes, no, yes, yes, no, not sure) names(table(x))[table(x)=2] HTH, Jorge On Wed, Oct 29, 2008 at 9:47 AM, Leon Yee [EMAIL PROTECTED] wrote: Dear all, How can I get the duplicated elements from a vector? For example, x - c(yes, no, yes, yes, no, not sure),

Re: [R] builtin to filter a list?

2008-10-29 Thread Whit Armstrong
?Filter ... how did I miss that one? Thanks, Gabor. -Whit On Wed, Oct 29, 2008 at 9:37 AM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try: ?Filter e.g. Filter(function(x) x 0, x1) or using gsubfn's fn library(gsubfn) fn$Filter(~ x 0, x1) On Wed, Oct 29, 2008 at 9:06 AM,

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Dimitris Rizopoulos
check duplicated(), e.g., x - c(yes, no, yes, yes, no, not sure) x[duplicated(x)] I hope it helps. Best, Dimitris Leon Yee wrote: Dear all, How can I get the duplicated elements from a vector? For example, x - c(yes, no, yes, yes, no, not sure), how can I filter out all the elements

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Gustaf Rydevik
On Wed, Oct 29, 2008 at 2:47 PM, Leon Yee [EMAIL PROTECTED] wrote: Dear all, How can I get the duplicated elements from a vector? For example, x - c(yes, no, yes, yes, no, not sure), how can I filter out all the elements which occured =2 times? Thanks for any help! Regards, Leon

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Leon Yee
Gustaf Rydevik wrote: Hi Leon, unique(x) or duplicated(x) should work, depending on what you want. Best, Gustaf Hi, Thank you all. Actually, I have a data frame or matrix, whose first column is numerical values, and whose 2nd column is names. I need those whose names repeated 3

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Jorge Ivan Velez
Dear Leon, It's not the most efficient way but it works. Hopefully someone else will come up with another approach. Here a toy example: 1. calculate the mean for each name in your second column by using tapply or others, 2. determinate which names are repeated = 2 times, 3. match the names of the

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Erik Iverson
Leon Yee wrote: Gustaf Rydevik wrote: Hi Leon, unique(x) or duplicated(x) should work, depending on what you want. Best, Gustaf Hi, Thank you all. Actually, I have a data frame or matrix, whose first column is numerical values, and whose 2nd column is names. Then you

[R] Help with impute.knn

2008-10-29 Thread Jianying Li
ear all, This is my first time using this listserv and I am seeking help from the expert. OK, here is my question, I am trying to use impute.knn function in impute library and when I tested the sample code, I got the error as followingt: Here is the sample code: library(impute)

Re: [R] How to get the duplicated elements from a vector?

2008-10-29 Thread Gustaf Rydevik
On Wed, Oct 29, 2008 at 3:45 PM, Erik Iverson [EMAIL PROTECTED] wrote: Leon Yee wrote: Gustaf Rydevik wrote: Hi Leon, unique(x) or duplicated(x) should work, depending on what you want. Best, Gustaf Hi, Thank you all. Actually, I have a data frame or matrix, whose first

[R] Distributions Comparison REFORMULATED

2008-10-29 Thread Igor Telezhinsky
Dear all, Yes, indeed my knowledge in statistics is rather limited, but let me reformulate my question. I have two samples (V1 and V2) of measurements of observed physical values( v1_i and v2_i). Each value in the samples is measured with an error (err_i), so it is in interval (v1_i-err_i,

[R] strptime and strftime

2008-10-29 Thread Santosh
Dear R experts.. I am trying to understand what exactly strptime and strftime do... Where can I look for the detailed notes on these two functions? In addition, how POSIX functions like POSIXct and POSIXlt are used in these functions? Regards, Santosh [[alternative HTML version

Re: [R] strptime and strftime

2008-10-29 Thread Gabor Grothendieck
?strptime gives the percent codes and R News 4/1 has an article on dates with a table at its end containing many examples. On Wed, Oct 29, 2008 at 11:03 AM, Santosh [EMAIL PROTECTED] wrote: Dear R experts.. I am trying to understand what exactly strptime and strftime do... Where can I look

[R] Propagate vector attributes to data frame

2008-10-29 Thread Xavier Robin
Hello, I've got a function that takes a numeric vector (x), computes a transformation value (myAttr) for x, transforms x according to myAttr and then sets myAttr as an attribute of x before returning x, so I can easily know what myAttr was used (basically it's a power transformation and myAttr is

[R] problem with simtest

2008-10-29 Thread Susana Zuloaga
Hello all I am working with the package multcomp but I have problems with the function simtest; the program say that can not find this function, nevertheless I doesn't have any problem with the function glht that it is in the same package. Someone knows what could be the problem? Thank you

[R] difficulties in reading a .prn file

2008-10-29 Thread jass
Hello, I am having problems in reading appropriately a huge .prn file of almost 450.000 rows and 29 columns. The variables are consisted of characters, dates, time, numeric values. I use read.table(file.prn, header=F, sep=\t, na.strings=*), where the missing values are declared as *. The R

[R] SAS - surveyselect in R?

2008-10-29 Thread Markus Schmidberger
Hello, is there a R function or package containing a similar functionality then the SAS PROC SURVEYSELECT? Thanks Markus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] difficulties in reading a .prn file

2008-10-29 Thread jim holtman
I would guess that your separator is not really a tab like you think it is. Take a small subset of the data, bring it up in a text editor, check the contents and then try to read it. Always start small to see if it is working the way you think it should. Also it seem to have a header, so why

Re: [R] difficulties in reading a .prn file

2008-10-29 Thread Philipp Pagel
On Wed, Oct 29, 2008 at 06:19:51PM +0200, [EMAIL PROTECTED] wrote: I am having problems in reading appropriately a huge .prn file of almost 450.000 rows and 29 columns. The variables are consisted of characters, dates, time, numeric values. I use read.table(file.prn, header=F, sep=\t,

Re: [R] difficulties in reading a .prn file

2008-10-29 Thread Peter Dalgaard
jim holtman wrote: I would guess that your separator is not really a tab like you think it is. Take a small subset of the data, bring it up in a text editor, check the contents and then try to read it. Always start small to see if it is working the way you think it should. Also it seem to

[R] Error using fitting weibull distribution to some data

2008-10-29 Thread Borja Soto Varela
Dear R-users, Using Maximum-likelihood Fitting (fitdistr function) I've got the next error: fitdistr(datos,weibull,lower=0) Error in optim(x = c(1.4625e-06, 0.257854, 0.0001217545, 0.11421005, 0.028721576, : L-BFGS-B *needs finite values of 'fn' * where datos is a vector of length=1000

Re: [R] SAS - surveyselect in R?

2008-10-29 Thread Tobias Verbeke
Hi Markus, is there a R function or package containing a similar functionality then the SAS PROC SURVEYSELECT? I think you need the sampling package http://cran.r-project.org/web/packages/sampling/index.html It is a package accompanying the book Tillé, Y. (2006). Sampling Algorithms, New

Re: [R] behavior of by

2008-10-29 Thread Jeff Laake
Again thanks for the input. I've been a recipient of this list for quite a few years although I don't post often. It is an invaluable resource and I appreciate the effort of all the contributors. I support a lot of software so I know how much work it can be. I've seen the reproducible code

[R] Installation: not creating necessary directories

2008-10-29 Thread Tim
I have tried installing R on a web server on which I have a user account but not root access. I checked and the PERL, Fortran, etc. prerequisites all seem in order. The compiling of R with: % ./configure --with-x=no This works fine without errors. I try a make check, however, and soon get an

[R] reporting interactions of factors in linear mixed effects models

2008-10-29 Thread epigone26
Hi, I have a question about how I should report the results for a linear mixed effects model where the model includes as predictors three factors (facA, facB and facC), one of which (facA) interacts with the other two. facA and facB have two levels and facC has 3 levels. There are also several

[R] Constrained panel linear regression

2008-10-29 Thread sara amoroso
Hi, I would like to impose an inequality constraint on one of the regression parameters of a panel linear model. How can I do that? Thanks for your help, Sara _ [[elided Hotmail spam]] [[alternative HTML version deleted]]

[R] ANOVA and T-test with means and SEs as imput

2008-10-29 Thread José Alberto Monteiro
Dear friends I am analysing the leaf expansion of a grass species and am interested in the speed of expansion. I produced exponential models for each of the treatments and got the equation for leaf size in function of time. I want to compare the coeficients that gives the initial inclination of

Re: [R] Suppressing internal grid in filled.contour

2008-10-29 Thread Jonathan Greenberg
Ok, I've placed the input files and the PDF on a website (I apologize for attaching the PDF -- the readme guide for this listserv indicated that PDFs were fine): http://www.cstars.ucdavis.edu/~jongreen/temp/ The full suite of commands I used are:

[R] Barplot: Vertical bars with long labels

2008-10-29 Thread Udo
Dear List, I need a barplot with vertical bars. Each bar should have a label. The problem is, that the labels are too long, so they overlap, or only every seccond label is displayed in the output. Here is a little syntax: dd - c(100,110,90,105,95) barplot(dd,names.arg=c('Conduct

Re: [R] Barplot: Vertical bars with long labels

2008-10-29 Thread Henrique Dallazuanna
Try this: nm - c('Conduct Disorders','Attention Deficit', 'Eating Disorders','Substance Abuse','Developmental Disorders') barplot(dd, names.arg = gsub( , \n, nm)) On Wed, Oct 29, 2008 at 4:43 PM, Udo [EMAIL PROTECTED] wrote: Dear List, I need a barplot with vertical bars. Each bar should have

[R] Help with Plots

2008-10-29 Thread Alex99
Hi there, I am trying to have a connectivity graph (two plots at once) in R: this is an example: x1=sin((0:100)*2*pi/100) y1=cos((0:100)*2*pi/100) plot(x1,y1) will draw a circle and x2=c(1,9,3,4,8,4,2,0) y2=c(3,6,8,2,4,1,9,6) plot(x2,y2,type=b) will draw a graph with corresponding x's and

Re: [R] Barplot: Vertical bars with long labels

2008-10-29 Thread Christos Hatzis
Udo, You can try inserting a newline where you need the break in your labels: dd.names - c('Conduct Disorders','Attention Deficit', 'Eating Disorders', 'Substance Abuse','Developmental Disorders') dd.names.2 - sapply(dd.names, function(x) gsub(\\s, \\\n, x)) barplot(dd, names.arg=dd.names.2)

Re: [R] Barplot: Vertical bars with long labels

2008-10-29 Thread Udo
Thanks a lot, Henrique and Christos! It works fine Quoting Christos Hatzis [EMAIL PROTECTED]: Udo, You can try inserting a newline where you need the break in your labels: dd.names - c('Conduct Disorders','Attention Deficit', 'Eating Disorders', 'Substance Abuse','Developmental

Re: [R] behavior of by

2008-10-29 Thread Sebastian P. Luque
On Wed, 29 Oct 2008 10:49:03 -0700, Jeff Laake [EMAIL PROTECTED] wrote: Again thanks for the input. I've been a recipient of this list for quite a few years although I don't post often. It is an invaluable resource and I appreciate the effort of all the contributors. I support a lot of

Re: [R] Help with Plots

2008-10-29 Thread stephen sefick
#How about this? x1=6*(sin((0:100)*2*pi/100))+4 y1=6*(cos((0:100)*2*pi/100))+4 plot(x1,y1) x2=c(1,9,3,4,8,4,2,0) y2=c(3,6,8,2,4,1,9,6) lines(x2,y2,type=b) On Wed, Oct 29, 2008 at 2:48 PM, Alex99 [EMAIL PROTECTED] wrote: Hi there, I am trying to have a connectivity graph (two plots at once) in

[R] call works with gee and yags, but not geepack

2008-10-29 Thread Juliet Hannah
I have included data at the bottom of this email. It can be read in by highlighting the data and then using this command: dat - read.table(clipboard, header = TRUE,sep=\t) I can obtain solutions with both of these: library(gee) fit.gee-gee(score ~ chem + time, id=id,

[R] Subsetting data in a loop

2008-10-29 Thread t c
I need some help with sub-setting my data.  I am trying to divide a data frame into multiple data frames based on the year collected, and stored in a list with each new data frame labeled with year X where X is the year the data was collected.  When I run my current code I get nine error

Re: [R] Subsetting data in a loop

2008-10-29 Thread hadley wickham
?split. Hadley On Wed, Oct 29, 2008 at 3:22 PM, t c [EMAIL PROTECTED] wrote: I need some help with sub-setting my data. I am trying to divide a data frame into multiple data frames based on the year collected, and stored in a list with each new data frame labeled with year X where X is the

Re: [R] call works with gee and yags, but not geepack

2008-10-29 Thread Juliet Hannah
Sorry. I did not output the NAs correctly. dat - read.table(clipboard, header = TRUE) id treat time1 time2 time3 time4 chem1 chem2 chem3 chem4 time score chem 1 1 20 18 15 15 1000 1100 1200 1300 0 20 1000 1 1 20 18 15 15 1000 1100 1200 1300 2 18 1100 1 1 20 18 15 15 1000 1100 1200 1300 3 15 1200

[R] Functional pattern-matching in R

2008-10-29 Thread Alexy Khrabrov
I found there's a very good functional set of operations in R, such as apply family, Hadley Wickham's lovely plyr, etc. There's even a Reduce (a.k.a. fold). Now I wonder how can we do pattern-matching? E.g., now I split dimensions like this: m - dim(V)[1] # R n - dim(V)[2]

[R] substring/strsplit question

2008-10-29 Thread Erin Hodgess
Dear R People: Here is a toy example: x - c(2E,5W,12H) substr(x,2,2) [1] E W 2 Sometimes x has 3 elements, sometimes 2. I want to extract the last element, and then extract the other 1 or 2 elements. How can I do this, please? TIA, Sincerely, Erin -- Erin Hodgess Associate Professor

Re: [R] substring/strsplit question

2008-10-29 Thread Erik Iverson
## untested last - tail(x, n = 1) first - head(x, n = length(x) - 1) Erin Hodgess wrote: Dear R People: Here is a toy example: x - c(2E,5W,12H) substr(x,2,2) [1] E W 2 Sometimes x has 3 elements, sometimes 2. I want to extract the last element, and then extract the other 1 or 2 elements.

Re: [R] substring/strsplit question

2008-10-29 Thread Henrique Dallazuanna
Try this: library(gsubfn) ## The last character strapply(x, (.)$, simplify = TRUE) ## The last two character strapply(x, (..)$, simplify = TRUE) On Wed, Oct 29, 2008 at 6:57 PM, Erin Hodgess [EMAIL PROTECTED]wrote: Dear R People: Here is a toy example: x - c(2E,5W,12H) substr(x,2,2)

Re: [R] substring/strsplit question

2008-10-29 Thread davidr
How about x - c(2E,5W,12H) substr(x, nchar(x), nchar(x)) [1] E W H substr(x, 1, nchar(x)-1) [1] 2 5 12 -- David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erin Hodgess Sent: Wednesday, October 29, 2008 3:58 PM To: [EMAIL PROTECTED] Subject:

Re: [R] substring/strsplit question

2008-10-29 Thread Marc Schwartz
on 10/29/2008 03:57 PM Erin Hodgess wrote: Dear R People: Here is a toy example: x - c(2E,5W,12H) substr(x,2,2) [1] E W 2 Sometimes x has 3 elements, sometimes 2. I want to extract the last element, and then extract the other 1 or 2 elements. How can I do this, please? TIA,

Re: [R] call works with gee and yags, but not geepack

2008-10-29 Thread Rolf Turner
On 30/10/2008, at 9:08 AM, Juliet Hannah wrote: I have included data at the bottom of this email. It can be read in by highlighting the data and then using this command: dat - read.table(clipboard, header = TRUE,sep=\t) I can obtain solutions with both of these: library(gee)

[R] Macro stuff to work on up through august 2007

2008-10-29 Thread stephen sefick
Title says it all remember cast() with sum as the aggregation function -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us

Re: [R] linux batch question

2008-10-29 Thread Rolf Turner
On 30/10/2008, at 10:46 AM, [EMAIL PROTECTED] wrote: I usually just run my R programs at the R command prompt but for my latest one I want to save any output that gets written to the screen so I am trying to use R CMD BATCH and send the output to an output file. I realize I could use sink

Re: [R] problem with simtest

2008-10-29 Thread Henric Nilsson (Public)
Susana Zuloaga wrote: Hello all I am working with the package multcomp but I have problems with the function simtest; the program say that can not find this function, nevertheless I doesn't have any problem with the function glht that it is in the same package. Someone knows what could be

Re: [R] how to restrict a parameter in optim()

2008-10-29 Thread Ben Bolker
Luis SAGAON TEYSSIER luis.sagaon_teyssier at etumel.univmed.fr writes: Dear all, I'm trying to estimate some parameters with the optim() function but I need to restrict one parameter and I have not found how to do it. Could you help me please? Thought someone else would answer by

Re: [R] Functional pattern-matching in R

2008-10-29 Thread Duncan Murdoch
On 29/10/2008 4:39 PM, Alexy Khrabrov wrote: I found there's a very good functional set of operations in R, such as apply family, Hadley Wickham's lovely plyr, etc. There's even a Reduce (a.k.a. fold). Now I wonder how can we do pattern-matching? E.g., now I split dimensions like this:

[R] FW: Re: linux batch question

2008-10-29 Thread markleeds
Hi Phil: That's EXACTLY what it is. Thanks so much. It's nice to know that the R Gods don't hate me. I hope it's okay that I'm going to cc r-help in case this thread comes up in the future and also so that other people who might want to help know that it's solved. Thanks again. On Wed,

Re: [R] linux batch question

2008-10-29 Thread markleeds
thanks Rolf. Yes, I meant temp.R. I was going to use test.R but then I realized that I already had a program named that. I think the R gods are really hating me !!! it's a very odd thing. I'll grep the file because maybe the output is in there somewhere and i'm missing it ? On Wed,

Re: [R] Macro stuff to work on up through august 2007

2008-10-29 Thread stephen sefick
sorry guys. I have a cold and I am not thinking very clearly On Wed, Oct 29, 2008 at 5:50 PM, stephen sefick [EMAIL PROTECTED] wrote: Title says it all remember cast() with sum as the aggregation function -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's

[R] how can I access parts of yags output

2008-10-29 Thread Juliet Hannah
Here is an example given from ?yags library(methods) data(stackloss) Y1 - yags(stack.loss~Air.Flow,id=1:21, data=stackloss) How can I access parts of the output. I tried: str(Y1) Formal class 'yagsResult' [package yags] with 25 slots ..@ coefficients : num [1:2] -44.13 1.02 ..@

[R] Plotting iregular time series

2008-10-29 Thread Levy,Ilan [Ontario]
Hi, I have several time series that I need to plot on the same plot. There are 3 problems with these series: 1. they do not start or end at the same times 2. they have different time intervals (seconds, minutes or hours) 3. they all have random missing time steps of a few step to longer periods

Re: [R] Plotting iregular time series

2008-10-29 Thread stephen sefick
why not look at the zoo package it can deal with time irregular time series. I have used it and I have been very happy. On Wed, Oct 29, 2008 at 5:52 PM, Levy,Ilan [Ontario] [EMAIL PROTECTED] wrote: Hi, I have several time series that I need to plot on the same plot. There are 3 problems with

[R] Regression versus functional/structural relationship?

2008-10-29 Thread Ravi Varadhan
Hi, I am dealing with the following problem. There are two biochemical assays, say A and B, available for analyzing blood samples. Half the samples have been analyzed with A. Now, for some insurmountable logistic reasons, we have to use B to analyze the remaining samples. However, we can do

Re: [R] how can I access parts of yags output

2008-10-29 Thread Rolf Turner
On 30/10/2008, at 11:48 AM, Juliet Hannah wrote: Here is an example given from ?yags library(methods) data(stackloss) Y1 - yags(stack.loss~Air.Flow,id=1:21, data=stackloss) How can I access parts of the output. I tried: str(Y1) Formal class 'yagsResult' [package yags] with 25 slots

Re: [R] License Question

2008-10-29 Thread Chi Chan
Just remember that the Linux kernel is also licensed under GPL v2. I am not sure if you pay for your Linux distribution. But for many gov sites and for my copy of Linux, they just use Linux as a completely free product -- in the sense that no money needs to be paid to a company or anyone.

Re: [R] substring/strsplit question

2008-10-29 Thread Gabor Grothendieck
Assuming that by elements you mean characters (2E is the first element of x but E is the last character in x[1]) then this will create a character matrix of dimensions: length(x) by 2 such that each row corresponds to one component of x and the second column in that row holds its last character

Re: [R] Functional pattern-matching in R

2008-10-29 Thread Gabor Grothendieck
Using the list function defined here: http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html list[m, n] - as.list(dim(iris)) mylist - as.list(1:5) list[Head, Tail] - list(mylist[[1]], mylist[-1]) On Wed, Oct 29, 2008 at 4:39 PM, Alexy Khrabrov [EMAIL PROTECTED] wrote: I found there's a very

[R] Q: rbind problem in my code

2008-10-29 Thread Andy Zhu
I have a large matrix which is divided into several pieces, manipulated individually, and saved into RData in disc. After each pieces are done with operation, I load them into memory and use rbind to stack them back into matrix. however, the rbind is only give me the last two pieces. The

[R] tklistbox selection

2008-10-29 Thread Sundar Dorai-Raj
Hi, I'm posting yet another question about tcltk since I'm still struggling with the package. I'm trying to create a tklistbox and a ttkcombobox on the same parent and am having a problem. Here's an example: library(tcltk) tt - tktoplevel() tcl1 - tclVar() tcl2 - tclVar() tclObj(tcl1) -

  1   2   >