[R] parameterization question

2014-09-05 Thread Dale Garman
How can I parameterize the function call to aggregate() below with colx (a character string) in the following code? That is, replace both if statements with aaa <- aggregate(colx_something, data=tidy[grpyrs,],sum). I've tried a couple of ideas for "colx_something" but get an R-error each time. B

[R] rgl 'how-to's

2011-09-07 Thread Dale Coons
a bitmap be used as the marker for a point? Thanks in advance for help-I learn a lot from others questions and appreciate direction (even if it's RTFM!) Dale __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Animated gif or something similar in R?

2011-07-29 Thread Dale Coons
Thanks to several who responded--I should have looked (doh!) in the documentation. play3d() and movie3d() were just the ticket! On 7/28/2011 4:48 PM, Jean V Adams wrote: > > Dale, > > I do not have the same color problem when I run your code on my PC. > The colors in both d

[R] Animated gif or something similar in R?

2011-07-28 Thread Dale Coons
s some motion rather than a static display ;-) Thanks in advance, Dale. library(rgl) clusset<-data.frame(x=c(round(abs(rnorm(5,7,1)),1),round(abs(rnorm(5,11,2)),1), round(abs(rnorm(5,16,2)),1),round(abs(rnorm(5,20,1.5)),1),round(abs(rnorm(5,5,2)),1)),

Re: [R] Compiling C-code in Windows

2011-05-31 Thread Smith, Dale
Try CC=gcc -mno-cygwin to avoid linking with the Cygwin dlls. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Direct NYC: 212-419-3242 Direct Norcross: 678-375-5315 Mobile: 678-982-6599 Mail: dale.sm...@fiserv

Re: [R] Building Custom GUIs for R

2011-05-20 Thread Smith, Dale
separates changes to the R code from the actual gui used. I prototyped this solution a few years ago using Windows and it worked very well. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Direct NYC: 212-419-

Re: [R] applying uniroot function to each element in vector

2011-04-27 Thread Dale
Yes my example was not the best, it is an oversimplified example. I tried using your method and didn't seem to work. -- View this message in context: http://r.789695.n4.nabble.com/applying-uniroot-function-to-each-element-in-vector-tp3478573p3479895.html Sent from the R help mailing list archive

[R] applying uniroot function to each element in vector

2011-04-27 Thread Dale
If I have a vector of n elements, e.g. a vector of length 4 with elements 10, 20, 30, 40 and want to find the different values of x such that x^2=10, x^2=20, x^30 and x^2=40, how could I do this in R? I'm thinking of using the uniroot function, but am finding difficult applying it to a vector. Than

Re: [R] How to program with colleagues

2011-04-19 Thread Smith, Dale
a. Check out Roxygen. b. Use version control. You will not regret it. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Direct NYC: 212-419-3242 Mail: dale.sm...@fiserv.com www.fiserv.com -Original Mes

Re: [R] Jonckheere-Terpstra test using coin package?

2010-05-05 Thread Dale Steele
afo = rank, xtrafo = function(data) trafo(data, factor_trafo = ff), alternative="greater", distribution=approximate(B=50)) On Wed, Apr 21, 2010 at 8:23 PM, Dale Steele wrote: > Is it possible to implement the Jonckheere-Terpstra test for ordered > alte

[R] Jonckheere-Terpstra test using coin package?

2010-04-21 Thread Dale Steele
concrete, I've include a small dataset. Thanks. --Dale Hollander and Wolfe, 1999 Table 6.6, pg 205 control <- c(40, 35, 38, 43, 44, 41) rough <- c(38, 40, 47, 44, 40, 42) accurate <- c(48, 40, 45, 43, 46, 44) pieces <- list(control, rough, accurate) n <- c(6, 6, 6) grp <-

[R] R/Finance 2010

2010-03-13 Thread Dale Rosenthal
Algorithmics. For the program committee: Gib Bassett, Peter Carl, Dirk Eddelbuettel, John Miller, Brian Peterson, Dale Rosenthal, Jeffrey Ryan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] possible arrangements of across sample ties for runs test

2010-02-26 Thread Dale Steele
plicated(data)] #find all duplicates idd <- dd %in% X & dd %in% Y #determine found in both X and Y duplicates <- dd[idd] Thanks! --Dale [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] behavior of seq_along

