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

2015-02-19 Thread Charles Berry
Aron Lindberg aron.lindberg at 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/

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

2014-09-28 Thread Charles Berry
Andras Farkas motyocska at 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 alaw005 at 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

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

2014-08-04 Thread Charles Berry
Spencer Graves spencer.graves at 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

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

2014-07-22 Thread Charles Berry
Scherber, Christoph cscherb1 at 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

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

2014-07-22 Thread Charles Berry
Charles Berry ccberry at ucsd.edu writes: Scherber, Christoph cscherb1 at 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: ggen.preds - sapply( levels(multicats

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

2014-06-18 Thread Charles Berry
Adam Hayward a.hayward at 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.

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

2014-06-16 Thread Charles Berry
peter dalgaard pdalgd at gmail.com writes: On 16 Jun 2014, at 05:22 , array chip arrayprofile at 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

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

2014-06-02 Thread Charles Berry
Kevin Wright kw.stat at 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

Re: [R] A combinatorial assignment problem

2014-05-01 Thread Charles Berry
Ravi Varadhan ravi.varadhan at 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

Re: [R] A combinatorial assignment problem

2014-05-01 Thread Charles Berry
Ravi Varadhan ravi.varadhan at 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

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Bert Gunter gunter.berton at 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

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Charles Berry ccberry at ucsd.edu writes: Bert Gunter gunter.berton at 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(error = recover) [rest deleted

Re: [R] Bug in predict.lm?

2013-11-15 Thread Charles Berry
Rolf Turner r.turner at 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.

Re: [R] Custom Numeric type in R

2013-11-10 Thread Charles Berry
Christofer Bogaso bogaso.christofer at 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,

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

2013-08-24 Thread Charles Berry
Jim Lemon jim at 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 to

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

2013-05-04 Thread Charles Berry
David Romano dromano at 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

Re: [R] matrix of size 30^5

2013-04-21 Thread Charles Berry
Benjamin Caldwell btcaldwell at 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],

Re: [R] How to delete Identical columns

2013-03-28 Thread Charles Berry
Katherine Gobin katherine_gobin at 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

Re: [R] How to delete Identical columns

2013-03-28 Thread Charles Berry
Charles Berry ccberry at ucsd.edu writes: [snip] Katherine Gobin katherine_gobin at 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). See ?unique

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

2013-03-27 Thread Charles Berry
Mark Orr mo2259 at 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 -

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

2013-03-20 Thread Charles Berry
Thomas Alexander Gerds tag at 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

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

2013-03-18 Thread Charles Berry
Ben Bolker bbolker at 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

Re: [R] melt with complications

2013-03-18 Thread Charles Berry
Richard M. Heiberger rmh at 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

[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:

Re: [R] ADCP data processing in R

2013-03-13 Thread Charles Berry
Janesh Devkota janesh.devkota at 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

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

2012-06-16 Thread Charles Berry
zoeita zoe-allcock at 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

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

2012-05-03 Thread Charles Berry
carol white wht_crl at 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

Re: [R] process id of an R script

2011-09-07 Thread Charles Berry
Mikkel Grum mi2kelgrum at 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

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

2010-07-05 Thread Charles Berry
Charles C. Berry cberry at 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 0.21 5