Re: [R] Subsetting a list of lists using lapply

2015-02-19 Thread Charles Berry
Aron Lindberg case.edu> writes: > > Hi Everyone, > > I'm working on a thorny subsetting problem involving list of lists. I've put > a dput of the data here: > > https://gist.githubusercontent.com/aronlindberg/b916dee897d051ac5be5/ raw/a78cbf873a7e865c3173f943ff6309ea688c653b/dput >

Re: [R] help with splitting parts of data frame

2014-09-28 Thread Charles Berry
Andras Farkas yahoo.com> writes: > > Dear All, > > please help with the following if you can: > [snip details] > > > first24 <-sum(unlist(c(subset(df, df[, 'simt'] > 0 & df[, 'simt'] <= > z[1], 3 > second24 <-sum(unlist(c(subset(df, df[, 'simt'] > z[1] & df[, 'simt'] <= > z[2], 3))

Re: [R] Bus stop sequence matching problem

2014-08-30 Thread Charles Berry
Adam Lawrence gmail.com> writes: > > I am hoping someone can help me with a bus stop sequencing problem in R, > where I need to match counts of people getting on and off a bus to the > correct stop in the bus route stop sequence. I have tried looking > online/forums for sequence matching but see

Re: [R] Normal probability plot examples for Wikipedia (was "qqnorm with histogram?")

2014-08-04 Thread Charles Berry
Spencer Graves structuremonitoring.com> writes: > > Hi, Jim et al.: > >Thanks for the reply, Jim. > >What are your favorite examples using normal probability plots to > identify outliers, skewness, kurtosis, mixtures, and the need for > transformations in plots of raw data an

Re: [R] Expressing a multinomial GLM as a series of binomial GLMs

2014-07-22 Thread Charles Berry
Charles Berry ucsd.edu> writes: > > Scherber, Christoph gwdg.de> writes: > > > > > Dear all, > > > > I am trying to express a multinomial GLM (using nnet) as a series of GLM > models. [deleted] > > Doing the obvious comparison: &g

Re: [R] Expressing a multinomial GLM as a series of binomial GLMs

2014-07-22 Thread Charles Berry
Scherber, Christoph gwdg.de> writes: > > Dear all, > > I am trying to express a multinomial GLM (using nnet) as a series of GLM models. > > However, when I compare the multinom() predictions to those from GLM, I see differences that I can´t > explain. Can anyone help me out here? > > Here com

Re: [R] Publication-ready figures with two plots

2014-06-18 Thread Charles Berry
Adam Hayward sheffield.ac.uk> writes: > > Hi all, > > I have quite a specific problem with producing 300ppi plots in tiff format > for publication. I have found ggsave to work beautifully with a single > plot, which can then be exported to GIMP to compress the resulting large > tiff file. Howev

Re: [R] prediction based on conditional logistic regression clogit

2014-06-16 Thread Charles Berry
peter dalgaard gmail.com> writes: > > > On 16 Jun 2014, at 05:22 , array chip yahoo.com> wrote: > > > Hi, I am using clogit() from survival package to do conditional > > logistic regression. I also need to make prediction on an > > independent dataset to calculate predicted probability. Here

Re: [R] Skipping .Rd files and using Org-mode instead?

2014-06-02 Thread Charles Berry
Kevin Wright gmail.com> writes: > > Have you tried the roxygen2 package? > I have. org-mode + roxygen2 + inline is what was used to make this package: http://www.bioconductor.org/packages/release/bioc/html/geneRxCluster.html Everything from the DESCRIPTION file to the C-code to the vignette

Re: [R] A combinatorial assignment problem

2014-05-01 Thread Charles Berry
Ravi Varadhan jhu.edu> writes: > > Thanks, Bert. > I have written this simple code, which is crude, but seems to do a decent job. It works perfectly when M is a > factor of R. Otherwise, it gives decent balance (of course, balance is not guaranteed). I guess it is > possible to take the res

Re: [R] A combinatorial assignment problem

2014-05-01 Thread Charles Berry
Ravi Varadhan jhu.edu> writes: > > Hi, > > I have this problem: K candidates apply for a job. There are R referees available to review their resumes and > provide feedback. Suppose that we would like M referees to review each candidate (M < R). How would I assign > candidates to referees (o

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Rolf Turner auckland.ac.nz> writes: > > > I *do* see the same phenomenon that Bert describes and the code of > predict.lm() > *does* appear to contain a bug. There is a line: > [snip] > > The operative difference between my set-up and Chuck's is that I am using > version 3.0.2 Patched. So

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Charles Berry ucsd.edu> writes: > > Bert Gunter gene.com> writes: > [snip] > > I do not see this (see below). > > Maybe traceback() or options(recover=browser) to get > to the bottom?? Argh! I meant: options(err

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Bert Gunter gene.com> writes: > > Yes, I realize that it is more likely a misunderstanding on my part. > Suitable humility will be tendered if this is pointed out. > > The claimed "bug" is that predict.lm throws an error when the scale > argument is specified with interval = "conf" (and in som

Re: [R] Custom Numeric type in R

2013-11-10 Thread Charles Berry
Christofer Bogaso gmail.com> writes: > > Hi again, > > In R, there are various numerics like, NA, Inf, or simple integers etc. > However I want to include one custom type: "TBD", which R should treat as > numeric, not character. > > That "TBD" should have same property like Inf, however except

Re: [R] lags of a variable, with a factor

2013-08-24 Thread Charles Berry
Jim Lemon bitwrit.com.au> writes: > > On 08/24/2013 04:16 AM, Michael Friendly wrote: > > For sequential analysis of sequences of events, I want to calculate a > > series of lagged > > versions of a (numeric or character) variable. The simple function below > > does this, > > but I can't see how

Re: [R] how to parallelize 'apply' across multiple cores on a Mac

2013-05-04 Thread Charles Berry
David Romano stanford.edu> writes: > > Hi everyone, > > I'm trying to use apply (with a call to zoo's rollapply within) on the > columns of a 1.5Kx165K matrix, and I'd like to make use of the other cores > on my machine to speed it up. (And hopefully also leave more memory free: I > find that a

Re: [R] matrix of size 30^5

2013-04-21 Thread Charles Berry
Benjamin Caldwell berkeley.edu> writes: > > Dear R helpers > > Reproducible example: > > #warning - this causes a hard freeze on the machines I've tried it on > matrix.holder<- matrix(rnorm(150), nrow=30, ncol=5) > > Out= > expand.grid(matrix.holder[,1],matrix.holder[,2],matrix.holder[,3], ma

Re: [R] How to delete Identical columns

2013-03-28 Thread Charles Berry
Charles Berry ucsd.edu> writes: [snip] > > Katherine Gobin yahoo.com> writes: > > How to automatically identify and retain only one column (in this example > column x) among the identical > > columns besides other non-identical columns (viz. id, y and z). > &g

Re: [R] How to delete Identical columns

2013-03-28 Thread Charles Berry
Katherine Gobin yahoo.com> writes: > > Dear R forum > > Suppose I have a data.frame > Say. [snip] > How to automatically identify and retain only one column (in this example column x) among the identical > columns besides other non-identical columns (viz. id, y and z). See ?unique Det

Re: [R] Passing arguments between apply and l(s)apply functions vs. nested for loop

2013-03-27 Thread Charles Berry
Mark Orr columbia.edu> writes: > > Hi R community, > I have a question concerning passing arguments between apply and lapply? [snip] > > #START CODE SNIPPET > > #LIST AND VECTOR > rm(list=ls()) > l <- list(1:3,2:3,4:10,7:9) > v <- 1:3 > > #USED IN j loop to catch values > catch.mat <- matrix

Re: [R] behaviour of formula objects and environment inside functions

2013-03-20 Thread Charles Berry
Thomas Alexander Gerds biostat.ku.dk> writes: > > Dear List > > I am looking for the recommended way to create a formula inside a > function with an empty environment. I tried several versions (see > below), and one of them seemed to work, but I dont understand why there > is a difference betwe

Re: [R] melt with complications

2013-03-18 Thread Charles Berry
Richard M. Heiberger temple.edu> writes: > > ## Can someone suggest a simpler expression than either of these, with the > goal > ## of taking a long matrix into a wide one with exactly one of the factors > converted to > ## columns and all the rest retained as factors. I want something that > g

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Charles Berry
Ben Bolker gmail.com> writes: > Maybe FAQ 7.31 was referred to not for its direct relevance but as > a measure of the "old-hand-ness" of the people who will get the joke. !1i|!0 Chuck __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] !0 + !0 == !0 - !0

2013-03-17 Thread Charles Berry
Hi all, The subject line is TRUE. Today I accidentally typed rnorm(!0). My old eyes took a minute to focus clearly enough to see what I really typed and why I got '!0' random numbers instead of '10' random normal numbers. If the subject line is disturbing, be assured that this is TRUE: !0^2

Re: [R] ADCP data processing in R

2013-03-13 Thread Charles Berry
Janesh Devkota gmail.com> writes: > > Hello R Users, > > I have ADCP (Acoustic Doppler Current Profiler) data measurements for a > river and I want to process these data using R. Is there a R package to > handle ADCP data ? Any suggestions are highly appreciated. > Google 'acoustic data cur

Re: [R] Plotting tidal speed and direction in R

2012-06-16 Thread Charles Berry
zoeita live.co.uk> writes: > > Hi, > > I have had a look around the forums and I can't seem to find anything that > works with my data. I have lats, longs, time, tidal speed and direction and > need to plot this in an xy plot to determine changes over time. contour and > cloud have been recomm

Re: [R] warning with glm.predict, wrong number of data rows

2012-05-03 Thread Charles Berry
carol white yahoo.com> writes: > > Hi, > I split a data set into two partitions (80 and 42), use the first as the training set in glm and the second as > testing set in glm predict. But when I call glm.predict, I get the warning message:  > > Warning message: > 'newdata' had 42 rows but variabl

Re: [R] process id of an R script

2011-09-07 Thread Charles Berry
Mikkel Grum yahoo.com> writes: > > I have a script that runs as a cron job every minute (on Ubuntu 10.10 and R 2.11.1), querying a database for new > data. Most of the time it takes a few seconds to run, but once in while it takes more than a minute and the next > run starts (on the same data) b

Re: [R] To detect the location of duplicate values

2010-07-05 Thread Charles Berry
Charles C. Berry tajo.ucsd.edu> writes: > > On Mon, 5 Jul 2010, Moohwan Kim wrote: > > > Dear R family, > > > > I have a question about how to detect some duplicate numeric observations. > > Suppose that I have two variables dataset. > > > > order value > > 1 0.52 > > 2 0.23 > > 3 0.43 > > 4