[R] Create a function to number each repeated visit or measurements

2012-09-04 Thread Jon Toledo
Hi dear R list members, I am trying to create a numerical variable that tracks the visits/entries that a subject has had. For example having a database of repeated serial measurements that are ordered by subject and time. So I would get a variable that says 0 for baseline visit/measurement, 1

[R] get only little part of html with htmlParse

2012-09-04 Thread ????????
Here is my code. there are three method to get text to be parded by htmlParse function. 1.file on mycomputer options(encoding=gbk) library(XML) xmltext1 - htmlParse(/home/tiger/Desktop/27174.htm ) #/home/tiger/Desktop/27174.htm is the file of http://www.jb51.net/article/27174.htm

Re: [R] boxplot - bclust

2012-09-04 Thread David Meyer
These are warnings and I think that you can safely ignore them. It looks like the code should replace the line if (x$datamean) with something like if (!is.null(x$datamean)) Yes, I think so too - thanks for reporting this. David __

[R] binary data

2012-09-04 Thread Juan Fernández Tajes
Dear list, Hello to everybody, I´m interested in finding a package for statistical analysis of binary data, I have a matrix with the following structure: Case1 Case2 Case 3 ... CaseX Control1 Control2 Control3 ... ControlY Pep1 1 0 1 1 0 0 0 1 Pep2 1 1 1 1 1 0 0 1 Pep3 0 1 1 1 1 0

Re: [R] [newbie] scripting remote check for R package

2012-09-04 Thread Daróczi Gergely
You might try: R --slave -e 'as.numeric(suppressWarnings(suppressPackageStartupMessages(require(ggplot2' Best, Gergely On Tue, Sep 4, 2012 at 3:30 AM, Tom Roche tom_ro...@pobox.com wrote: https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html for RSERVER in 'foo' 'bar' 'baz'

[R] boxplot of hierachical cluster

2012-09-04 Thread Dominic Roye
Hello everybody, I would like to make boxplots for my hierachical cluster, but only i found a package that not works with the current version. http://acccn.net/cr569/Rstuff/Minka/mining/html/boxplot.hclust.html I hope you can help me. Thank you. Best regards, Dominic library(cluster)

Re: [R] R suitability for development project

2012-09-04 Thread Jim Lemon
On 09/03/2012 11:18 PM, Eric Langley wrote: chomp I note: Is it possible to have the output as an integer where 99 is the highest score? It certainly is. The mean ranks are: Item2Item3Item4 Totals 1.571429 1.642857 2.857143 3.928571 To make the highest score 99 (meaning the

Re: [R] Horizontal grid in background of barplot

2012-09-04 Thread Jim Lemon
On 09/04/2012 05:12 AM, David Arnold wrote: All, I have: x- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x)- c(Cold or flu,Headache,Backache); colnames(x)- c(Went to doctor,No response,Did nothing,Self-medicated) x- t(x) print(x) barplot(x,beside=TRUE,

Re: [R] Adding summary title to table

2012-09-04 Thread Patrick Connolly
On Mon, 03-Sep-2012 at 03:25PM -0700, David Arnold wrote: | All, | | I have: | | x - matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) | rownames(x) - c(Cold or flu,Headache,Backache); | colnames(x) - c(Went to doctor,No response,Did | nothing,Self-medicated) | x - t(x) | print(x) | |

Re: [R] Create a function to number each repeated visit or measurements

2012-09-04 Thread PIKAL Petr
Hi You did not provided any suitable data. x-sort(sample(letters[1:5], 50, rep=T)) unlist(lapply(split(x,x), function(x) (1:length(x))-1)) gives you a vector of indices from 0 to n for sorted vector x. Regards Petr -Original Message- From: r-help-boun...@r-project.org

