[R] How to find out the trend during a time period?

2010-10-28 Thread Lao Meng
Hi all: I have a dataset which contains two variables: Y and time y-c(228,189,232,198,252,315) time-2003:2008 How can I find out the trend(increase/decrease) of y along the time period? If I use: lm(y~time) The lm command treats time as natural number,but not date. So maybe lm isn't

[R] times

2010-10-28 Thread thoeb
Hi! I have an input table with a column Dates in the format month/day/year (eg. 5/11/1999 and a column Times in the format hours/minutes (eg. 15:20). In R I need to convert them into chron objects to extract colums only containing months, days, minutes, .. For the dates it is no problem if I

[R] Creating truly global variable within function within namespace

2010-10-28 Thread Murray Stokely
I am trying to create a function with a package with a NAMESPACE that will save() some variables, distribute an Rdata file to another computer, where it will be load()ed. The problem is that this load() tries to load the namespace of the package on the original computer that created the .Rdata

Re: [R] add diagonal line

2010-10-28 Thread Gavin Simpson
On Wed, 2010-10-27 at 13:17 -0200, Marcelo Lima wrote: Hi, I would like to add a line on the diagonal of a covariance matrix, is there a quick way to do it besides abline? Thanks! What's wrong with abline()? It does exactly what you want. By the way, reproducible example such as

Re: [R] How to find out the trend during a time period?

2010-10-28 Thread Uwe Ligges
On 28.10.2010 06:50, Lao Meng wrote: Hi all: I have a dataset which contains two variables: Y and time y-c(228,189,232,198,252,315) time-2003:2008 How can I find out the trend(increase/decrease) of y along the time period? If I use: lm(y~time) The lm command treats time as natural

[R] overloading the generic primitive functions + and [

2010-10-28 Thread Mark Heckmann
How can I add a new method to the generic function [ or + I want to create a S3 and S4 class that will use the [ and + method in a different way. How can I overload the generic primitive [ or + so the method dispatch will work correctly for my class? I saw an example of this in the ggplot2

[R] Tukeys after(g)lmer

2010-10-28 Thread Henrik Thurfjell
Hello, I have a model I made with a binomially distributed response, 2 vectors and two factors with 5 and 12 levels respectively, and a random effect (intercept). What I am interested in is doing a post-hoc test to tell which levels of the factors differ from each other.

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Barry Rowlingson
On Thu, Oct 28, 2010 at 9:31 AM, Mark Heckmann mark.heckm...@gmx.de wrote: How can I add a new method to the generic function [ or + I want to create a S3 and S4 class that will use the [ and + method in a different way. How can I overload the generic primitive [ or + so the method dispatch

[R] updating a local package

2010-10-28 Thread Robert Kinley
Hi folks I have inherited a package which was created before release 2.10 and I need to have it working in release 2.12 There is a folder containing the Man, Data and R subfolders, and the description file, and there is also the corresponding zip file. I can install the package from the zip

[R] replace text at certain positions in a file

2010-10-28 Thread RINNER Heinrich
Hello, I am working with R version 2.10.1 under windows. In a text file, I need to replace all characters at certain column positions with blanks. For example, say the file contains two lines and looks like this: ab34cd78e fg3 hi78j I'd like to replace everything at positions 3-4 and 7-8 with

Re: [R] updating a local package

2010-10-28 Thread Uwe Ligges
Essential infrastructure work has been done in the meantime, both ion the documentation system and on the location of binaries. That means you really need to reinstall the package and hence you need to start with a source package. Details for installing from source are given in the manual R

Re: [R] replace text at certain positions in a file

2010-10-28 Thread Uwe Ligges
I'd just import the positions I like using read.fwf() or otherwise you can replace strings at certain positions, see ?substr Uwe Ligges On 28.10.2010 11:26, RINNER Heinrich wrote: Hello, I am working with R version 2.10.1 under windows. In a text file, I need to replace all characters at

Re: [R] Changing origin of line in radial plot

2010-10-28 Thread Jim Lemon
On 10/28/2010 07:14 AM, Gonzalo Garcia-Perate wrote: I am creating radial plots to visualise popularity of a series of topics, I was wondering if someone has come across a radial plot in which the lines originate from the edge of the plot instead of the centre, does anyone know how can this be

[R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread Enrico R. Crema
Dear List, I've been running a numerical simulation and I found this odd error in my code where the which command could not identify which rows of a column of data.frame were corresponding to the value 0.3. There are 7 unique values in this column (0.01,0.05,0.1,0.2,0.3,0.4,0.5), and this does

Re: [R] updating a local package

2010-10-28 Thread Robert Kinley
your advice to useR CMD INSTALL source.library did the trick and I now understand packages a little better. many thanks Bob Kinley Uwe Ligges lig...@statistik.tu-dortmund.de 28/10/2010 10:30 To Robert Kinley kinley_rob...@lilly.com cc

Re: [R] times

2010-10-28 Thread Thomas Levine
I couldn't figure that out, but you can work around it by adding the seconds chron(dates=lwc.file[,1],times=paste(lwc.file[,2],':00',sep='')) Tom 2010/10/28 thoeb t.hoebin...@gmail.com: Hi! I have an input table with a column Dates in the format month/day/year (eg. 5/11/1999 and a column

Re: [R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread Rubén Roa
Enrico, The same happens with other numbers/sequences. seq(0.1,0.9,0.1)[7]==0.7 [1] FALSE seq(0.1,1.3,0.1)[12]==1.2 [1] FALSE Rounding seems to fix it, round(seq(0.1,0.5,0.1),1)[3]==0.3 round(seq(0.1,0.9,0.1),1)[7]==0.7 round(seq(0.1,1.3,0.1),1)[12]==1.2 They all return TRUE.

Re: [R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/10/10 12:23, Enrico R. Crema wrote: Dear List, I've been running a numerical simulation and I found this odd error in my code where the which command could not identify which rows of a column of data.frame were corresponding to the value

Re: [R] updating a local package

2010-10-28 Thread Uwe Ligges
On 28.10.2010 12:26, Robert Kinley wrote: your advice to useR CMD INSTALL source.library It's a *package*, not a library. Uwe did the trick and I now understand packages a little better. many thanks Bob Kinley Uwe

Re: [R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread Enrico R. Crema
Well...thanks to everybody for suggestions and reading...I guess I have to study more! Enrico On 28 Oct 2010, at 11:48, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/10/10 12:23, Enrico R. Crema wrote: Dear List, I've been running a numerical simulation and I

Re: [R] updating a local package

2010-10-28 Thread Robert Kinley
I stand corrected :0) Robert Kinley Uwe Ligges lig...@statistik.tu-dortmund.de 28/10/2010 11:54 To Robert Kinley kinley_rob...@lilly.com cc r-help@r-project.org Subject Re: [R] updating a local package On 28.10.2010 12:26, Robert Kinley wrote: your advice to

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Christofer Bogaso
Dear Barry, this is really interesting. However I could not understand this line: Ops.ss=function(e1,e2){paste(e1,e2)} Where you have told R to behave + function differently when it faces ss class? What should be the ideal approach if I what to use * function? Thanks, On Thu, Oct 28, 2010 at

Re: [R] Changing origin of line in radial plot

2010-10-28 Thread Gonzalo Garcia-Perate
Jim, thanks for your reply, it works! but the results are not what I expected. What the code does now is completely reverse the central chart area, so what was coloured before now is white, see here http://www.flickr.com/photos/gonzillaaa/ What I was hoping for, was having the same length lines

Re: [R] replace text at certain positions in a file

2010-10-28 Thread Gabor Grothendieck
On Thu, Oct 28, 2010 at 5:26 AM, RINNER Heinrich heinrich.rin...@tirol.gv.at wrote: Hello, I am working with R version 2.10.1 under windows. In a text file, I need to replace all characters at certain column positions with blanks. For example, say the file contains two lines and looks like

Re: [R] times

2010-10-28 Thread Gabor Grothendieck
On Thu, Oct 28, 2010 at 1:06 AM, thoeb t.hoebin...@gmail.com wrote: Hi! I have an input table with a column Dates in the format month/day/year (eg. 5/11/1999 and a column Times in the format hours/minutes (eg. 15:20). In R I need to convert them into chron objects to extract colums only

[R] Install Error

2010-10-28 Thread Johannes Graumann
Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ... Error in scan(file, what, nmax, sep, dec, quote, skip,

Re: [R] How to find out the trend during a time period?

2010-10-28 Thread Gabor Grothendieck
2010/10/28 Uwe Ligges lig...@statistik.tu-dortmund.de: On 28.10.2010 06:50, Lao Meng wrote: Hi all: I have a dataset which contains two variables: Y and time y-c(228,189,232,198,252,315) time-2003:2008 How can I find out the trend(increase/decrease) of y along the time period? If I

[R] Clustering

2010-10-28 Thread dpender
I am looking to use R in order to determine the number of extreme events for a high frequency (20 minutes) dataset of wave heights that spans 25 years (657,432) data points. I require the number, spacing and duration of the extreme events as an output. I have briefly used the clusters function

Re: [R] Install Error

2010-10-28 Thread Duncan Murdoch
On 28/10/2010 7:54 AM, Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ... Error in

Re: [R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread S Ellison
Enrico R. Crema enryu_cr...@yahoo.it 28/10/2010 12:08:55 Well...thanks to everybody for suggestions and reading...I guess I have to study more! ... On 28/10/10 12:23, Enrico R. Crema wrote: I can't provide you a link for more details, The canonical link is R FAQ 7.31 in the

Re: [R] 0.3 is not 0.3, bug in seq() function?

2010-10-28 Thread Ivan Calandra
Hi, It is a know issue, reported in the FAQ 7.31. Ivan Le 10/28/2010 13:08, Enrico R. Crema a écrit : Well...thanks to everybody for suggestions and reading...I guess I have to study more! Enrico On 28 Oct 2010, at 11:48, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Re: [R] Install Error

2010-10-28 Thread Johannes Graumann
Duncan Murdoch wrote: On 28/10/2010 7:54 AM, Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building

[R] scatterplot3d; scaling point symbols to depth of graph

2010-10-28 Thread John Coulthard
Hi I'm trying to scale the point symbols on a 3d plot so that the ones at the front are larger than the ones at the back. I'm trying to give the image some perspective. Given this code... library(scatterplot3d) data=array(c(0,5,9), c(3,3)) scatterplot3d(data, pch=19,

[R] Calculate percent occurrence of different values

2010-10-28 Thread Vanessa J
Hello, I am relatively new to R. I am trying to do the following and cannot figure out a relatively fast, clean method of doing it in R. Here is a simple sample of what my data set looks like: ID TryNum Dir 1 1 1 1 1 1 2 4 1 1 3 2 1 2

[R] R and Matlab

2010-10-28 Thread Santosh Srinivas
Dear Group, I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not

Re: [R] Regular time series with irregular start and end dates

2010-10-28 Thread Wesley Roberts
Dear Gabor, Many thanks for your suggestions, I could not get seq(as.Date(2005-09-13), as.Date(2006-10-15), by = 16) to work with ts so have chosen to use the zooreg solution you suggested. In the end, all I want to do is graph the values with the correct time scale on the x-axis. Later we may

Re: [R] Calculate percent occurrence of different values

2010-10-28 Thread Henrique Dallazuanna
Try this: prop.table(xtabs(~ paste(ID, Num) + Dir, x), 1) On Thu, Oct 28, 2010 at 7:06 AM, Vanessa J vanja...@hotmail.com wrote: Hello, I am relatively new to R. I am trying to do the following and cannot figure out a relatively fast, clean method of doing it in R. Here is a simple sample

[R] Please help me about Monte Carlo Permutation

2010-10-28 Thread Chitra
Dear R experts, I am sorry for my inability. I have the following dataset: Qtot Itot 1 73 684 2 64 451 3 71 378 4 65 284 5 47 179 6 31 117 7 19 69 Now I need to perform Monte Carlo Pertutation test underlaying the following condition. Condition In order to choose

Re: [R] R and Matlab

2010-10-28 Thread Claudia Beleites
I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not readable by

[R] RGTK2 - Entry Point not found

2010-10-28 Thread W Eryk Wolski
I have a problem loading RGtk2 Platform: Windows XP R 2.11.1 In the popup window I get: The procedure entry point cairo_clip_extends could not be located in the dynamic link library libcairo-2.dll and in the R command: Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to

[R] [SOLVED] Re: Install Error

2010-10-28 Thread Johannes Graumann
Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ... Error in scan(file, what,

[R] RGTK2 - Entry Point not found

2010-10-28 Thread W Eryk Wolski
I have a problem loading RGtk2 Platform: Windows XP R 2.11.1 In the popup window I get: The procedure entry point cairo_clip_extends could not be located in the dynamic link library libcairo-2.dll and in the R command: Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to

Re: [R] [SOLVED] Re: Install Error

2010-10-28 Thread Johannes Graumann
Johannes Graumann wrote: Johannes Graumann wrote: Hi, I'm running into the error below when doing R CMD INSTALL MyPackage.tar.gz. This didn't use to be this way and I am at a loss as to where this might be coming from. Any pointers where to look? Joh ** building package indices ...

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Martin Morgan
On 10/28/2010 02:17 AM, Barry Rowlingson wrote: On Thu, Oct 28, 2010 at 9:31 AM, Mark Heckmann mark.heckm...@gmx.de wrote: How can I add a new method to the generic function [ or + I want to create a S3 and S4 class that will use the [ and + method in a different way. How can I overload

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Łukasz Ręcławowicz
The stable version of RGtk2 requires GTK version 2.8.0 or higher (and its dependencies). -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] R and Matlab

2010-10-28 Thread Thomas Levine
Is there a particular reason you can't use csv? write.csv() in R It seems that you can read csv in Matlab with this http://www.mathworks.com/help/techdoc/ref/importdata.html Tom 2010/10/28 Claudia Beleites cbelei...@units.it: I am looking for ways to use R and Matlab. Doing the data

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Barry Rowlingson
On Thu, Oct 28, 2010 at 2:12 PM, Martin Morgan mtmor...@fhcrc.org wrote: Not so hard, eh? Though then like your S3 implementation this makes all 'Ops' (see ?Ops) Except you have to re-run the set* things every R session: setClass(SS, character) setMethod(Ops, c(SS, SS), function(e1, e2)

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Barry Rowlingson
On Thu, Oct 28, 2010 at 12:14 PM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Dear Barry, this is really interesting. However I could not understand this line: Ops.ss=function(e1,e2){paste(e1,e2)} Where you have told R to behave + function differently when it faces ss class? What

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread W Eryk Wolski
Failed to load RGtk2 dynamic library, attempting to install it. trying URL 'http://downloads.sourceforge.net/gladewin32/gtk-2.12.9-win32-2.exe' Content type 'application/x-msdownload' length 7378984 bytes (7.0 Mb) I run the complete setup of GTK . Hence, I assume Version 2.12.9 is installed on my

[R] Key combination that removes all R objects

2010-10-28 Thread claire-c.jones
Dear readers, There is a combination of keys that I have (on several occasions now) typed by accident into R (2.10.0) which removes all the objects in the environment, and clears the console, as though I had typed rm(list=ls()). Unfortunately I don't know what the combination of keys are, so I

[R] bugs when using R-2.12.0 Please HELP!

2010-10-28 Thread Hao Wu
Hi, R-help group, I kinda meeting a question when using R-2.12.0(Previous version is 2.10.0): When I typed library(Biobase), everything is alright! But when I type library(genefilter), it doesn't work! And echo this: Error in library.dynam(lib, package, package.lib) : DLL 'RSQLite'

Re: [R] bugs when using R-2.12.0 Please HELP!

2010-10-28 Thread David Winsemius
On Oct 28, 2010, at 10:01 AM, Hao Wu wrote: Hi, R-help group, I kinda meeting a question when using R-2.12.0(Previous version is 2.10.0): When I typed library(Biobase), everything is alright! But when I type library(genefilter), it doesn't work! And echo this: Error in library.dynam(lib,

[R] Heatmap construction problems

2010-10-28 Thread Struchtemeyer, Chris
I am very new to R and don't have any computer program experience whatsoever. I am trying to generate a heatmap of the following data: Phylum,AI,AJT,BY,GA,Grt,Sm Acidobacteria,0.5,0.7,2.7,0.1,2.6,1.0 Actinobacteria,33.7,65.1,9.7,2.0,3.9,2.1 Bacteroidetes,9.7,5.6,0.7,13.2,41.1,21.6

[R] adding environment variables

2010-10-28 Thread Robert M. Flight
Hi All, I am developing a package that requires information about the location of a set of files that will be used often in the calculations. In my current version, I define the location in the main file that calls all the subfunctions. This works fine when you are installing from source, but

Re: [R] Please help me about Monte Carlo Permutation

2010-10-28 Thread Kjetil Halvorsen
This is one way. I read your two columns of data into two variables, x and y. Then: test - replicate(5000, cor(x, sample(y))) hist(test) Kjetil On Thu, Oct 28, 2010 at 9:49 AM, Chitra cbban...@gmail.com wrote: Dear R experts, I am sorry for my inability. I have the following dataset:  

Re: [R] coxph linear.predictors

2010-10-28 Thread Bond, Stephen
To close the issue: S.ave - survfit(fit) # this is average survival S.1 - (S.ave$surv)^exp(fit$linear.predictors[1]) # get subject 1 S.1 [1] 0.848450223861993 0.696973203043377 0.530604282995790 0.391136296063732 0.228370373409774 0.132991279576665 0.071742127376216 [8] 0.030988671457923

Re: [R] R and Matlab

2010-10-28 Thread Claudia Beleites
On 10/28/2010 03:16 PM, Thomas Levine wrote: Is there a particular reason you can't use csv? (Not sure whether I'm meant - as I also suggested csv to Santosh) But: - It used to work, so there may be code existing that is broken now (e.g. I do have such code, but at least for the moment it

Re: [R] Key combination that removes all R objects

2010-10-28 Thread Viechtbauer Wolfgang (STAT)
I am not aware of the existance of a shortcut that would do what you describe. On Windows, one could hit Ctrl-M, followed by R, but then one gets a prompt, asking for confirmation to remove all objects, but this can't be what you are referring to. Are you perhaps using Tinn-R and

Re: [R] Merging nested lists

2010-10-28 Thread Charles C. Berry
On Wed, 27 Oct 2010, Charles C. Berry wrote: On Wed, 27 Oct 2010, Alex P. wrote: Hello All, I have multiple list of lists in the form of Mylist1[[N]][[K]]$Name_i, with N=1..6, K=1..3, and i=1..7. Each Name_i is a matrix. I have 30 of these objects Mylist1, Mylist2, ... I would like

[R] Rsolnp examples

2010-10-28 Thread Jan Theodore Galkowski
I'm interested in the Rsolnp package. For their primary function solnp, one example is given, and there is a reference to unit tests. Anyone know where these can be found? Also, Rsolnp is used in a few other packages (e.g., depmixS4), but I cannot seem to find source illustrating its call

Re: [R] runtime on ising model

2010-10-28 Thread Michael D
Mike, I'm not sure what you mean about removing foo but I think the method is sound in diagnosing a program issue and the results speak for themselves. I did invert my if statement at the suggestion of a CS professor (who also suggested recoding in C, but I'm in an applied math program and

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Łukasz Ręcławowicz
W dniu 28 pa¼dziernika 2010 16:09 u¿ytkownik W Eryk Wolski wewol...@gmail.com napisa³: Any other ideas? Restart R and then try load library :) -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] runtime on ising model

2010-10-28 Thread David Winsemius
On Oct 28, 2010, at 11:52 AM, Michael D wrote: Mike, I'm not sure what you mean about removing foo but I think the method is sound in diagnosing a program issue and the results speak for themselves. I did invert my if statement at the suggestion of a CS professor (who also suggested

[R] Returning highs and lows in R

2010-10-28 Thread Jason Kwok
I'm having trouble returning a rolling n period highest value for a data set. For each day I want to calculate the highest value over the last 3 days. I am using the following packages: zoo, xts, quantmod and TTR. Thanks, Jason GLD.Close 2010-10-01128.91 2010-10-04128.46

Re: [R] removing margin space between columns in lattice plots

2010-10-28 Thread Deepayan Sarkar
On Sat, Oct 23, 2010 at 9:25 AM, Stephen T. obsessiv...@hotmail.com wrote: Hi list, From the xyplot() documentation I'm guessing this may not be possible, but is there a way to specify a scale definition something between relation=free and relation=same such that the scales are fixed across

Re: [R] Returning highs and lows in R

2010-10-28 Thread Jorge Ivan Velez
Hi Jason, Please consider the following example: require(zoo) z2 - zoo(rnorm(6)) z2 1 2 3 4 5 6 -0.53305704 -1.09374867 1.55171109 -0.05830751 -0.25987647 -0.02009973 rollapply(z2, 3, max, by = 1) 2 3

Re: [R] Please help me about Monte Carlo Permutation

2010-10-28 Thread Chitra
Dear Kjetil, Thanks a lot for your help. I could not get histogram when I ask by R. It simply gave me blank plot between frequency and test. I want to plot sample (y) verses xl. Can you please tell me are both variables were permuted or only x? Thanking your help, Chitra -- View this message in

Re: [R] Returning highs and lows in R

2010-10-28 Thread Peter Ehlers
On 2010-10-28 09:27, Jason Kwok wrote: I'm having trouble returning a rolling n period highest value for a data set. For each day I want to calculate the highest value over the last 3 days. I am using the following packages: zoo, xts, quantmod and TTR. Isn't that exactly what rollmax() does?

[R] adding copies of rows toa data frame based upon start and end dates

2010-10-28 Thread Grant Gillis
Hello All and thanks in advance for any advice. I have a data frame with rows corresponding radio-collared animals (see sample data below). There is a start date (DATESTART), and end date (DATEEND), and the number of days on air (DAYSONAIR). What I would like to do is add a column called DATE

Re: [R] Returning highs and lows in R

2010-10-28 Thread Bert Gunter
Jason: Please read AND FOLLOW the posting guide on how to ask clear questions. Here, you need to more carefully define what you mean by the last 3 days. Do you mean:(a) the last 3 values in the series (including or excluding the present one?) or the last 3 calendar days -- e.g. for 10-05, only

Re: [R] overloading the generic primitive functions + and [

2010-10-28 Thread Hadley Wickham
Note how S3 methods are dispatched only by reference to the first argument (on the left of the operator). I think S4 beats this by having signatures that can dispatch depending on both arguments. That's somewhat of a simplification for primitive binary operators. R actually looks up the method

[R] ggplot2: facet_grid with only one level does not display the graph with the facet_grid level in title

2010-10-28 Thread Matthew Pettis
Hi All, Here is the code that I'll be referring to: p - ggplot(wastran.data, aes(PER_KEY, EVENTS)) (p - p + facet_grid( pool.short ~ .) + stat_summary(aes(y=EVENTS), fun.y = sum, geom=line) + opts(axis.text.x = theme_text(angle = 90, hjust=1), title=Events (15min.) vs. Time: Facet

Re: [R] lattice key subtitle

2010-10-28 Thread Deepayan Sarkar
On Tue, Oct 26, 2010 at 2:49 AM, Alexandru Dumitrescu alexandru.dumitre...@gmail.com wrote: Hello everybody, Is there a way to add a subtitle to a lattice key? None specifically for that purpose, but latticeExtra does have a mergedTrellisLegendGrob() function that may help: mylegend -

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Michael Lawrence
2010/10/28 W Eryk Wolski wewol...@gmail.com Failed to load RGtk2 dynamic library, attempting to install it. trying URL ' http://downloads.sourceforge.net/gladewin32/gtk-2.12.9-win32-2.exe' Content type 'application/x-msdownload' length 7378984 bytes (7.0 Mb) I run the complete setup of GTK

Re: [R] runtime on ising model

2010-10-28 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Thursday, October 28, 2010 9:20 AM To: Michael D Cc: r-help@r-project.org Subject: Re: [R] runtime on ising model On Oct 28, 2010, at 11:52 AM,

[R] R shp(ESRI) point patterns and marks

2010-10-28 Thread Gary Nobles
I have a point dataset (ESRI shp file) each point has an associated weight (grams) These are the weights of animal bones recovered from an archaeological excavation I am trying to import the shp file and then do a density plot of the weight data, so: #Import shp file library(spatstat)

Re: [R] Control of axis limits in multiple panel lattice plots

2010-10-28 Thread Deepayan Sarkar
On Wed, Oct 27, 2010 at 6:45 AM, Peter Davenport pwdavenp...@gmail.com wrote: I've found the solution to this in an old post of Deepayan's: lattice.options(axis.padding = list(numeric=0)) Or xyplot(a~b|c,data=test.df, scales = list(axs = i)) -Deepayan Best, Peter On 27 October 2010

[R] svm online course in R

2010-10-28 Thread Changbin Du
Hi, Dear Community, Several days ago, I received one email about the online svm course in R, I try to find it. Can someone forward the information to me. Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]] __

[R] GBM and Extracting the Model

2010-10-28 Thread Jeff
Hi all, I have found a couple posts on this topic but could not (yet) find an answer. Is there a way to extract the model (trees and weights) from the GBM package in order to program the prediction in a non R environment (SQL database)? The constraint of not using R is based on production

Re: [R] Returning highs and lows in R

2010-10-28 Thread Jason Kwok
Thanks for the help. I'm looking to calculate rolling max and means for the last 3 observations in my data including AND not including the current observation. I'm not sure how to offset the observations used. For the 3 period max, I would like to return the max value over the last 3

Re: [R] adding environment variables

2010-10-28 Thread Henrique Dallazuanna
Take a look in ?Sys.setenv On Thu, Oct 28, 2010 at 12:21 PM, Robert M. Flight rfligh...@gmail.comwrote: Hi All, I am developing a package that requires information about the location of a set of files that will be used often in the calculations. In my current version, I define the

Re: [R] runtime on ising model

2010-10-28 Thread David Winsemius
On Oct 28, 2010, at 12:20 PM, David Winsemius wrote: On Oct 28, 2010, at 11:52 AM, Michael D wrote: Mike, I'm not sure what you mean about removing foo but I think the method is sound in diagnosing a program issue and the results speak for themselves. I did invert my if statement at

Re: [R] wait for graph to finish plotting

2010-10-28 Thread news
pdf(file = ~/Dropbox/phd/results/graphs/TEST%03d.pdf) for (dataset in c(breastCancer,pima,heartDisease,crx,ionosphere,votes)) { p - eval(parse(text=paste(dataset,Probs,sep=))) m - melt(t(p)) title - titles[[dataset]]

Re: [R] Returning highs and lows in R

2010-10-28 Thread Jason Kwok
I figured out how to offset my observations by 1 period by using the rollapply(xx,3,max,align=right), which would calculate the mean for (current observation, obs - 1 and obs -2 ). How would I further offset by 1 more period? Thanks, Jason On Thu, Oct 28, 2010 at 1:29 PM, Jason Kwok

Re: [R] Please help me about Monte Carlo Permutation

2010-10-28 Thread Łukasz Ręcławowicz
I'm not sure is this correct, but maybe you are looking for something like this: test-function(){ permuted.Qtot-permn(data$Qtot) n-length(permuted.Qtot) correlation-rep(NA,n) for(i in 1:n){ correlation[i]-cor(data$Itot,permuted.Qtot[[i]])} p-sum(correlation=cor(data$Qtot,data$Itot))/n

[R] How to enable Arial font for postcript/pdf figure on Windows?

2010-10-28 Thread Agnès Paquet
Hi, I need to generate some figure using the Arial font as a requirement for PLoS. Following their guidelines, I have converted the windows font files arial.tff files to .afm using tff2afm (exec file from MikTeX), but when I try to generate a postcript file, the postcript device does not

Re: [R] wait for graph to finish plotting

2010-10-28 Thread David Winsemius
On Oct 28, 2010, at 1:27 PM, n...@aleblanc.cotse.net wrote: pdf(file = ~/Dropbox/phd/results/graphs/TEST%03d.pdf) for (dataset in c(breastCancer,pima,heartDisease,crx,ionosphere,votes)) { p - eval(parse(text=paste(dataset,Probs,sep=))) m - melt(t(p)) title - titles[[dataset]]

Re: [R] Generate random percentages and placing vectors

2010-10-28 Thread Aaron Lee
Thanks for the help! However, for the code in #2, it seems to just randomly split up the vectors. I would still like to keep the integrity of each vector. For example: if v1 = (1,2,3) v2 = (4,5,6) output = (0,0,0,1,2,3,0,0,0,0,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0) - which has a specified length of

Re: [R] Returning highs and lows in R

2010-10-28 Thread Jason Kwok
I was able to get what I wanted using the lag function to offset an addition period. lag(rollapply(xx,3,max),-2) or lag(rollapply(xx,3,max,align=right),-1) Thanks. Jason On Thu, Oct 28, 2010 at 1:49 PM, Jason Kwok jayk...@gmail.com wrote: I figured out how to offset my observations by 1

[R] RWeka, java.lang.NullPointerException

2010-10-28 Thread Markus Loecher
Dear all, I have trained a J48 classifier in RWeka but when I try to predict on new data I get the following exceptions: fit - J48(...) yNew - predict(fit, x, type=probability); Error in .jcall(RWekaInterfaces, [D, distributionForInstances, .jcast(classifier, : java.lang.NullPointerException

[R] help with help()

2010-10-28 Thread claudia tebaldi
Hi all Just this morning I upgraded to R 2.12.0 (for Mac OS X 10.6.4). All went well until I needed to run a help() or help.search() in my session, which I'm running within Emacs (ESS 5.3.7). Say I need help with the command 'density'. When I type help(density) or ?density the ESS help buffer

Re: [R] help with help()

2010-10-28 Thread Marc Schwartz
On Oct 28, 2010, at 1:20 PM, claudia tebaldi wrote: Hi all Just this morning I upgraded to R 2.12.0 (for Mac OS X 10.6.4). All went well until I needed to run a help() or help.search() in my session, which I'm running within Emacs (ESS 5.3.7). Say I need help with the command 'density'.

Re: [R] runtime on ising model

2010-10-28 Thread Mike Marchywka
Date: Thu, 28 Oct 2010 09:58:40 -0700 From: wdun...@tibco.com To: dwinsem...@comcast.net; mike...@gmail.com CC: r-help@r-project.org Subject: Re: [R] runtime on ising model -Original Message- From: r-help-boun...@r-project.org

Re: [R] help with help()

2010-10-28 Thread Marc Schwartz
On Oct 28, 2010, at 1:32 PM, Marc Schwartz wrote: On Oct 28, 2010, at 1:20 PM, claudia tebaldi wrote: Hi all Just this morning I upgraded to R 2.12.0 (for Mac OS X 10.6.4). All went well until I needed to run a help() or help.search() in my session, which I'm running within Emacs (ESS

Re: [R] help with help()

2010-10-28 Thread Joshua Wiley
Hi, Is it possible to upgrade your version of Emacs and ESS (ESS is up to 5.11)? The official website for ESS is: http://ess.r-project.org/ Vincent Goulet also maintains a nice distribution of the latest Emacs bundled with AUCTeX and ESS for Mac at:

Re: [R] help with help()

2010-10-28 Thread Erik Iverson
claudia tebaldi wrote: Hi all Just this morning I upgraded to R 2.12.0 (for Mac OS X 10.6.4). All went well until I needed to run a help() or help.search() in my session, which I'm running within Emacs (ESS 5.3.7). That's very old version of ESS, I have no problems with 2.12.0 with ESS

Re: [R] Clustering

2010-10-28 Thread Albyn Jones
I have worked with seismic data measured at 100hz, and had no trouble locating events in long records (several times the size of your dataset). 20 minutes is high frequency? what kind of waves are these? what is the wavelength? some details would help. albyn On Thu, Oct 28, 2010 at 05:00:10AM

Re: [R] scatterplot3d; scaling point symbols to depth of graph

2010-10-28 Thread Uwe Ligges
It's a bug (since I did not expect people to change the size of the symbols vectorized). Will provide a fix tomorrow. Uwe On 28.10.2010 11:28, John Coulthard wrote: Hi I'm trying to scale the point symbols on a 3d plot so that the ones at the front are larger than the ones at the back.

Re: [R] Generate random percentages and placing vectors

2010-10-28 Thread Henrique Dallazuanna
Try this: out - rep(0, 25) out[embed(seq(out), 3)[sample(1:(length(out) - 2), 2),]] - rev(rbind(v1, v2)) On Thu, Oct 28, 2010 at 3:59 PM, Aaron Lee aaron.zl@gmail.com wrote: Thanks for the help! However, for the code in #2, it seems to just randomly split up the vectors. I would still

[R] How do I install (download) a package with my own package?

2010-10-28 Thread Ian Schiller
I want to create my own package in which some of my functions depend on functions already existing in another package that is not part of the default library (i.e. when you install R for the first time, you need to download that package to access the functions.) Is there a way to bundle this

  1   2   >