[R] Fwd: Finding local maxima on a loess surface

2012-05-09 Thread Diego Rojas
-- Forwarded message -- From: Diego Rojas Date: Wed, May 9, 2012 at 3:05 PM Subject: Re: [R] Finding local maxima on a loess surface To: David Winsemius Thanks again, would you please try to ilustrate further your point with this example code. How would you find the coordinates

Re: [R] Finding residual standard error using bootstrap

2012-05-09 Thread Jorge I Velez
H Kelsey, Here is one way: # some data set.seed(123) x <- rnorm(100) e <- rexp(100, 2) y <- 3 + 1.5*x - 1.3*x^2 + e plot(x, y, las = 1) d <- data.frame(x, y) d # model fit <- lm(y ~ x + I(x^2) , data = d) summary(fit) rse <- summary(fit)$sigma rse # [1] 0.4646164 # function to calculate the RSE

[R] Time series and stl in R: Error only univariate series are allowed

2012-05-09 Thread rodri178
I am doing analysis on hourly precipitation on a file that is disorganized. However, I managed to clean it up and store it in a dataframe (called CA1) which takes the form as followed: Station_ID Guage_Type Lat Long Date Time_Zone Time_Frame H0 H1 H2 H3 H4 H5H6H7

Re: [R] Combine two tables by row with different columns