[R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread Meyners, Michael
All, I realize from the archive that the sort argument in merge has been subject to discussion before, though I couldn't find an explanation for this behavior. I tried to simplify this to (kind of) minimal code from a real example to the following (and I have no doubts that there are smart

Re: [R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread Rui Barradas
Hello, Inline. Em 04-09-2012 12:24, Meyners, Michael escreveu: All, I realize from the archive that the sort argument in merge has been subject to discussion before, though I couldn't find an explanation for this behavior. I tried to simplify this to (kind of) minimal code from a real

Re: [R] Scatter plot from tapply output, labels of data

2012-09-04 Thread Jean V Adams
Try this: # I created some example data mydf - data.frame( Species=sample(paste0(Species, 1:3), 50, TRUE), d13C=15+rnorm(50), d15N=15+rnorm(50), Year=sample(2009:2012, 50, TRUE)) attach(mydf) Nmean - tapply(d15N, list(Year,Species), mean) Cmean - tapply(d13C,

[R] Tendonitis and R users

2012-09-04 Thread research email
Hello This request asks something beyond the technicalities of the R language, I would like to ask you wonderful people if you have ever suffered as programmers ( or de facto programmers like myself though I am a 'research assistant') from tendonitis and how you coped with it, i have golfer's

Re: [R] Create a function to number each repeated visit or measurements

2012-09-04 Thread Jon Toledo
Thanks Petr then using unlist(x1[,2]) I am able to create the vector I need to add to the dataframe. Didn´t think of this approach. Best, JT Date: Tue, 4 Sep 2012 04:47:11 -0700 From: smartpink...@yahoo.com Subject: Re: [R] Create a function to number each repeated visit or measurements

Re: [R] Adding summary title to table

2012-09-04 Thread David L Carlson
names(dimnames(x)) - list(, Nutritional Status) x Nutritional Status Cold or flu Headache Backache Went to doctor 229 23 No response 344 Did\nnothing 67 22 Self-medicated

[R] predict rpart newdata - introduce only values variables used in the tree

2012-09-04 Thread agent dunham
Dear community, I've a tree which included at first 23 variables. Then I've pruned this tree, and there are only 8 variables involved. I'd like to predict and only introduce in newdata the values of these 8 variables involved. However, as the tree was built with the 23, it asked me for 15

Re: [R] Adding summary title to table

2012-09-04 Thread Rui Barradas
Hello, Ty the following. names(dimnames(x)) - c(Academic Performance, Nutritional Status) x Awkward names, by the way. Hope this helps, Rui Barradas Em 03-09-2012 23:25, David Arnold escreveu: All, I have: x - matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x) -

Re: [R] R suitability for development project

2012-09-04 Thread Eric Langley
Jim, Thank you again for your response. The integer conversion looks good. You wrote: I think you may be doing something here that you don't intend. The point of plots like this is to transform numeric values into lengths or areas. If you don't maintain the same metric throughout the plot,

Re: [R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread arun
Hi, Try this: convert.type1 - function(obj,types){     for (i in 1:length(obj)){     FUN - switch(types[i],character = as.character,    numeric = as.numeric,    factor = as.factor)     obj[,i] - FUN(obj[,i])     }     obj }

[R] prune rpart - select option with less splits when 2 cp's are the same

2012-09-04 Thread agent dunham
Dear community, I want to prune a rpart object and select the one that has 13 splits: object.rpart$cptable CP nsplit rel errorxerror xstd 1 0.09489173 0 1.000 1.0006465 0.05641905 2 0.05053897 1 0.9051083 0.9234187 0.05427033 . . . 10 0.01279452 12

Re: [R] binary data

2012-09-04 Thread David L Carlson
This is a pretty vague question. Ecologists work quite a bit with distance matrices and binary data. You will find some options in packages vegan and ecodist for example. I'm sure there are many others -- David L Carlson Associate Professor of

Re: [R] Create a function to number each repeated visit or measurements

2012-09-04 Thread arun
Hi, May be you can also use ?aggregate(): x1-aggregate(x,list(x),function(x) seq_along(x)-1) # Group.1    x #1   a  0, 1, 2, 3, 4, 5, 6 #2   b 0, 1,

Re: [R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread Meyners, Michael
Rui, Thanks for looking into this. I apologize, I should've added my output, maybe it looks differently on my machine than on others. I also should have made my question more explicit: I'm not looking for a solution to get the sorting one way or another, I have that already. I rather want to

Re: [R] Tendonitis and R users

2012-09-04 Thread John Kane
I've vome close a couple of times. Solutions: don't use computer-not alway practical. Carefully watch posture and arm/hand actions to reduce strain. If do a lot of keyboarding not just R type look into using a Dvoark keyboard. Something I have not done but which is likely to help is consult

Re: [R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread Rui Barradas
Hello, You're right I had missed the point, sorry. I can't see a reason why that behavior, but it seems to have to do with all = T, remove it and the problem is gone. But that's probably not what you want. NA's issue? Rui Barradas Em 04-09-2012 15:17, Meyners, Michael escreveu: Rui,

[R] Help about rugarch

2012-09-04 Thread tete nzouankeu
Hi everyone, I use the rugarch package in order tu run a rolling windows estimation using the function ugarchroll. I want to set the windows moving. For example, I want to do n.ahead=1, refit.every=1, refit.windows=moving, .. But I don't know how to set the length of the rolling windows (say

Re: [R] Coxph not converging with continuous variable

2012-09-04 Thread Ravi Varadhan
Dear Terry, I agree that this example is highly atypical. Having said that, my experience with optimization algorithms is that scaling (a.k.a. standardizing) the continuous covariates is greatly helpful in terms of convergence. Have you considered automatically standardizing the continuous

[R] tapply to data.frame or matrix

2012-09-04 Thread Jannis
Dear R users, imagine i have a dataframe and an indexing vector with the length of the amount of columns of the dataframe. Is there any convenient way to combine the colums of the dataframe into vectors (or straight away apply fundtions to these subsets) according to the indexing vector in a

Re: [R] unexpected (?) behavior of sort=TRUE in merge function

2012-09-04 Thread Meyners, Michael
Rui, yes, without all=T it works fine, but of course there is no point in the whole exercise if I'd drop that, as print(test) would do the same, unless I have other values of product or cong in any dataset, which I haven't. :-) The purpose of the merge is to have all combinations of the

Re: [R] tapply to data.frame or matrix

2012-09-04 Thread Rui Barradas
Hello, Here's a way. test - as.data.frame(matrix(1:20, ncol = 5, nrow=4)) test.ind - c(1,1,2,2,2) lapply(split(colnames(test), test.ind), function(x) unlist(test[, x])) Hope this helps, Rui Barradas Em 04-09-2012 15:40, Jannis escreveu: Dear R users, imagine i have a dataframe and an

Re: [R] Create a function to number each repeated visit or measurements

2012-09-04 Thread William Dunlap
For unsorted x, or for a factor x with unused levels, ave(integer(length(x)), x, FUN=seq_along) - 1 works. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of PIKAL Petr

Re: [R] Tendonitis and R users

2012-09-04 Thread Clint Bowman
I think I've avoided tendonitis by carefully stretching the affected area when I begin to feel discomfort and, as John suggests, Carefully watch posture and arm/hand actions to reduce strain. Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler

Re: [R] Tendonitis and R users

2012-09-04 Thread Keith Jewell
When I suffered from wrist pain I found changing from a standard mouse to a cordless trackball gave rapid and complete relief. Your mileage may vary. Keith J I think I've avoided tendonitis by carefully stretching the affected area when I begin to feel discomfort and, as John suggests,

Re: [R] Tendonitis and R users

2012-09-04 Thread Alexandre Aguiar
Keith Jewell k.jew...@campden.co.uk escreveu: When I suffered from wrist pain I found changing from a standard mouse to a cordless trackball gave rapid and complete relief. A mousepad with a jelly support for the wrist cured my pain. One can find several tenths of websites with plenty of useful

Re: [R] Tendonitis and R users

2012-09-04 Thread Bert Gunter
I may be out of line here, but I fail to see what on earth this has to do with R and why this thread should be continued here. I appreciate the fact that there is no maliciousness involved, but the danger of such off topic discussions (imho, of course) is that it dilutes the purpose and value of

Re: [R] Tendonitis and R users

2012-09-04 Thread arun
HI, I tried wrist exercises for carpal tunnel syndrome.  It's not 100% effective, but it helps. A.K. - Original Message - From: research email resea...@namibia.pharmaccess.org To: r-help@r-project.org r-help@r-project.org Cc: Sent: Tuesday, September 4, 2012 8:55 AM Subject: [R]

[R] ADMB error- function maximizer failed (couldnt find STD file)

2012-09-04 Thread Nathan Svoboda
Greetings glmmADMB function users, I am trying to run a series of models using the glmmADMB function with several different distribution families (e.g., poisson, negbinom). I am using a Optiplex 790 PC with Windows 7, 16.0 GB of RAM and a 64-bit operating system. I am running R version 2.15.0

Re: [R] tapply to data.frame or matrix

2012-09-04 Thread arun
Hi, Here's another way: testagg-aggregate(colnames(test),list(test.ind),function(x) test[,x]) list(unlist(testagg[,2][1]),unlist(testagg[,2][2])) #[[1]] #0.V11 0.V12 0.V13 0.V14 0.V21 0.V22 0.V23 0.V24     1 2 3 4 5 6 7 8 #[[2]] #1.V31 1.V32 1.V33 1.V34 1.V41 1.V42

[R] Calculate a minimum-variance portfolio with fPortfolio

2012-09-04 Thread varcovar
Hello everybody, I'm running into an issue with the fPortfolio package. 1. What I want: Calculate the minimum-variance portfolio on 20 assets with respect to the following constraints: - min weight per asset = 0% (i.e. no short-selling) - max weight per asset = 10% - min sum of asset

Re: [R] using apply with sparse matrix from package Matrix

2012-09-04 Thread Martin Maechler
Jennifer Lyon jennifer.s.l...@gmail.com on Fri, 31 Aug 2012 17:22:57 -0600 writes: Hi: I was trying to use apply on a sparse matrix from package Matrix, and I get the error: Error in asMethod(object) : Cholmod error 'problem too large' at file

[R] Ryacas

2012-09-04 Thread Jason Romine
I am having issues with Ryacas errors. I searched and found this error was reported in 2006, but nothing since. library(Ryacas) Loading required package: XML yacas(expression(Factor(x^2-1))) [1] Starting Yacas! CommandLine(1) : Expecting ) closing bracket for sub-expression, but got ^ instead

[R] Comparing Von Bertalanffy Growth Curves

2012-09-04 Thread April Lindeman
I am trying to compare Vbert growth curves from several years of fish data. I am following the code provided by: http://www.ncfaculty.net/dogle/fishR/gnrlex/VonBertalanffy/VonBertalanffy.pdf. Specifically the section on VBGM Comparisons between groups.   This code is pretty cut and dry. I am

Re: [R] Ryacas

2012-09-04 Thread Gabor Grothendieck
On Tue, Sep 4, 2012 at 2:34 PM, Jason Romine jrom...@usgs.gov wrote: I am having issues with Ryacas errors. I searched and found this error was reported in 2006, but nothing since. It works for me on my Windows Vista laptop. Suggest you review the toubleshooting section on the home page

Re: [R] [newbie] scripting remote check for R package

2012-09-04 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html [how] to script [remote] checking for an R package? https://stat.ethz.ch/pipermail/r-help/2012-September/323000.html I would call something like this via ssh [...] Rscript -e

[R] how to get Rscript, and is there any reason not to?

2012-09-04 Thread Tom Roche
As described in the thread beginning @ https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html I work (as a user, without root) on a cluster that has several servers on which R is installed but not Rscript. I'd like to know 1 What should I tell my admin to do in order to make both

[R] what package does the mesh function need

2012-09-04 Thread paka
Hello, I tried to plot some 3d-plots with the 'mesh' function, but I allways get the message 'Fehler: konnte Funktion mash nicht finden' in english this means 'error: can't find the function mesh'. Do I need another package? I didn't found anything in the web this afternoon, only descriptions how

Re: [R] Adding summary title to table

2012-09-04 Thread Patrick Connolly
On Tue, 04-Sep-2012 at 08:18AM -0500, David L Carlson wrote: | names(dimnames(x)) - list(, Nutritional Status) | x | Nutritional Status | Cold or flu Headache Backache | Went to doctor 229 23 | No response 34

Re: [R] AFTREG weights

2012-09-04 Thread Göran Broström
On Wed, Aug 1, 2012 at 3:08 PM, fra.meu...@hotmail.it wrote: Dear Göran Broström, I am trying to use AFTREG function for R to estimate a loglogistic survival function, including time dependent covariates. Actually, my Subset includes some partial events; the idea is to model this kind of

Re: [R] Create a function to number each repeated visit or measurements

2012-09-04 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jon Toledo Sent: Monday, September 03, 2012 10:59 PM To: r-help@r-project.org Subject: [R] Create a function to number each repeated visit or measurements Hi dear R list

Re: [R] Tendonitis and R users

2012-09-04 Thread Rich Shepard
On Tue, 4 Sep 2012, Clint Bowman wrote: I think I've avoided tendinitis ... In the early 1990s I got tendinitis when I had to switch from strictly text-based screens to GUIs and the mouse. A few accupunture sessions cured it, and I've avoided it ever since by using a track ball rather than

[R] How can I export a big data.frame to excel 2010 - file.xlsx?

2012-09-04 Thread PamelaBotrel
Hi, I need some help to export a data frame with 83 rows and 1411 colums. I have used the package RODBC until now. But now, I have 1411 colums that I can't send to the old excel. If anybody knows a package to convert my data frame in xlsx tell me! Thanks for help in advance! Pamela Botrel

Re: [R] How can I export a big data.frame to excel 2010 - file.xlsx?

2012-09-04 Thread Hasan Diwan
Ms. Botrel, On 4 September 2012 13:52, PamelaBotrel pamela.bot...@hotmail.com wrote: I need some help to export a data frame with 83 rows and 1411 colums. I have used the package RODBC until now. But now, I have 1411 colums that I can't send to the old excel. If anybody knows a package to

Re: [R] what package does the mesh function need

2012-09-04 Thread Peter Ehlers
On 2012-09-04 12:10, paka wrote: Hello, I tried to plot some 3d-plots with the 'mesh' function, but I allways get the message 'Fehler: konnte Funktion mash nicht finden' in english this means 'error: can't find the function mesh'. Do I need another package? I didn't found anything in the web

Re: [R] How can I export a big data.frame to excel 2010 - file.xlsx?

2012-09-04 Thread Rui Barradas
Hello, Try package XLConnect. The vignette has several examples, and so do the help pages, for instance, ?XLConnect You should also get rid of excel and use R for serious work. And even not so serious. Hope this helps, Rui Barradas Em 04-09-2012 21:52, PamelaBotrel escreveu: Hi, I need

Re: [R] Ryacas

2012-09-04 Thread Jason Romine
Thank you Gabor. I tried to exhaust all troubleshooting solutions listed on the site you suggested prior to posting my question. Perhaps you could share what this error is stemming from. Interestingly, on another machine I have no issue with it when I run R 2.10, whereas when I try Ryacas with

Re: [R] ADMB error- function maximizer failed (couldnt find STD file)

2012-09-04 Thread Ben Bolker
gNathan Svoboda nsvoboda at CFR.MsState.Edu writes: Greetings glmmADMB function users, I am trying to run a series of models using the glmmADMB function with several different distribution families (e.g., poisson, negbinom). I am using a Optiplex 790 PC with Windows 7, 16.0 GB of RAM and a

Re: [R] Comparing Von Bertalanffy Growth Curves

2012-09-04 Thread Ben Bolker
April Lindeman aprillindeman at yahoo.com writes: I am trying to compare Vbert growth curves from several years of fish data. I am following the code provided by: http://www.ncfaculty.net/dogle/fishR/gnrlex/VonBertalanffy/VonBertalanffy.pdf. Specifically the section on VBGM Comparisons

Re: [R] Comparing Von Bertalanffy Growth Curves

2012-09-04 Thread David L Carlson
Pretty hard to say since you did not give us all of your code: str(LMB) 'data.frame': 37 obs. of 3 variables: $ Age : int 1 2 3 5 1 2 3 4 1 2 ... $ MM : num 156 296 326 375 181 ... $ Year: int 2005 2005 2005 2005 2006 2006 2006 2006 2007 2007 ... MMi=as.integer(MM) Error: object 'MM'

Re: [R] Ryacas

2012-09-04 Thread Gabor Grothendieck
On Tue, Sep 4, 2012 at 5:19 PM, Jason Romine jrom...@usgs.gov wrote: Thank you Gabor. I tried to exhaust all troubleshooting solutions listed on the site you suggested prior to posting my question. Perhaps you could share what this error is stemming from. Interestingly, on another machine I

[R] cenboxplot(): Reporting Limit Twice Correct Concentration

2012-09-04 Thread Rich Shepard
I've gone over the data and do not see my error; the dput() output of the data frame and the pdf output of cenboxplot() are attached. The command used: cenboxplot(sb.t$quant, sb.t$ceneq1, range=1.5, main='Total Recoverable Antimony', xlab='Pre-Mining Era', ylab='Concentration (log mg/L)')

[R] repace values in raster based on values in another raster

2012-09-04 Thread sean_parks
Hi, I am attempting to create a new raster based on values of another raster. In the Arc world, this is called a conditional statement or con statement. I am having quite a bit of difficulty figuring this out in R. Here is some pseudo-code: if (fire.did.not.occurr == 1) then (new. raster =

Re: [R] using apply with sparse matrix from package Matrix

2012-09-04 Thread Jennifer Lyon
On Tue, Sep 4, 2012 at 10:58 AM, Martin Maechler maech...@stat.math.ethz.ch wrote: Jennifer Lyon jennifer.s.l...@gmail.com on Fri, 31 Aug 2012 17:22:57 -0600 writes: Hi: I was trying to use apply on a sparse matrix from package Matrix, and I get the error: Error in

Re: [R] cenboxplot(): Reporting Limit Twice Correct Concentration

2012-09-04 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rich Shepard Sent: Tuesday, September 04, 2012 4:15 PM To: r-help@r-project.org Subject: [R] cenboxplot(): Reporting Limit Twice Correct Concentration I've gone over the

[R] POSIXlt and daylight savings time

2012-09-04 Thread pdb
I have a data frame that contains dates, but when I use as.POSIXlt() I lose the hours on all records. I traced this down to a particuar hour which causes the issue... as.POSIXlt('2004-10-31 02:00:00') [1] 2004-10-31 as.POSIXlt('2004-10-31 03:00:00') [1] 2004-10-31 03:00:00 How do I tell

[R] Sweave encoding option

2012-09-04 Thread Shi, Tao
Hi list, I was running Sweave on one of my .rnw file.  Everything was fine, until I came back from the vacation.  Nothing changed (at least to my knowledge), but now I have this problem: Sweave(myfile.rnw) Error: ‘COLO001final.rnw’ is not ASCII and does not declare an encoding After

[R] Revolution Analytics

2012-09-04 Thread wwreith
Has anyone every used Revolution Analytics? It claims to be faster than R, but when I ran a for loop of linear regression that requires a couple of minutes to process in RStudio. Revolution Analytics has a run time that was exactly the same. I was just wondering if anyone has experience with the

[R] Read data from .csv file as a matrix and compare the different between two matrix

2012-09-04 Thread s.s.m. fauzi
Hi, I have two table matrix, and I would like to compare the different between two matrix. For example: Matrix 1: A B C A 0 1 0 B 0 0 1 C 0 0 0 Matrix 2: A B C A 0 1 0 B 0 0 0 C 0 0 0 Each column which have value 1, should also return value 1. As in this case/example, the

Re: [R] Sweave encoding option

2012-09-04 Thread Yihui Xie
What happened might be that your vacation took too long. The encoding argument was introduced in R 2.13.1 (July last year). Nothing has changed in your Rnw document, but things have always been changing in R, so the best thing to do is to check out help(Sweave). Regards, Yihui -- Yihui Xie

Re: [R] Producing a SMA signal when closing price is above the moving average for 3 days

2012-09-04 Thread William Dunlap
You could think of your problem as one of combining a signal that tells when the state of the system should change to (or remain at) on and a signal that tells when it should change to off to come up with a series giving the state at each time point. E.g., OnOrOff - function(toOn, toOff, wasOn){

Re: [R] POSIXlt and daylight savings time

2012-09-04 Thread Jeff Newmiller
a) Don't use POSIXlt in data frames... use POSIXct. POSIXlt is like a data frame of its own, and data frames within data frames lead to surprising results, to say the least. b) I have had best luck using Sys.setenv( TZ=Etc/GMT+8 ) for US Pacific Standard Time as local time for the duration of

Re: [R] Read data from .csv file as a matrix and compare the different between two matrix

2012-09-04 Thread arun
Hi, Not quite understand your question.  Suppose the columns of one matrix (matrix1) have multiple 1's while matrix 2 have only 0's, do you mean that the difference should be 0 for that column? Anyway, the result that you wanted for this example can be got from: mat1-read.table(text=  A  B C  

Re: [R] Revolution Analytics

2012-09-04 Thread Jeff Newmiller
RA is R, with some special modifications. You may not be exercising those enhancements with your code. This is not a support forum for RA, so you should ask your question in an RA-specific forum. You should also provide example code when you do, so it will be clear what features you are using.