2010-02-25 Thread Dale Steele
I'm trying to understand the behavior of seq_along in the following example: x <- 1:5; sum(x) y <- 6:10; sum(y) data <- c(x,y) S <- sum( data[seq_along(x)] ) S T <- sum( data[seq_along(y)] ) T Why is T != sum(y) ? __ R-help@r-project.org mailing list

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
, 5) Error in .C("R_qansari", as.integer(length(p)), q = as.double(p), as.integer(m), : C symbol name "R_qansari" not in load table --Dale On Wed, Feb 24, 2010 at 8:47 PM, Sharpie wrote: > > > Dale Steele wrote: >> >> I would like to be able to use two

[R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
I would like to be able to use two functions; qansari and pansari which are found in the function ansari.test. How can I evaluate these functions independently? Thanks. --Dale For example, when I load the function ... qansari <- function(p, m, n) { .C(R_qansari, as.inte

Re: [R] Code find exact distribution for runs test?

2010-02-12 Thread Dale Steele
gth: factorial(length(vect)) #length: choose(n, n1) Best Regards. --Dale On Thu, Feb 11, 2010 at 10:04 PM, Greg Snow wrote: > Try this: > > druns2 <- function(x, n1, n2) { > >        if( x %% 2 ) { # odd x >                choose( n1 - 1, n1 - (x+1)/2 ) * choo

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Dale Steele
n2=4) #in Wackerly, Mendenhall and Scheaffer, 2002, presumably done using # exact calculations. Thanks. --Dale On Thu, Feb 11, 2010 at 6:08 PM, Greg Snow wrote: > OK, I think I have it worked out for both cases: > > library(vcd) > > druns &

[R] Code find exact distribution for runs test?

2010-02-10 Thread Dale Steele
rm) for (i in 1:nperm) { RUNS[i] <- nruns(sample(x)) } cdf <- cumsum(table(RUNS))/nperm return(list(RUNS=RUNS, cdf=cdf, nperm=nperm)) } MC.runs(dtemp, 10) Thanks. --Dale __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] Wilcoxon signed-ranks test using package coin ?

2010-02-08 Thread Dale Steele
lement this test using library(coin) - is this possible? Thanks. --Dale __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide co

[R] How to Reshuffle a distance object

2009-04-15 Thread Dale Steele
matrix without losing the structure? Thanks. --Dale x1 <- c(rep(0,4),1) x2 <- c(rep(0,2),rep(1,3)) x3 <- c(rep(1,3), rep(0,2)) X <- rbind(x1,x2,x3) X X <- as.data.frame(X) library(ade4) jc.dist  <- dist.binary(X, method=1) sample(jc.dist) _

[R] code to find all distinct subsets of size r from a set of size n

2009-03-13 Thread Dale Steele
SS\scripts file for Chapter 5 and 'subsets' is not a function in MASS. I did find this problem is discussed in RNews, Programmer's Niche 1(1):27 - 30 and RNews, 1(2):29-31. Is there function in 'base' R or other package to do this? Thanks. --Dale ___

[R] Efficent way to create an nxn upper triangular matrix of one's