2012-05-09 Thread Rui Barradas
Hello, Try this T1 <- read.table(text=" X Y Z XX A 1 5 9 13 B 2 6 10 14 C 3 7 11 15 D 4 8 12 16 ", header=TRUE) T2 <- read.table(text=" X Y XX a 1 4 7 b 2 5 8 c 3 6 9 ", header=TRUE) cT <- read.table(text=" X Y XX A 1 5 13 B 2 6 14 C 3 7 15 D 4 8 16 A1 1 4 7 B1 2 5 8 C1 3 6

Re: [R] QQplots format

2012-05-09 Thread arun
HI Michael, Thanks for the reply.  The qqPlot is from library car.  I could use par(), but I thought by adding pos(), it will me more control. A.K. - Original Message - From: R. Michael Weylandt To: arun Cc: R help Sent: Wednesday, May 9, 2012 10:19 PM Subject: Re: [R] QQplots form

[R] Finding residual standard error using bootstrap

2012-05-09 Thread missToo Quick
Hello, I am trying to write a code to estimate the  residual standard error and create a confidence interval using bootstrap, since it does not follow a normal distribution. So far I have found a linear model for the data (m1<-lm(y~x+I(x^2))), but I am not sure how to create the bootstrap code

Re: [R] QQplots format

2012-05-09 Thread R. Michael Weylandt
Hi, car uses base graphics for this plot, so you can probably get what you want with the layout() function. These aren't grid graphics so print() is not at all helpful to you here. e.g., x <- rnorm(50) y <- rcauchy(50) dev.new() layout(matrix(1:2, nrow = 1)) qqPlot(x) qqPlot(y) dev.new() layou

Re: [R] problem with Gauss Hermite ( x and w )

2012-05-09 Thread R. Michael Weylandt
Taking negative numbers to fractional powers gives NaNs that's just how it works. Unless you want to use complex numbers (which R does not by default): as.complex(cc$x) ^ (2.5) Michael On Wed, May 9, 2012 at 7:22 PM, casperyc wrote: > Hi all, > > I am using the 'gaussHermite' function from

Re: [R] QQplots format

2012-05-09 Thread R. Michael Weylandt
What package is "qqPlot" from? There are at least two that provide a function by that name. If you're using grid graphics, this might get you started: http://gettinggeneticsdone.blogspot.com/2010/03/arrange-multiple-ggplot2-plots-in-same.html Michael On Wed, May 9, 2012 at 6:47 PM, arun wrote:

Re: [R] Combine two tables by row with different columns

2012-05-09 Thread R. Michael Weylandt
Just omit "Z" when you combine T1 and T2 -- incidentally, dput() is an even easier way to make a reproducible example (and you don't need rep() for your rownames since you arent repeating anything) T1 <- structure(1:16, .Dim = c(4L, 4L), .Dimnames = list(c("A", "B", "C", "D"), c("X", "Y", "Z", "XX

Re: [R] missing part of plot after exporting as eps o ps

2012-05-09 Thread R. Michael Weylandt
Reproducible example? Michael On May 9, 2012, at 6:49 PM, Ricardo Gomez wrote: > I'm using ggplot2 to create some plots. Whenever I export a plot as a eps or > ps. only a portion of the plot is printed. This doesn't happen with other > formats such png. Has anybody experienced this before? >

Re: [R] Combine two tables by row with different columns

2012-05-09 Thread Kristi Glover
Thanks David, I tried 'cbind" as you suggested: but did not work. Here are the example > T1=matrix(1:16, ncol=4) > rownames(T1)=rep(c("A","B","C","D")) > colnames(T1)=rep(c("X","Y","Z","XX")) > T2=matrix(1:9, ncol=3) > rownames(T2)=rep(c("A1","B1","C1")) > colnames(T2)=rep(c("X","Y","XX")) > T1

Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread David Winsemius
On May 9, 2012, at 9:44 PM, David Winsemius wrote: On May 9, 2012, at 6:38 PM, Mike Hilt wrote: I have spent hours on R in Windows 7. Just installed 2 days ago so the R package should be current. Currently I am using the RGui (64-bit) for Windows. I can not read an Excel file into R fr

Re: [R] Combine two tables by row with different columns

2012-05-09 Thread David Winsemius
On May 9, 2012, at 9:21 PM, Kristi Glover wrote: Hi R user, I could not combine two tables. Would any one help me on how I can combine with following example tables? You do realize that tables in R are not dataframes. They are a type of matrix. T1 X Y Z XX A 1 5 9 13 B 2 6 10 14

Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread Peter Alspach
Tena koe Mike To possibilities spring to mind: 1. loadedNamespaces() doesn't necessarily give you a list of the packages on the search path. Try search() instead. 2. It appears you may be using Word's so-called smart quotes. Note the difference in the error alert: Error: unexpected input in

Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread David Winsemius
On May 9, 2012, at 6:38 PM, Mike Hilt wrote: I have spent hours on R in Windows 7. Just installed 2 days ago so the R package should be current. Currently I am using the RGui (64-bit) for Windows. I can not read an Excel file into R from my computer. Have hours on this. Completely cra

Re: [R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread Jim Holtman
does your quoted filename have "smart" quotes? are you using WORD to create your scripts? Sent from my iPad On May 9, 2012, at 18:38, Mike Hilt wrote: > I have spent hours on R in Windows 7. Just installed 2 days ago so the R > package should be current. > > > > Currently I am using the R

[R] Combine two tables by row with different columns

2012-05-09 Thread Kristi Glover
Hi R user, I could not combine two tables. Would any one help me on how I can combine with following example tables? > T1 X Y Z XX A 1 5 9 13 B 2 6 10 14 C 3 7 11 15 D 4 8 12 16 > T2 X Y XX a 1 4 7 b 2 5 8 c 3 6 9 I want to get the following table cT X Y XX A 1 5 13 B 2 6 14

[R] missing part of plot after exporting as eps o ps

2012-05-09 Thread Ricardo Gomez
I'm using ggplot2 to create some plots. Whenever I export a plot as a eps or ps. only a portion of the plot is printed. This doesn't happen with other formats such png. Has anybody experienced this before? [[alternative HTML version deleted]]

[R] QQplots format

2012-05-09 Thread arun
Dear R help, I tried to plot two qq plots in the same window using the code below.  Somehow it is plotting only one at a time.   I borrowed the print function from xyplot.   pdf("QQplotCorrUncorr.pdf") qq1<-qqPlot(residuals(fm), main="QQ plot for Correlated Model") qq2 <-qqPlot(residuals(fm

[R] Can't read xlsx file into R. Seem, Seem to have XLConnect loaded.

2012-05-09 Thread Mike Hilt
I have spent hours on R in Windows 7. Just installed 2 days ago so the R package should be current. Currently I am using the RGui (64-bit) for Windows. I can not read an Excel file into R from my computer. Have hours on this. Completely crazy!! I have the XLConnect package loaded. I th

[R] problem with Gauss Hermite ( x and w )

2012-05-09 Thread casperyc
Hi all, I am using the 'gaussHermite' function from the 'pracma' library CODES ### library(pracma) cc=gaussHermite(10) cc$x^2 cc$x^5 cc$x^4 CODES ### as far so good. However, it does NOT work for any NON integer values, say CODES ##

Re: [R] as.function parameters

2012-05-09 Thread Rui Barradas
Hello, > > Is there a way to force a call-by-value instead of a call-by-address? > Yes, there is one way, just do nothing. R always uses call-by-value. I'm not completely sure about this, but when you create f() the parameter x default value is a promise, not an actual, evaluated value. Courtesy

Re: [R] glmmADMB

2012-05-09 Thread rbuxton
Hi there, I am using R version 2.14.2, package glmmADMB Here is the entire script: calls <- read.csv(file.choose()) > callsna <- na.omit (calls) > mod <- glmmadmb(LESP.CHUCKLE~ > Years.Erad+IS+Ref+Moon+Wind.Speed+Dist.Buldir+(1|SITE/ISLAND), > data=callsna, zeroInflation=TRUE, family="nbinom") >

Re: [R] Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:

2012-05-09 Thread Gabor Grothendieck
On Wed, May 9, 2012 at 7:24 PM, Shivam wrote: > Ohh ... Thanks Gabor. I have a few related queries then, kindly have a look: > > 1. Does it only hinder the sqldf package or are there other issues with > using POSIXlt in a dataframe? Am asking because I have a few dataframes with > columns of class

Re: [R] Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:

2012-05-09 Thread jim holtman
I think your problem is caused by DTTM in testeq being POSIXlt. This is a strange class to have in a dataframe. Try is as POSIXct. Example: > str(testeq) 'data.frame': 6 obs. of 5 variables: $ NAME : chr "DLF" "DLF" "DLF" "DLF" ... $ TMSTMP: chr "09:07:07" "09:15:03" "09:15:03" "09:15:0

Re: [R] Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:

2012-05-09 Thread Shivam
Ohh ... Thanks Gabor. I have a few related queries then, kindly have a look: 1. Does it only hinder the sqldf package or are there other issues with using POSIXlt in a dataframe? Am asking because I have a few dataframes with columns of class(POSIXlt ). 2. I have columns containing 'date+timestam

Re: [R] Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:

2012-05-09 Thread Gabor Grothendieck
On Wed, May 9, 2012 at 5:58 PM, Shivam wrote: > Hi All, > > I am having trouble executing SQL statements on a few dataframes, but the > funny thing is that I am able to execute the statement on some other > dataframes. > Never put POSIXlt objects into data frames. -- Statistics & Software Consu

Re: [R] Dotchart showing mean and median by group

2012-05-09 Thread Gabor Grothendieck
On Wed, May 9, 2012 at 5:32 PM, Tal Galili wrote: > Hello dear Gabor, > > First - thank you for this solution! > > Second - I see that the text that is added around the axes is a tiny bit > shifted - causing a slight blur of the text.  Does it happen only on > Windows?  Can it be fixed? > On my W

Re: [R] Sweave, beamer and alert within code chunks

2012-05-09 Thread Yihui Xie
Syntax highlighting is easy with the highlight package, on which the knitr package is based, e.g. - sample source: https://gist.github.com/1803930 - sample pdf: https://github.com/downloads/yihui/knitr/knitr-beamer.pdf It is possible to insert \alert{} with knitr, but you have to provide the logi

[R] Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:

2012-05-09 Thread Shivam
Hi All, I am having trouble executing SQL statements on a few dataframes, but the funny thing is that I am able to execute the statement on some other dataframes. To test, I have 2 very small dataframes (6 rows and some columns). One is 'lessliq', the dput is given below. > dput(head(lessliq)) s

[R] reception of (Vegan) envfit analysis by manuscript reviewers

2012-05-09 Thread Matt Bakker
I'm getting lots of grief from reviewers about figures generated with the envfit function in the Vegan package. Has anyone else struggled to effectively explain this analysis? If so, can you share any helpful tips? The most recent comment I've gotten back: "What this shows is which NMDS axis separ

[R] Failed Convergence when using mi to generate synthetic data

2012-05-09 Thread Rob James
I was hoping to use mi to generate a synthetic version of a database. The strategy (see code below) was simple: use the diamonds dataset from ggplot2, subset it focus on 3K single-color, then create a blank record for every "real" record, and throw the new dataset at mi to see if it would popula

Re: [R] Dotchart showing mean and median by group

2012-05-09 Thread Tal Galili
Hello dear Gabor, First - thank you for this solution! Second - I see that the text that is added around the axes is a tiny bit shifted - causing a slight blur of the text. Does it happen only on Windows? Can it be fixed? Contact Details:--

[R] the degrees of freedom in rtmvt {tmvtnorm}

2012-05-09 Thread Jun Shen
Dear list, I would like to do some simulation with a truncated multivariate t-distribution. I found "rtmvt" in package tmvtnorm. I am not sure how to specify the degrees of freedom parameter. I estimated the mean vector (with 6 elements) and covariance matrix (6 X 6) from a dataset with 46 subjec

[R] Sweave, beamer and alert within code chunks

2012-05-09 Thread Giovanni Petris
Hi all, Using Beamer, in order to highlight a piece of R code I do something like this - note the "\structure" and "\alert" commands: \begin{semiverbatim} > mleOut <- \structure{dlmMLE}(Nile, + parm = c(0.2, 120), # initial values for optimizer + lower = c(1e-7,

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
as was follows: library(gplots) arq <-read.table("r") matrix_l <-data.matrix(arq) pdf("heatmap.pdf", height = 10 , width=10) #paleta de 10 cores - sentido branco -> preto my.colors <- colorRampPalette(c("gray100","gray90","gray80","gray70","gray60","gray50","gray40","gray30","gray20","gray10")) h

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
last doubts, how do I remove these trace that sits on top of colors? -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4621466.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] How to apply functions across columns?

2012-05-09 Thread R. Michael Weylandt
Indeed, apply is very flexible and idiomatically R (i.e., the right way to do it) -- but, just a heads up, for datasets with many rows/columns rowMeans and colMeans will be *much* faster (there's loop overhead in the apply family) Best, Michael On Wed, May 9, 2012 at 3:46 PM, Robert Latest wrote

Re: [R] How to apply functions across columns?

2012-05-09 Thread Robert Latest
On Wed, May 9, 2012 at 4:19 PM, R. Michael Weylandt wrote: > Good reproducible example ;-) > > Easiest is probably just: > > cbind(tencor, ThisRowMean =  rowMeans(tencor[, 4:8])) Actually, after frying my brain on tapply() and sapply() I found that just plain apply() does what I need: tencor$mea

Re: [R] How to import .accda database into R

2012-05-09 Thread Greg Snow
The phrase "doesn't work" does not do much to help us help you, see: https://stat.ethz.ch/pipermail/r-help/2012-April/311074.html Also if you don't tell us what you have tried (and how the results differed from what you want) then we have no way of knowing if you have already tried our first sugge

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
I think it worked here, the data of 25 families are wrong, I'll pack up and post already! earned -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4621364.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
http://r.789695.n4.nabble.com/file/n4621356/Captura_de_tela-13.png The heat map generated the correct result: library(gplots) arq <-read.table("l") matrix_l <-data.matrix(arq) my.colors <- colorRampPalette(c("gray0","gray10","gray20","gray30","gray40","gray50","gray60","gray80","gray90","gray100

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Richard M. Heiberger
One more item. Have you given a copy of the document R: Regulatory Compliance and Validation Issues A Guidance Document for the Use of R in Regulated Clinical Trial Environments http://www.r-project.org/doc/R-FDA.pdf to your security office? It addresses overlapping, not identical, security

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Bert Gunter
Thanks Rich and Paul: This gets back to my original comment in this thread. I believe that CRAN repositories simply rely on whatever security software (malware checking, etc.) that the hosts provide; R/CRAN do nothing, as you said. This results in a whole new and almost certainly wholly impractica

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Duncan Murdoch
On 09/05/2012 2:04 PM, Gabor Grothendieck wrote: On Wed, May 9, 2012 at 12:46 PM, Paul Martin wrote: > I don't have much new to add, but I want to make some clarifying comments: > > First, there are clearly workarounds available. I am using one now. R is > installed on a personal laptop which

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Richard M. Heiberger
I spoke to someone in the military who did some investigation. This is his response >> 1. I'm sorry that I don't have anything good to report. The military is >> cautious with it's networks and I'm no longer able to use R at work. I >> don't know anything about this registry issue but the show s

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Gabor Grothendieck
On Wed, May 9, 2012 at 12:46 PM, Paul Martin wrote: > I don't have much new to add, but I want to make some clarifying comments: > > First, there are clearly workarounds available. I am using one now. R is > installed on a personal laptop which I bring to work every day. I take > extreme care with

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Paul Martin
I don't have much new to add, but I want to make some clarifying comments: First, there are clearly workarounds available. I am using one now. R is installed on a personal laptop which I bring to work every day. I take extreme care with the nature of the files I move back and forth, and none o

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
I just do not understand what these parameters that must pass the heat map -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4620958.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] two Y Axes (in the same scale) in ggplot2

2012-05-09 Thread John Kane
I don't think it is doable in ggplot2. Hadley dislikes dual scales on a single plot which is what most people would use such a thing for and so it is basically not on his to-do list. It is relatively easy to do in base graphics. Here on example I put together a few years ago as an exercise --

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread Michael Sumner
It's not water vapour: http://www.youtube.com/watch?v=rg12qNRgSag On Thu, May 10, 2012 at 2:20 AM, peter dalgaard wrote: > > On May 9, 2012, at 17:46 , Michael Sumner wrote: > >> Barry, *fortunes* are very auspicious but you are already well represented. > > "..as nebulous as cloud computing..",

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Marc Schwartz
On May 9, 2012, at 11:00 AM, Barry Rowlingson wrote: >>> Someone said: > >>> Once R is accepted, you could ask for an RStudio test if you want. > > I had another thought shortly after my initial email. Suppose yes, R > is accepted. Great. You run R. > > Then you think, "Oh, I need ggplot2" (ye

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread peter dalgaard
On May 9, 2012, at 17:46 , Michael Sumner wrote: > Barry, *fortunes* are very auspicious but you are already well represented. "..as nebulous as cloud computing..", indeed! > Cheers, Mike. > > On Thu, May 10, 2012 at 1:38 AM, Whit Armstrong > wrote: >> I don't work for Amazon, but here is one

Re: [R] There must be a better way to do this

2012-05-09 Thread David Perlman
Thanks, that is very helpful. I agree that my example plot was a bit cluttered, but this is what I actually wanted: http://brainimaging.waisman.wisc.edu/~perlman/data/MNPT1T2_h_unp_raw.pdf I just needed to get example code out quickly. You get better help when you have a self-contained demo of

Re: [R] glmmADMB

2012-05-09 Thread Paul Johnson
On Tue, May 8, 2012 at 9:06 PM, rbuxton wrote: > Update! > > I changed the "site" categories. I noticed that I had coded them as > "North, > South, East, West" on different islands, which may have caused confusion in > the model. > > [...] > mod <- glmmadmb(LESP.CHUCKLE~ 1+(1|ISLAND), data=ca

[R] Produce indicator values + variance explained tables of a MRT produced by mvpart (R)

2012-05-09 Thread jaZZerkill
How can I produce a table with the variance explained by each explain variable and a table with indicator values of the explain variables of the MRT produced by mvpart (R) Example? --> table 2 and table 3 in the following document: http://sav-harbor.com/GRS%20Info/MSM/Predicting_Tidal_Marsh_Veget

Re: [R] Random resampling of columns in species association matrices

2012-05-09 Thread David L Carlson
Sample data would make it possible to explore the options in more detail, but here are two possibilities: 1. Convert each row of the matrix to row proportions and then take the cumulative sum. Now draw a random uniform number between 0 and 1 and find the first column that is larger than the random

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Barry Rowlingson
>> Someone said: >> Once R is accepted, you could ask for an RStudio test if you want. I had another thought shortly after my initial email. Suppose yes, R is accepted. Great. You run R. Then you think, "Oh, I need ggplot2" (yes you do). Do you then have to get security clearance for every pac

Re: [R] file path

2012-05-09 Thread Uwe Ligges
On 09.05.2012 17:14, Wincent wrote: Hmm, I don't think it gives what I want. For example, I assign a file name to f, f<- "a?b.txt" file.path("e:",f) [1] "e:/a?b.txt" The resultant character is not accepted as a file name by Windows OS. Not on Linux if you write to a smb file system, and

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread Michael Sumner
Barry, *fortunes* are very auspicious but you are already well represented. Cheers, Mike. On Thu, May 10, 2012 at 1:38 AM, Whit Armstrong wrote: > I don't work for Amazon, but here is one of their promo pieces on > using 'spot' instances: > http://youtu.be/WD9N73F3Fao > > at about 2:15, they cit

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread Whit Armstrong
I don't work for Amazon, but here is one of their promo pieces on using 'spot' instances: http://youtu.be/WD9N73F3Fao at about 2:15, they cite University of Melbourne and Universitat de Barcelona as customers... My interest in all this cloud talk is that I'll be presenting a tutorial on R in the

[R] [R-pkgs] ANN: bigml package for R bigml_0.1.tar.gz

2012-05-09 Thread Justin Donaldson
The "bigml" package is an R wrapper for the BigML API: https://bigml.com/developers It contains straightforward methods for most of the relevant API end points, as well as some fancier methods that allow for direct translations from R dataframes directly into datasets appropriate for BigML. Excer

Re: [R] file path

2012-05-09 Thread Wincent
Hmm, I don't think it gives what I want. For example, I assign a file name to f, > f <- "a?b.txt" > file.path("e:",f) [1] "e:/a?b.txt" The resultant character is not accepted as a file name by Windows OS. On 9 May 2012 20:32, Tal Galili wrote: > Hi Wincent, > Have a look at: > ?file.path > > >

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Marc Schwartz
On May 9, 2012, at 9:57 AM, Duncan Murdoch wrote: > On 08/05/2012 11:10 AM, Paul Martin wrote: >>Kirtland Air Force Base has denied approval for the use of R on its >>Windows network. Some of their objections seem a bit strange, but some >>appear to be legitimate. In particular, th

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Gavin Blackburn
Not sure if it helps, but Tinn-R could be used as a replacement for RStudio if the main things you were after were the syntax highlighting and R integration. Cheers, Gavin. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan M

Re: [R] Automating R for Hypothesis Testing

2012-05-09 Thread Rui Barradas
Hello, Yes, it does help. Now we can see your data and what you're doing. What follows is a suggestion on what you could do, not full solution. (You forgot to say what X1 is, but I don't think it's important to understand the suggestion.) (If I'm wrong, say something.) milwaukeephos <- read.csv(

Re: [R] barplot: legend: two rows

2012-05-09 Thread Uwe Ligges
On 09.05.2012 13:23, Marion Wenty wrote: dear r-helpers, i have got another question: i am using the functions par(xpd=T) legend to create a legend below the x-axis. i used the parameter horiz=T. now i would like to put the elements of the legend in two rows: e.g. if my legend has got 5 e

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Duncan Murdoch
On 08/05/2012 11:10 AM, Paul Martin wrote: Kirtland Air Force Base has denied approval for the use of R on its Windows network. Some of their objections seem a bit strange, but some appear to be legitimate. In particular, they have detected registry "vulnerabilities" which

Re: [R] Two Y axes (same scale) in ggplot2 or plot

2012-05-09 Thread Gary Dong
Thanks, Duncan. I tried axis(). It appears it allows you to add an axis, but does not say you can plot a second Y in the graph. Maybe I'm understanding it correctly. Any help will be appreciated! Gary On Wed, May 9, 2012 at 7:26 AM, Duncan Murdoch wrote: > On 08/05/2012 3:23 PM, Gary Dong wrot

[R] Random resampling of columns in species association matrices

2012-05-09 Thread mariasve
I have a host-parasite association matrix in which parasite species are rows and host species columns and cells contain the frequency of interactions. Some parasites are associated with many hosts, and some hosts harbor several parasites, and I want to repeatedly select only one single representati

Re: [R] Two Y axes (same scale) in ggplot2 or plot

2012-05-09 Thread Duncan Murdoch
On 09/05/2012 10:46 AM, Gary Dong wrote: Thanks, Duncan. I tried axis(). It appears it allows you to add an axis, but does not say you can plot a second Y in the graph. Maybe I'm understanding it correctly. Any help will be appreciated! I don't understand what you want. Could you give an ex

Re: [R] file path

2012-05-09 Thread Duncan Murdoch
On 09/05/2012 4:03 AM, Wincent wrote: Dear all, is there any function to assert whether a file path is legitimate, and to convert any potential file path to a legitimate file path? I automate a batch of files and write them to plain text files with cat(). The file argument of cat() is generated

Re: [R] Two Y axes (same scale) in ggplot2 or plot

2012-05-09 Thread Duncan Murdoch
On 08/05/2012 3:23 PM, Gary Dong wrote: Dear R users, I'm plotting housing prices in City A over past 30 years in ggplot2. The Xs are years since 1980. I have two housing price variables: new home prices and old home prices, both of them measured by $/sqft. I have searched related threads on mul

Re: [R] How to apply functions across columns?

2012-05-09 Thread R. Michael Weylandt
Good reproducible example ;-) Easiest is probably just: cbind(tencor, ThisRowMean = rowMeans(tencor[, 4:8])) # Whatever you replace "ThisRowMean" with will become the column name Best, Michael On Wed, May 9, 2012 at 10:12 AM, Robert Latest wrote: > Hello, > > me again. > > I have a data fram

Re: [R] plot betadisper, change of pch

2012-05-09 Thread David Winsemius
On May 9, 2012, at 6:20 AM, Albin Blaschka wrote: Hello! After performing an analysis with betadisper, package vegan I would like to plot the results - so far, so good. But I would also like to "tune" a little bit the plotting characters, as '+' and 'x' are a little to similar... My (

[R] How to apply functions across columns?

2012-05-09 Thread Robert Latest
Hello, me again. I have a data frame that looks like this (actual dput output at bottom): > head(tencor) datelot wf.id s1 s2 s3 s4 s5 1 08.05.2012 W0X3H0 9 1238 1263 1244 1200 1183 2 08.05.2012 W0X3H010 1367 1396 1371 1325 1311 3 08.05.2012 W0X3H011 1383 1417 13

Re: [R] How to deal with a dataframe within a dataframe?

2012-05-09 Thread Gabor Grothendieck
On Tue, May 8, 2012 at 9:19 AM, Robert Latest wrote: > Hello all, > > I am doing an aggregation where the aggregating function returns not a > single numeric value but a vector of two elements using return(c(val1, > val2)). I don't know how to access the individual columns of that > vector in the

Re: [R] plot betadisper, change of pch

2012-05-09 Thread Uwe Ligges
Runnig the examples from ?betadisper and adding a pch statement gives: > plot(mod, pch=2) Error in plot.xy(xy.coords(x, y), type = type, ...) : formal argument "pch" matched by multiple actual arguments > traceback() 5: plot.xy(xy.coords(x, y), type = type, ...) 4: points.default(g$centro

[R] as.function parameters

2012-05-09 Thread jackl
Hi, i have a question regarding the as.function functionality. I need to save multiple functions with adjusted parameters in a list. The adjusted parameters are changed via variables in a loop. The problem I'm facing right now is that the functions saved in the list don't have the values of the pa

Re: [R] what folder to run write_PACKAGES in?

2012-05-09 Thread Uwe Ligges
On 09.05.2012 01:14, Jeff Newmiller wrote: I have not done this myself, but reading through your book I see no reference to actual sample file names. I mention this because UNIX-ish operating systems download the tar.gz source archives while Windows works with the zip binary packages, and I

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread Barry Rowlingson
On Wed, May 9, 2012 at 2:22 PM, John Laing wrote: > For 200,000 analyses at 1.5 seconds each, you're looking at ~83 hours > of computing time. You can buy time from Amazon at roughly $0.08 / > core / hour, so it would cost about $7 to run your analyses in the > cloud. Assuming complete paralleliza

Re: [R] two Y Axes (in the same scale) in ggplot2

2012-05-09 Thread David Winsemius
On May 9, 2012, at 3:28 AM, Jim Lemon wrote: On 05/09/2012 05:29 AM, wudadan wrote: Dear R users, I'm plotting housing prices in City A over past 30 years in ggplot2. The Xs are years since 1980. I have two housing price variables: new home prices and old home prices, both of them measur

Re: [R] What is the most cost effective hardware for R?

2012-05-09 Thread John Laing
For 200,000 analyses at 1.5 seconds each, you're looking at ~83 hours of computing time. You can buy time from Amazon at roughly $0.08 / core / hour, so it would cost about $7 to run your analyses in the cloud. Assuming complete parallelization you could fire up as many machines as you need to get

Re: [R] R exercises - too confusing for me.

2012-05-09 Thread Kenn Konstabel
Hi, But what if your professor reads this list? Anyway, who cares, two hints: 1. It might be useful to read the explanations provided with the problem. For example, your exercise tells you that "use the help command ?rexp to read how to generate exponentially distributed variables". On a careful

Re: [R] Dotchart showing mean and median by group

2012-05-09 Thread Gabor Grothendieck
On Wed, May 9, 2012 at 3:25 AM, maxbre wrote: > Given this example > > mean.values<-colMeans(VADeaths) > > mean.values<-apply(VADeaths, 2, mean) > median.values<-apply(VADeaths, 2, median) > > dotchart(VADeaths, gdata=mean.values) > dotchart(VADeaths, gdata=median.values) > > is it possible to “co

[R] interpolating climate data

2012-05-09 Thread Mintewab Bezabih
Dear R-users, I am working on interpolating the station level temperature data to farm level data. I have z vector consisting of station level temperature observations and my x and y are latitude and longitude corresponding to a farm. My understanding is I can use raster combined with tps.

Re: [R] How to deal with a dataframe within a dataframe?

2012-05-09 Thread David Winsemius
On May 9, 2012, at 2:40 AM, Robert Latest wrote: On Tue, May 8, 2012 at 3:38 PM, R. Michael Weylandt wrote: So this actually looks like something of a tricky one: if you wouldn't mind sending the result of dput(head(agg)) I can confirm, but here's my hunch: Hi Michael, while I'm trying t

Re: [R] Dotchart showing mean and median by group

2012-05-09 Thread Tal Galili
Hi Max, I see that "dotchart" does not have a "add" parameter. For the fun of it, I added this feature, you can see the source code of the new function here: https://raw.github.com/talgalili/R-code-snippets/master/dotchart.with.add.r With your example at the end of the file. Here is a page showing

[R] Error in outer() : dimension mismatch

2012-05-09 Thread Pinar Ceyhan
Dear R users, I am a new R user and have some difficulty understanding the functioning of “outer”, where my question is from. I have read the posts related to the questions on the outer function, but unfortunately could not figure out where my mistake is. I have a function with two variables

[R] rjags dmnorm error

2012-05-09 Thread hatty_m
I am having trouble initializing a bayesian model, with multivariate normal likelihood. *model{* for (i in 1:N) { mu1[i]<-(pow(10,(pka1-ph[i]))*da1[2]+da1[1])/(1+pow(10,(pka1-ph[i])))+K[1] } for (i in 1:N) { mu2[i]<-(pow(10,(pka2-ph[i]))*da2[2]+da2[1])/(1+pow(10,(pka2-ph[i])))+K

[R] interpolation of climate data

2012-05-09 Thread Mintewab Bezabih
Dear R-users, I am working on interpolating the station level temperature data to farm level data. I have z vector consisting of station level temperature observations and my x and y are latitude and longitude corresponding to a farm. My understanding is I can use raster combined with tps.

[R] Survival data with time dependent covariate

2012-05-09 Thread BrittD
http://r.789695.n4.nabble.com/file/n4619765/survival_file.png Hi everyone, This is what my data looks like, I haven't included the covariates, the example would get too large. uid id date feverstart dumfever 130 75 3464652011-04-11

[R] R exercises - too confusing for me.

2012-05-09 Thread UdVBIA
Hi! I tried everything to avoid asking somebody but I have absolutely no clue how to solve this tasks. I'll be really glad if someone could explain that to me... 1. http://r.789695.n4.nabble.com/file/n4619850/task1.gif Well, the first part is of course no problem but I have really trouble wit

Re: [R] file path

2012-05-09 Thread Tal Galili
Hi Wincent, Have a look at: ?file.path Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) --

[R] Auto Reg with AR(1)

2012-05-09 Thread anil
I am trying to match the SAS Proc Autoreg with AR(1) (Nlag = 1 option) with R. I am able to Regression in R and it's value matches with SAS. However i am not able to find the Autoreg with AR(1) Estimates value which is matching with SAS output. Kindly help. -- View this message in context: htt

Re: [R] Value of Hurst exponent (R/S) method > 1

2012-05-09 Thread Barun Saha
Hello All, I'm coming across multiple data sets for which the R/S estimate of H is greater than 1. Could someone please explain this to me? On Mon, May 7, 2012 at 4:13 PM, Barun Saha wrote: > > Hello, > > I'm using fArma package to estimate the value of Hurst exponent using R/S > method. However

Re: [R] Automating R for Hypothesis Testing

2012-05-09 Thread meredith
dput: http://r.789695.n4.nabble.com/file/n4620188/milwaukeephos.csv milwaukeephos.csv # Feb-march > modelH_febmarch<-lm(llfeb_march~lffeb_march) >modelHa_febmarch<-lm(llfeb_march~X1feb_mar+lffeb_march) > anova(modelHa_febmarch) > coefficients(modelH_febmarch) (Intercept) lffeb_march -2.429890

Re: [R] some R exercises

2012-05-09 Thread Florian Weiler
Just thought about it, you can have this of course "cheaper" without the loops. Like this: fun1 <- function(x) sum((x-mean(x))^2)/(length(x)+1) fun2 <- function(x) sum((x-mean(x))^2)/(length(x)) x <- rexp(15) fun1(x) fun2(x) -- View this message in context: http://r.789695.n4.nabble.com/some-R-

Re: [R] some R exercises

2012-05-09 Thread Florian Weiler
On Exercise 5, how about this (I'm rather new to R as well, so no guarantee this is right and I'm sure there are more efficient ways to do this!): fun1 <- function(x) { y <- 0 for (i in 1:length(x)) {y[i] <- (x[i]-mean(x))^2} sum(y)/(length(x)+1) } fun2 <- function(x) { y <- 0 for

  1   2   >