[R] Plot cumulative sums of rainfall per year

2013-03-26 Thread Martin Labadz
Hi @all, I am biting my nails with the following problem: I have a data set of daily rainfall measurements for the last 20 years. What I want to do is calculate the daily cumulative sum of rainfall but only for every year which means that the cumulative sum has to be reset each year. After the

Re: [R] Newbie code to count runs of up or down moves

2013-03-26 Thread Newbie1234
I hope this text does not come out unreadable as before. It is readable in R Studio.. What I am trying to do is take a time-series of prices and create a histogram of the run lengths, where a run is a sequence of all up moves or all down moves. Arun of length k is sequence of k moves all in

Re: [R] Can you help with local source file instalation?

2013-03-26 Thread Prof Brian Ripley
On 26/03/2013 02:11, mjchi168 wrote: Hi R, I tried to install one local source package---qtl into R, but failed with the following message. I am using Macbook OS 10.8.3 with Xcode 4.6.1. This is the wrong list: it should have been R-sig-mac. Please follow up there. It seems you forgot

[R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
I'm interested in using a regular bracket with the degree symbol as an axis label but it's somewhat simpler to show what I mean in a text statement. plot(0, 0, pch = ) If I'm easy to please, this would suffice: text(0, .5, expression(Temperature * degree ~ C)) But I'm not that easily pleased.

Re: [R] Newbie code to count runs of up or down moves

2013-03-26 Thread PIKAL Petr
Hi slightly better, the error messages are starting from if ((x[j] * x[j-1] 0){ one parentheses more here However R is not C and using built in functions is preferable to programming your own. Just as a guess isn't combination of sign and rle

Re: [R] Newbie code to count runs of up or down moves

2013-03-26 Thread Jeff Newmiller
Debugging nested loops is something we try to avoid in R, because there are usually more efficient ways to accomplish things. Does this do what you want? hist(rle(diff(z)0)$lengths) --- Jeff Newmiller

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
Hi, Is it what you are looking for? plot(0, 0, pch = ) text(0, .5, expression(Temperature~(degree ~ C))) text(0, .4, substitute(paste(Temperature, B * degree, C)), list(B = ())) Hope this help, Pascal On 26/03/13 16:12, Patrick Connolly wrote: I'm interested in using a regular bracket

Re: [R] RWeka and Back Propagation NN

2013-03-26 Thread Patrick Connolly
On Sat, 23-Mar-2013 at 10:10PM +0100, Rui Esteves wrote: | Hello, | | I have a trained Back Propagation Neural Network model in weka. I | would like to re-evaluate the NN using R with a given input. How | can I do this? I could not find an example of RWeca that applies to | NN As the

Re: [R] Plot cumulative sums of rainfall per year

2013-03-26 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Martin Labadz Sent: Tuesday, March 26, 2013 6:44 AM To: r-help@r-project.org Subject: [R] Plot cumulative sums of rainfall per year Hi @all, I am biting my nails with

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
On Tue, 26-Mar-2013 at 04:20PM +0900, Pascal Oettli wrote: | Hi, | | Is it what you are looking for? | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree ~ C))) That produces an unwanted space between the degree symbol and the C. The search continues. Thanks | text(0, .4,

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
Hi, You are right. The following should solve that problem: plot(0, 0, pch = ) text(0, .5, expression(Temperature~(degree*C))) HTH, Pascal On 26/03/13 16:55, Patrick Connolly wrote: On Tue, 26-Mar-2013 at 04:20PM +0900, Pascal Oettli wrote: | Hi, | | Is it what you are looking for? | |

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
On Tue, 26-Mar-2013 at 05:05PM +0900, Pascal Oettli wrote: | Hi, | | You are right. The following should solve that problem: | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree*C))) That does it, and is perfectly readable. Now why didn't I think of that? I knew there had to

[R] Counting various elemnts in a vactor

2013-03-26 Thread Katherine Gobin
Dear R forum I have a vector say as given below df = c(F, C, F, B, D, A, D, D, A, F, D, F, B,    C) I need to find (1) how many times each element occurs? e.g. in above vector F occurs 4 times, C occurs 2 times etc. (2) Depending on the number of occurrences, I need to repeat the element

Re: [R] Counting various elemnts in a vactor