2009-02-11 Thread Dale Steele
The code below create an nxn upper triangular matrix of one's. I'm stuck on finding a more efficient vectorized way - Thanks. --Dale n <- 9 data <- matrix(data=NA, nrow=n, ncol=n) data for (i in 1:n) { data[,i] <- c(rep(1,i),

[R] Finding the distance between ordered integers

2009-01-22 Thread Dale Steele
I'm stuck on how best to of find the distance between ordered integers (presented below as a birthday problem). Given the vector x, how do I most efficiently generate the vector x[i+1] - x[i]? Thanks. --Dale For example... set.seed(555) x <- sample(1:365, 10, replace=TRUE) x <-

Re: [R] Beautify R scripts in microsoft word

2008-09-13 Thread Dale Steele
Open script in Tinn-R, select script to copy. Then use menu Edit:Copy formatted (to export) --> RTF Paste into MS word. --Dale On Sat, Sep 13, 2008 at 1:30 PM, Daren Tan <[EMAIL PROTECTED]> wrote: > > I am generating a report containing several R scripts in the appendix. Is >

Re: [R] Reading Multi-value data fields for descriptive analysis

2008-07-13 Thread Hohm, Dale
the error. Also, if you were willing to provide some brief annotation or describe the overall logic in the code you supplied it would help me immensely. Thanks, Dale -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Sunday, July 13, 2008 6:35 AM To: Hohm, Dale Cc

Re: [R] Reading Multi-value data fields for descriptive analysis

2008-07-12 Thread Hohm, Dale
icken|Softball;#Heavens to Murgatroyd! Exit stage left! Thanks in advance, Dale -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Saturday, July 12, 2008 11:32 AM To: Hohm, Dale Cc: r-help@r-project.org Subject: Re: [R] Reading Multi-value data fields for descriptive a

[R] Reading Multi-value data fields for descriptive analysis (resend)

2008-07-12 Thread Hohm, Dale
1 C3 Other Text: a free-form answer I am uncertain help to read this data into R in this format, so suggestions and examples would help me greatly. This is a pretty common data packing scenario, so perhaps there are better approaches to reading this data and better ways in R to analyze it tha

[R] Reading Multi-value data fields for descriptive analysis

2008-07-12 Thread Hohm, Dale
uggestions and examples would help me greatly. This is a pretty common data packing scenario, so perhaps there are better approaches to reading this data and better ways in R to analyze it than what I have presented. Suggestions greatly appreciated.

Re: [R] Configuring emacs/ess on Ubuntu

2008-05-25 Thread Dale Steele
$ sudo apt-get install Installs installs ESS version 5.3.0. Is there a repository for more recent version? Thanks. --Dale On Sun, May 25, 2008 at 11:24 AM, Roland Rau <[EMAIL PROTECTED]> wrote: > Hi Wade, > > Wade Wall wrote: >> >> Hi all, >> >> I do

Re: [R] Finding Interaction and main effects contrasts for two-wayANOVA

2008-03-08 Thread Dale Steele
st(fit, "material", rbind("(1 - 2)" =c(1, -1, 0) )) Estimate Std. Error t value Pr(>|t|) material(1 - 2) -21 18.37407 -1.142915 0.2631074 > fit.contrast(fit, "temp", rbind("50 - 80" =c(1, 0, -1) )) Estimate Std. Error

[R] Finding Interaction and main effects contrasts for two-way ANOVA

2008-03-06 Thread Dale Steele
he results from appended SAS code. Thanks. --Dale. ## the dataset (from Montgomery) twoway <- read.table("http://dsteele.veryspeedy.net/sta501/twoway.txt";, col.names=c('material', 'temp','voltage'),colClasses=c('factor', 'factor'

Re: [R] help.start() on linux (fedora 8) when firefox alreading running - a way to open a new tab?

2008-03-03 Thread Dale Steele
Thanks. I found the issue. I was starting R in a terminal with the command 'sudo R', help.start() was not able to communicate Firefox when already running. Works fine when R is started as user. --Dale On Mon, Mar 3, 2008 at 3:09 PM, Marc Schwartz <[EMAIL PROTECTED]> wrote: &g

[R] help.start() on linux (fedora 8) when firefox alreading running - a way to open a new tab?

2008-03-02 Thread Dale Steele
Using linux fedora 8 (x86_64) I get the following when firefox is already running. Is there a way to adjust settings in either R or firefox to open a new tab when help.start() is invoked? Thanks. --Dale > help.start() Making links in per-session dir ... If '/usr/bin/firefox' is al

[R] problem applying a conditional formula to each element of a matrix

2007-12-12 Thread Dale Steele
I'm applying a function (Cov.f) defined below to each element of a distance matrix. When I run the code below, I get a warning message (below) and elements of returned matrix [2,3] and [3,2] are not zero as I would expect. Clearly, there is an error... What am I doing wrong? Thanks. -

[R] Function to find boundary of an irregular sample?

2007-12-02 Thread Dale Steele
polygon? library(SemiPar) data(scallop) plot(scallop$longitude, scallop$latitude) Thanks. --Dale __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] R as a programming language

2007-11-07 Thread Dale Steele
I'm anxiously awaiting my copy of the soon to be published "A First Course in Statistical Programming with R" by W. John Braun University of Western Ontario Duncan J. Murdoch University of Western Ontario Paperback (ISBN-13: 9780521694247) http://www.cambridge.org/catalogue/catalogue.asp?isbn=9

[R] reason for error in small function?

2007-10-11 Thread Dale Steele
Running the function below, tested using the cardiff dataset from splancs generates the following error. What changes do I need to make to get the function to work? Thanks. --Dale > gen.rpoints(events, poly, 99) > rpoints Error: object "rpoints" not found # test spatial data

[R] Speeding up simulation of mean nearest neighbor distances

2007-10-03 Thread Dale Steele
hanks. --Dale library(spatstat) sim.nth.mdist <- function(nth,nsim) { D <- matrix(ncol=nth, nrow=nsim) for (i in 1:nsim) { rpp <- runifpoint(22, win=owin(c(0,1),c(0,1)), giveup=1000) for (k in 1:nth) D[i,k] <- mean(nndist(rpp ,k=k)) } D } si