2013-03-26 Thread D. Rizopoulos
try this: df - c(F, C, F, B, D, A, D, D, A, F, D, F, B, C) tab - table(df) tab rep(names(tab), 100 * tab) I hope it helps. Best, Dimitris On 3/26/2013 9:12 AM, Katherine Gobin wrote: Dear R forum I have a vector say as given below df = c(F, C, F, B, D, A, D, D, A, F, D, F, B,

Re: [R] Plot Matrix with Data

2013-03-26 Thread Alaios
Hi, Thanks for the answer. It looks like that the mutate what I was missing so long.. That's my current attempt Data-matrix(data=rnorm(900,80,20),nrow=30,ncol=30) Lengths- 15 library(reshape2) library(ggplot2) require('plyr') tdm - melt(Data) tdm - mutate(tdm, col = cut(value, seq(15, 90, by=5),

[R] edit.data() read-only?

2013-03-26 Thread Ted Harding
Greetings All. The function edit.data() allows a convenient spreadsheet-like view of a dataframe with too many rows/columns to fit on the screen (especially when there are many columns). Very useful when scanning through a dataset (row column are conveniently identified by the labels at the side

Re: [R] edit.data() read-only?

2013-03-26 Thread Barry Rowlingson
On Tue, Mar 26, 2013 at 10:09 AM, Ted Harding ted.hard...@wlandres.net wrote: Greetings All. The function edit.data() allows a convenient spreadsheet-like view of a dataframe with too many rows/columns to fit on the screen (especially when there are many columns). Very useful when scanning

Re: [R] edit.data() read-only?

2013-03-26 Thread Ted Harding
Sorry, I meant data.entry(), not edit.data() (the latter due to mental cross-wiring with edit.data.frame()). I think that Nello Blaser's suggestion of View may be what I seek (when I can persuade it to find the font it seeks ... )! With thanks, Barry. Ted. On 26-Mar-2013 10:20:59 Barry

Re: [R] edit.data() read-only?

2013-03-26 Thread Blaser Nello
Try ?View() -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ted Harding Sent: Dienstag, 26. März 2013 11:09 To: r-help@r-project.org Subject: [R] edit.data() read-only? Greetings All. The function edit.data() allows a convenient

[R] How do I show real values on a log10 histogram

2013-03-26 Thread Shane Carey
Hi, I have a histogram with values logged to the base 10 hist(log10(x),breaks=60) How do I show the log values on the x-axis and a second x-axis showing the real values? Thanks -- Shane [[alternative HTML version deleted]] __

Re: [R] How do I show real values on a log10 histogram

2013-03-26 Thread John Kane
Something like this? It does an extra y-axis but the principle is the same for an x-axis # Create the data to be graphed x-1:10 y1-x y2-x^2 # Set the par values op - par(las=1,xaxs=r,mai=c(1,0.75,1,1)) # Draw first plot

Re: [R] How do I show real values on a log10 histogram

2013-03-26 Thread Duncan Murdoch
On 13-03-26 6:19 AM, Shane Carey wrote: Hi, I have a histogram with values logged to the base 10 hist(log10(x),breaks=60) How do I show the log values on the x-axis and a second x-axis showing the real values? I think it's hard to compute nice locations automatically, but if you compute

Re: [R] How do I show real values on a log10 histogram

2013-03-26 Thread PIKAL Petr
Hi maybe axis(3, (x)^10) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Shane Carey Sent: Tuesday, March 26, 2013 11:19 AM To: r-help@r-project.org Subject: [R] How do I show real values on a log10 histogram

Re: [R] edit.data() read-only?

2013-03-26 Thread Ted Harding
Thanks! ?View does indeed state The object is then viewed in a spreadsheet-like data viewer, a read-only version of 'data.entry', which is what I was looking for! Ted. On 26-Mar-2013 10:23:59 Blaser Nello wrote: Try ?View() -Original Message- From: r-help-boun...@r-project.org

Re: [R] How do I show real values on a log10 histogram

2013-03-26 Thread Shane Carey
Yup, Ive tried all these things and I think Johns might be the best approach, thanks On Tue, Mar 26, 2013 at 11:01 AM, PIKAL Petr petr.pi...@precheza.cz wrote: Hi maybe axis(3, (x)^10) Regards Petr -Original Message- From: r-help-boun...@r-project.org

Re: [R] Use pcls in mgcv package to achieve constrained cubic spline

2013-03-26 Thread Simon Wood
Actually, you might as well use gam directly for this (has the advantage that the smoothing parameter will be chosen correctly subject to the constraint). Here is some code. Key idea is to set the basis and penalty for the spline up first, apply the constraint, and then use gam to fit it...

Re: [R] Time trends with GAM

2013-03-26 Thread Simon Wood
For 1) see reply just sent to R help... Re: [R] Use pcls in mgcv package to achieve constrained cubic spline (I'm assuming you mean to fix the value of the smooth at a particular knot location - i.e. to impose a constraint like f(t_0) = b). For 2) try 'model.matrix', or 'predict.gam' with

Re: [R] How to copy current line in Tinn-R

2013-03-26 Thread John Kane
I hve not used Tinn-R in a while (I'm currently running Ubuntu) but I think that you can just click in the left margin to select the line. John Kane Kingston ON Canada -Original Message- From: f...@dmu.dk Sent: Mon, 25 Mar 2013 11:33:28 +0100 To: r-help@r-project.org Subject: [R]

Re: [R] How do I show real values on a log10 histogram

2013-03-26 Thread John Kane
Hi Shane.  I don't know.  I am not clear on what you are asking.  I would think that it would but can you supply some stripped-down code for people to have a look at?  See https://github.com/hadley/devtools/wiki/Reproducibility  and/or  

Re: [R] Counting various elemnts in a vactor

2013-03-26 Thread Katherine Gobin
Dear Sir, Thanks a lot for your great help. I couldn't have figured it out. Thanks again. Regards Katherine --- On Tue, 26/3/13, D. Rizopoulos d.rizopou...@erasmusmc.nl wrote: From: D. Rizopoulos d.rizopou...@erasmusmc.nl Subject: Re: [R] Counting various elemnts in a vactor To: Katherine

Re: [R] Problem with nested for-loop

2013-03-26 Thread Adams, Jean
It would be helpful to see what your data frames look like ... perhaps you could share the first few rows of each with us. dput(head(j1data)) dput(head(predictdata)) Jean On Mon, Mar 25, 2013 at 9:29 PM, Curtis Burkhalter curtisburkhal...@gmail.com wrote: Hello, I'm working on a problem

[R] update.packages(checkBuilt = TRUE) fails in updating rpanel_1.1-1 due to missing package BWidget

2013-03-26 Thread Juergen Rose
update.packages(checkBuilt = TRUE) fails with: update.packages(checkBuilt = TRUE) rpanel : Version 1.0-6 installed in /usr/lib64/R/library built under R 2.15.0 Version 1.1-1 available at http://mirrors.softliste.de/cran Update (y/N/c)? y trying URL

Re: [R] R-help Digest, Vol 121, Issue 5

2013-03-26 Thread Kerry
Thank you Jason!  actually, there have been two solutions and one is yours setting row.names=F works great, additionally what Ive been having problems with is the European version of Word 2010.  Apparently it sets delimiters of ; instead of , as in the English/USA version.  This is something

Re: [R] Weighted Kaplan-Meier estimates with R

2013-03-26 Thread Terry Therneau
There are two ways to view weights. One is to treat them as case weights, i.e., a weight of 3 means that there were actually three identical observations in the primary data, which were collapsed to a single observation in the data frame to save space. This is the assumption of survfit.

Re: [R] Counting various elemnts in a vactor

2013-03-26 Thread arun
Hi, library(plyr)  df1-count(df) rep(df1[,1],df1[,2]*100) count(as.character(rep(df1[,1],df1[,2]*100))) #  x freq #1 A  200 #2 B  200 #3 C  200 #4 D  400 #5 F  400 A.K. - Original Message - From: Katherine Gobin katherine_go...@yahoo.com To: r-help@r-project.org Cc: Sent: Tuesday,

Re: [R] update.packages(checkBuilt = TRUE) fails in updating rpanel_1.1-1 due to missing package BWidget

2013-03-26 Thread Kevin E. Thorpe
I encountered the same problem. I emailed the maintainer last week but have not yet received a response. I don't see a BWidget package on CRAN either. On 03/26/2013 04:31 AM, Juergen Rose wrote: update.packages(checkBuilt = TRUE) fails with: update.packages(checkBuilt = TRUE) rpanel :

Re: [R] Faster way of summing values up based on expand.grid

2013-03-26 Thread arun
HI, You could also try this: set.seed(25) values1-rnorm(10) values2-rnorm(10) values3-rnorm(10) mycombos-expand.grid(1:10,1:10,1:10,1:10) mycombos1- mycombos mycombos-mycombos[!(mycombos$Var1 == mycombos$Var2),] mycombos-mycombos[!(mycombos$Var1 == mycombos$Var3),]

[R] graph layout

2013-03-26 Thread Shane Carey
Hi, Is it possible to use par() within par()? Something like: par(mfcol=c(2,2),mar=c(4.5,4.5,2,2)) op - par(las=1,xaxs=r,mai=c(1,0.75,1,1)) plot(hist(x),main=,xlim=c(0,100),xaxt=n,yaxt=n,xlab=,ylab=,border=white) axis(1,at=c(0,20,40,60,80,100),line=-1,cex.axis=0.7,padj=-1.5) par(new=TRUE)

Re: [R] Faster way of summing values up based on expand.grid

2013-03-26 Thread arun
Hi, Forgot to add a line: sumNew1-rowSums(sapply(mycombos2,function(x) values1[x])) names(sumNew1)- row.names(mycombos2) ##  identical(sumNew1,sum1) #[1] TRUE Just checked with vectors of length 25 set.seed(25) values1-rnorm(25) values2-rnorm(25) values3-rnorm(25)

Re: [R] update.packages(checkBuilt = TRUE) fails in updating rpanel_1.1-1 due to missing package BWidget

2013-03-26 Thread Prof Brian Ripley
On 26/03/2013 13:02, Kevin E. Thorpe wrote: I encountered the same problem. I emailed the maintainer last week but have not yet received a response. I don't see a BWidget package on CRAN either. It is not an R package: it is a Tcl/Tk extension. The rpanel maintainer has been asked to add

[R] Error-correcting output code with multiclass problems

2013-03-26 Thread daniel castro
Hello, I just wanted to know if there's any package that implements error-correcting output code algorithms for multiclass ensemble problems. thank you in advance. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Odd graphic device behavior

2013-03-26 Thread Thomas Adams
I'm experiencing odd graphics device behavior running R 2.15.3 on Ubuntu. Regardless of what I try like: require(stats) plot(cars) lines(lowess(cars)) plot(sin, -pi, 2*pi) for example, the graphics device fills the entire screen with the graphic and a very large font. When I shrink the graphics

[R] Controlling print messages/warnings and error output in R package

2013-03-26 Thread Saptarshi Guha
Hello, If i were to embed R (in C), i could over ride ptr_R_ShowMessage = Re_ShowMessage; ptr_R_WriteConsoleEx =Re_WriteConsoleEx; where Re_ShowMessage,Re_WriteConsoleEx are my own functions. How would i do this in a package? I would like the flexibility of having my function be called

[R] Increase font size in plots

2013-03-26 Thread Alaios
Hi I am using violin plots (type of boxplots) and  I am trying to increase the font size in the plots. It looks like that the violin plots do not work as normal plots as the cex parameters are ignored. You can have a loot at the code below require('vioplot') data1-rnorm(100)

[R] NaNS Error Message

2013-03-26 Thread Sahana Srinivasan
Hi, I'm using R to do a series of calculation and I have gotten several warnings that say NaNS produced. Whatever I could read on line gives me an idea that this warning is produced when the number is use is a negative log or otherwise mathematically problematic. I'm getting this error while using

Re: [R] Problem with nested for-loop

2013-03-26 Thread Adams, Jean
Thanks. That helps. Using the example data you sent, I came up with this loop. See if it does the trick for you. niter - 2 nspp - 11 ntrees - 22 lnbm - matrix(NA, niter, ntrees) for(i in 1:niter) { for(j in 1:ntrees) { k - j1data$its==i j1data$spp==predictdata$spp[j] lnbm[i, j] -

Re: [R] NaNS Error Message

2013-03-26 Thread Blaser Nello
Only positive values of n are allowed into the loop... More importantly, is n ever larger than 52??? Because that results in nk20 (for k=1) and undefined gamma(nk2). Same goes for sn, if n100. Next time you may also want to write a reproducible example! -Original Message- From:

Re: [R] NaNS Error Message

2013-03-26 Thread Berend Hasselman
On 26-03-2013, at 16:25, Sahana Srinivasan sahanasrinivasan...@gmail.com wrote: Hi, I'm using R to do a series of calculation and I have gotten several warnings that say NaNS produced. Whatever I could read on line gives me an idea that this warning is produced when the number is use is a

Re: [R] Increase font size in plots

2013-03-26 Thread Blaser Nello
You can use the par function instead. require('vioplot') data1-rnorm(100) data2-rnorm(10) data3-rnorm(1000) par(cex.lab=2, cex.axis=2) vioplot(data1,data2,data3) Best, Nello -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios

Re: [R] NaNS Error Message

2013-03-26 Thread Sahana Srinivasan
Hi, sorry I can't provide the reproducible code - the formula is currently being worked on for a research paper so I can't really give out details in that regard. That being said, k is initialized to 1 at the beginning of the loop. n has various values (whole numbers, 0 or greater, no upper

Re: [R] error installing RcppClassic

2013-03-26 Thread C Lin
Thank you very much for taking the time to read my jumbled email. I was usually pretty good with following directions but not lately very sorry! I don't know why I never thought of exiting R and restarting. Thanks it's now working. Lin Subject: Re:

[R] randomLCA_with error for me

2013-03-26 Thread Bismark Kofi
Please can someone explain to me how to use randomLCA in R for an analysis. I tried using it and had this error (copied below) which indicated my patterns must consist of 0 or 1. I assume I am doing something wrong. Please help. library(lattice) library(boot) Attaching package: ‘boot’ The

Re: [R] R-help Digest, Vol 121, Issue 5

2013-03-26 Thread Robert Baer
On 3/26/2013 7:21 AM, Kerry wrote: Thank you Jason! actually, there have been two solutions and one is yours setting row.names=F works great, additionally what Ive been having problems with is the European version of Word 2010. Apparently it sets delimiters of ; instead of , as in the

Re: [R] Distance calculation

2013-03-26 Thread arun
HI, I am not sure about the error.  I modified the script and added 12 (hopefully all the locations) and didn't had any problems. dat1- read.csv(rate.csv,sep=,) res- do.call(cbind,lapply(seq_len(nrow(dat1)),function(i)

Re: [R] Plot cumulative sums of rainfall per year

2013-03-26 Thread Law, Jason
Try this: library(plyr) library(ggplot2) library(lubridate) data-read.csv(http://dl.dropbox.com/u/4236038/test_cumu.csv;) data$Date - as.Date(data$Date) cumu - ddply(data,.(year(Date)),transform, cumRain = cumsum(Rainfall)) ggplot(cumu, aes(x = yday(Date), y = cumRain, color =

[R] setup multcompBoxplot

2013-03-26 Thread Marcelo Laia
I did a multcompBoxplot like this: xzx -multcompBoxplot(DESC_COMP ~ CLONETRAT,data = data.cerato, + sortFn = median, decreasing=TRUE, + horizontal=FALSE, compFn = TukeyHSD, + plotList=list( +

Re: [R] Plot Matrix with Data

2013-03-26 Thread Alaios
Hi, it was very kind of you to help me again. Your code works, and the reason I was using the limits as that is that my dataset is slightly different than the one I used for showing the problem here. More specifically this is my dataset Browse[1] str(keep)  num [1:153899, 1:3415] -98.6 -95.8

[R] Execution halted when I use knitr and Rscript with opts_chunk

2013-03-26 Thread Marcus Nunes
Hello all, I wrote a bash script in Mac OS that takes my .rnw file, knit it and then makes a .pdf. To knit my file, I'm using the command Rscript -e library(knitr); knit('file.rnw', encoding='utf8') and everything works fine. However, I don't want the ## characters in my final document. I

Re: [R] graph layout

2013-03-26 Thread Uwe Ligges
On 26.03.2013 14:49, Shane Carey wrote: Hi, Is it possible to use par() within par()? Something like: par(mfcol=c(2,2),mar=c(4.5,4.5,2,2)) op - par(las=1,xaxs=r,mai=c(1,0.75,1,1)) plot(hist(x),main=,xlim=c(0,100),xaxt=n,yaxt=n,xlab=,ylab=,border=white)

[R] Shifting cells and removing blanks

2013-03-26 Thread ankur verma
Hi , I've been struggling with this problem. Initially I thought something like a na.locf would help but I'm at a dead end. I have a data set like this: ID Prod1 Prod2 Prod3 Prod4 Prod5 01A - B- C 02 - F - G

Re: [R] randomLCA_with error for me

2013-03-26 Thread Uwe Ligges
On 26.03.2013 15:10, Bismark Kofi wrote: Please can someone explain to me how to use randomLCA in R for an analysis. I tried using it and had this error (copied below) which indicated my patterns must consist of 0 or 1. I assume I am doing something wrong. Yes, not using 0 and 1? See the

Re: [R] Problem with nested for-loop

2013-03-26 Thread Curtis Burkhalter
Hey Jean, This appears to have worked!! Thank you so much, this is an immense help to me. Best On Tue, Mar 26, 2013 at 11:33 AM, Adams, Jean jvad...@usgs.gov wrote: Thanks. That helps. Using the example data you sent, I came up with this loop. See if it does the trick for you. niter - 2

Re: [R] Execution halted when I use knitr and Rscript with opts_chunk

2013-03-26 Thread Duncan Murdoch
On 26/03/2013 12:26 PM, Marcus Nunes wrote: Hello all, I wrote a bash script in Mac OS that takes my .rnw file, knit it and then makes a .pdf. To knit my file, I'm using the command Rscript -e library(knitr); knit('file.rnw', encoding='utf8') and everything works fine. However, I don't want

Re: [R] Shifting cells and removing blanks

2013-03-26 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of ankur verma Sent: Tuesday, March 26, 2013 10:22 AM To: r-help@r-project.org Subject: [R] Shifting cells and removing blanks Hi , I've been struggling with this problem.

Re: [R] Shifting cells and removing blanks

2013-03-26 Thread arun
If the OP wanted a list output and if the data is what it looks like, may be this helps. dat1-read.table(text=  ID  Prod1  Prod2  Prod3  Prod4  Prod5 01    A -   B    -   C 02  -   F   -   G    - 03  H - -

Re: [R] suggestions about import SAS Transport files to R.

2013-03-26 Thread Santosh
Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could be read by the available xpt file reading packages in R. However, I am unable to use the R packages for reading SAS transport files generated through SAS PROC CPORT. I have tried SASxport, Hmisc, and foreign. Any

Re: [R] Execution halted when I use knitr and Rscript with opts_chunk

2013-03-26 Thread Yihui Xie
Yes I believe that was the problem. Same question asked here: https://github.com/yihui/knitr/issues/162#issuecomment-9017997 BTW, for future reference, this question was cross-posted at http://stackoverflow.com/questions/15640353/execution-halted-when-i-use-knitr-and-rscript-with-opts-chunk

Re: [R] suggestions about import SAS Transport files to R.

2013-03-26 Thread Ista Zahn
Hi Santosh, On Tue, Mar 26, 2013 at 1:57 PM, Santosh santosh2...@gmail.com wrote: Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could be read by the available xpt file reading packages in R. However, I am unable to use the R packages for reading SAS transport

Re: [R] suggestions about import SAS Transport files to R.

2013-03-26 Thread Duncan Murdoch
On 26/03/2013 1:57 PM, Santosh wrote: Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could be read by the available xpt file reading packages in R. However, I am unable to use the R packages for reading SAS transport files generated through SAS PROC CPORT. I have

Re: [R] suggestions about import SAS Transport files to R.

2013-03-26 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Duncan Murdoch Sent: Tuesday, March 26, 2013 11:32 AM To: Santosh Cc: r-help@r-project.org Subject: Re: [R] suggestions about import SAS Transport files to R. On 26/03/2013

[R] barplot colors

2013-03-26 Thread Francois de Ryckel
Dear all, I have a 2 by 2 matrix and I would like to do a barplot with it. (so 2 bars with each having 2 stacks.). I would like to have one colors per stack, so 4 different colors total. The problem is that R is only given me 2 colors (the same two for the bottom stack and the same two for

Re: [R] barplot colors

2013-03-26 Thread Rui Barradas
Hello, According to the code in file src/R/graphics/barplot.R, barplot() will draw column by column, and threfore use as many colors as rows in the matrix. Those colors will be reused for all bars. So I'm not seeing an easy way of doing what you want using base graphics. Not without changing

Re: [R] barplot colors

2013-03-26 Thread David L Carlson
You will have to trick barplot into thinking you have four groups: wmod - cbind(c(w[,1], 0, 0), c(0, 0, w[,2])) barplot(wmod, main=2012, col=c(red, green, blue, pink)) -- David L Carlson Associate Professor of Anthropology Texas AM University College

Re: [R] barplot colors

2013-03-26 Thread Rui Barradas
Hello, I forgot to add that if you use argument beside = TRUE, you can have as many colors as there are bars, but this is not the kind of graph you want. (This behavior makes a lot of sense if you look at the underlying code for barplot.) Rui Barradas Em 26-03-2013 19:39, Rui Barradas

[R] write.zoo

2013-03-26 Thread netra timalsina
Hei,I am writing a zoo object and then loading it shows the following error message.any suggestion would be appreciated? #create zoo seriesreg.zoo - zooreg(1:100, seq(from=as.Date(1999-01-01 ),'along.with'=100, by= 1 day)) #write zoo series write.zoo(reg.zoo ,file= test.Rdata) #load zoo

Re: [R] Newbie code to count runs of up or down moves

2013-03-26 Thread Newbie1234
Petr, Thanks. Wow! So little code for something that would require at least two nested loops in C. Now I need to extract the output of rle() and feed it to hist() if I want to draw a histogram (which I do). Can you give me any comments on that? N -- View this message in context:

Re: [R] How to change background and text colors in script window?

2013-03-26 Thread Greg Snow
You do exactly the same thing, just in the box in the lower left corner (just above the Apply button) you need to scroll down and select editorbg for the background and editortext for the text color. On Fri, Mar 22, 2013 at 8:14 PM, Pfeiffer, Steven (pfeiffss) pfeif...@mail.uc.edu wrote:

Re: [R] About name of list elements

2013-03-26 Thread Rolf Turner
On 03/26/2013 12:52 PM, Peter Ehlers wrote: SNIP Sooner or later most R beginners are bitten by this all too convenient shortcut. [I.e. the use of $-extraction] As an R newbie, think of R as your bank account: overuse of $-extraction can lead to undesirable consequences. It's best to

[R] Need code for Liddle Exact test?

2013-03-26 Thread gokhanocakoglu
Dear friends, I am searching a code for Liddle Exact test which is equavelent to McNemar test... thanx for your attention for know -- View this message in context: http://r.789695.n4.nabble.com/Need-code-for-Liddle-Exact-test-tp4662549.html Sent from the R help mailing list archive at

Re: [R] Need code for Liddle Exact test?

2013-03-26 Thread Sarah Goslee
Proceeding to www.rseek.org and searching for Liddle Exact Test seems to provide at least one helpful result. Sarah On Tue, Mar 26, 2013 at 4:34 PM, gokhanocakoglu ocako...@uludag.edu.tr wrote: Dear friends, I am searching a code for Liddle Exact test which is equavelent to McNemar test...

Re: [R] Need code for Liddle Exact test?

2013-03-26 Thread Clint Bowman
Second item in Google, searching for Liddle Exact test McNemar test was cran.r-project.org/web/packages/exact2x2/vignettes/exactMcNemar.pdf Guess you should have looked before asking. Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET:

Re: [R] write.zoo

2013-03-26 Thread David Winsemius
On Mar 26, 2013, at 12:38 PM, netra timalsina wrote: Hei,I am writing a zoo object and then loading it shows the following error message.any suggestion would be appreciated? #create zoo seriesreg.zoo - zooreg(1:100, seq(from=as.Date(1999-01-01 ),'along.with'=100, by= 1 day)) #write zoo

[R] Feed rle() output to hist()

2013-03-26 Thread Newbie1234
I want to make a histogram from the lengths vector which is part of the output of rle. But I don't know how to access that vector so that I use it as an argument of hist(). What argument must I use so that I use the lengths vector as an input to hist()? Example output is: Run Length Encoding

[R] mixed effects model - log likelihood test

2013-03-26 Thread Thomas Devlin
Hi I am trying to investigate the effect of topic (conversational context - 3 variants) on the linguistic production (code - 4 variants) of 16 speakers. I want to run a mixed effects model with (speaker - 16 variants) and (word 500+ variants) as random effects to see whether they improve the

Re: [R] barplot colors

2013-03-26 Thread Francois De Ryckel
Hi David, Thanks a lot for your advice and helping me tricking barplot. It totally work. Have a great evening! François On 26 Mar 2013, at 21:43, David L Carlson wrote: You will have to trick barplot into thinking you have four groups: wmod - cbind(c(w[,1], 0, 0), c(0, 0, w[,2]))

Re: [R] barplot colors

2013-03-26 Thread Francois De Ryckel
Hi Rui, Thanks for trying. I know about the beside. The reason I want them stack with various colors is that the 4 stacks represent the number of students on each quartiles on a test. Have a terrific Tuesday! François On 26 Mar 2013, at 21:45, Rui Barradas wrote: Hello, I forgot to

Re: [R] Feed rle() output to hist()

2013-03-26 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Newbie1234 Sent: Tuesday, March 26, 2013 2:03 PM To: r-help@r-project.org Subject: [R] Feed rle() output to hist() I want to make a histogram from the lengths vector which is

Re: [R] Feed rle() output to hist()

2013-03-26 Thread Sarah Goslee
Do you want a histogram of the length distribution, or a barplot of the actual lengths? Either way, myrle$lengths will get it, if myrle is the output of rle(). ?rle tells you that: ‘rle()’ returns an object of class ‘rle’ which is a list with components: lengths: an integer vector

[R] when to use which apply function?

2013-03-26 Thread C W
Dear list, I am a little confused as to when to use apply, sapply, tapply, vapply, replicate. I've encountered this several times, This is time, this is what I am working on, mat - matrix(c(seq(from=1, to=10), rnorm(10)), ncol=2) a=1; b=5 newfun - function(x, y, a, b) { x*y+a+b }

[R] Newey West HAC for pooled cross-section data

2013-03-26 Thread SHISHIR MATHUR
Hello: My dataset set contains several thousand rows of data, with each row containing information for a house. The variables include the sale price of the house, the quarter and year of sale, the attributes of the house, and the attributes of the neighborhood and the city in which the house is

Re: [R] when to use which apply function?

2013-03-26 Thread Rui Barradas
Hello, The correct syntax would be sapply(1:10, function(i) newfun(x=mat[i, 1], y=mat[i, 2], a=a, b=b)) Hope this helps, Rui Barradas Em 26-03-2013 21:51, C W escreveu: Dear list, I am a little confused as to when to use apply, sapply, tapply, vapply, replicate. I've encountered this

Re: [R] Newey West HAC for pooled cross-section data

2013-03-26 Thread Achim Zeileis
On Tue, 26 Mar 2013, SHISHIR MATHUR wrote: Hello: My dataset set contains several thousand rows of data, with each row containing information for a house. The variables include the sale price of the house, the quarter and year of sale, the attributes of the house, and the attributes of the

Re: [R] when to use which apply function?

2013-03-26 Thread David Winsemius
On Mar 26, 2013, at 2:51 PM, C W wrote: Dear list, I am a little confused as to when to use apply, sapply, tapply, vapply, replicate. I've encountered this several times, This is time, this is what I am working on, mat - matrix(c(seq(from=1, to=10), rnorm(10)), ncol=2) a=1; b=5

Re: [R] a similar question

2013-03-26 Thread arun
HI Elisa, You need to review the formulas.  Some of them (especially between 84 85 or 4 84 is not making sense, possibly typos).  I changed it according to the pattern of the formulas. source(ElisaNew.txt) #mat1 # dataset res-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i)

Re: [R] From Java to R OOP

2013-03-26 Thread Francisco J. Bido
Thanks MW! Your comments were very helpful. I also see how the NextMethod() works now. On Mar 25, 2013, at 5:03 AM, R. Michael Weylandt wrote: On Mon, Mar 25, 2013 at 6:51 AM, Francisco J. Bido b...@mac.com wrote: Hi, I'm new to OOP in R so please forgive the naiveness of some of the

Re: [R] Newey West HAC for pooled cross-section data

2013-03-26 Thread SHISHIR MATHUR
Thanks for the reply Achim. The reason I suspect autocorrelation is because I think that within the same neighborhood, homes sold a few months back are likely to impact the price of homes sold subsequently. In fact the DW test and Breusch-Pagan test come out to be significant. So even though the

Re: [R] Plot cumulative sums of rainfall per year

2013-03-26 Thread Martin Labadz
This is working perfectly now…thanks a lot for your help. On 27/03/2013, at 2:36 AM, Law, Jason jason@portlandoregon.gov wrote: Try this: library(plyr) library(ggplot2) library(lubridate) data-read.csv(http://dl.dropbox.com/u/4236038/test_cumu.csv;) data$Date - as.Date(data$Date)

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
You're welcome. On 26/03/13 17:12, Patrick Connolly wrote: On Tue, 26-Mar-2013 at 05:05PM +0900, Pascal Oettli wrote: | Hi, | | You are right. The following should solve that problem: | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree*C))) That does it, and is perfectly

Re: [R] new question

2013-03-26 Thread arun
Hi, Try this: (Used the old data folder) Compares the spec counts of sub directory with each other.  directory- /home/arunksa111/dados GetFileList - function(directory,number){  setwd(directory)  filelist1-dir()[file.info(dir())$isdir]     direct-dir(directory,pattern =