[R] specific package to laply

2015-05-14 Thread Benjamin
fun(obj, substitute(ex), parent.frame(), e$data) : worker initialization failed: there is no package called ‘rvest’ Calls: %dopar% -> Presumably, I need a way to export my .libPaths() to the nodes. Any suggestions? Thanks, Benjamin [[alternative HTML version deleted]] _

[R] party package: is cforest really bagging?

2015-12-15 Thread Benjamin
Hi all, I'm using the "party" package to create random forest of regression trees. I've created a ForestControl class in order to limit my number of trees (ntree), of nodes (maxdepth) and of variables I use to fit a tree (mtry). One thing I'm not sure of is if the cforest algo is using subsets of

Re: [R] Package random forest: can corr.bias be harmful?

2013-06-21 Thread Benjamin
Hi, Christian. It sounds like to the maintainer feels that the package needs improvements, i.e., it may not function as expected. However, you may contact him directly using maintainer("randomForest"). Best, Benjamin On Fri, Jun 21, 2013 at 9:36 AM, Christian Kampichler < chri

[R] read.table(..., header == FALSE, colClasses = )

2017-10-23 Thread Benjamin Tyner
Hello I noticed that starting with R version 3.3.0 onward, this generates a warning:    > txt <- c("a", "3.14")    > read.table(file = textConnection(txt), header = FALSE, colClasses = c(x = "character", y = "numeric")) the warning is "not all columns named in 'colClasses' exist" and I gues

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Benjamin Tyner
Jeff, Thank you for your reply. The intent was to construct a minimum reproducible example. The same warning occurs when the 'file' argument points to a file on disk with a million lines. But you are correct, my example was slightly malformed and in fact gives an error under R version 3.2.2.

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Benjamin Tyner
, colClasses = c(y = "character", x = "numeric"), col.names = c("foo", "bar"))      foo  bar    1   a 3.14 so I agree it is good that we are checking for that now. Regards Ben On 10/24/2017 08:55 AM, Martin Maechler wrote: Benjamin Tyner

[R] trying to find the multiple combinations...

2017-12-07 Thread Benjamin Sabatini
Hi, I'm trying to find a way to determine what multiples of the combination of three or more numbers equals a forth number. So, if I had a number set like: c(13.4689, 12.85212, 17.05071) What combination and multiples of these numbers would average to 15.0078? (so, something that would tell m

[R] setSessionLimit

2018-01-19 Thread Benjamin Tyner
Hello The doc/NEWS.2 file mentions a setSessionLimit function, added with version 2.8.0     o   setTimeLimit() function to set limits on the CPU     and/or elapsed time for each top-level computation, and     setSessionLimit() to set limits for the rest of the session. However, I no l

[R] rJava garbage collect

2018-02-05 Thread Benjamin Tyner
Hi Does rJava offer a way to instruct the JVM to perform a garbage collection? Regards Ben __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] rJava garbage collect

2018-02-06 Thread Benjamin Tyner
Thanks Jeff; indeed it works:    .jcall("java/lang/System", method = "gc") On 02/05/2018 11:53 PM, Jeff Newmiller wrote: rJava offers a mechanism to call arbitrary methods in Java. Wouldn't you use that mechanism to call whatever you would call if you were programming in Java (e.g. System.gc

Re: [R] rJava garbage collect

2018-02-06 Thread Benjamin Tyner
esolve the issue. Regards Ben On 6 February 2018 at 04:34, Benjamin Tyner https://stat.ethz.ch/mailman/listinfo/r-help>> wrote: >/Hi />//>/Does rJava offer a way to instruct the JVM to perform a garbage col

[R] system() or pipe(..., open = "r") without child process?

2018-05-22 Thread Benjamin Tyner
Greetings On linux, is it possible to invoke an OS command from within R without spawning a child process? If not, is it possible to avoid copying the "parts of the caller's context" that are mentioned on the clone manpage?  ENOMEM Cannot  allocate  sufficient memory to allocate a task struct

Re: [R] Efficient manipulation with list object

2018-06-10 Thread Benjamin Christoffersen
You may be able to speed it up further by using `data.table`'s `rbindlist` or a similar function as shown here https://stackoverflow.com/a/49772719/5861244. 2018-06-10 21:20 GMT+02:00 Christofer Bogaso : > Using do.call() reduces my calculation time significantly. > > On Sun, Jun 10, 2018 at 10:45

[R] undo compile? (or: remove bytecode from closure)

2018-07-15 Thread Benjamin Tyner
Hi Given a closure which has been compiled, what's the recommended way to recover the original? For example,     > f <- function(x) x+1     > fc <- cmpfun(f)     > rm(f)     > fc     function(x) x+1     what's the best way to recover f from fc ? Regards Ben ___

Re: [R] undo compile? (or: remove bytecode from closure)

2018-07-16 Thread Benjamin Tyner
pe this helps, Rui Barradas Às 03:25 de 16-07-2018, Benjamin Tyner escreveu: Hi Given a closure which has been compiled, what's the recommended way to recover the original? For example,       > f <- function(x) x+1       > fc <- cmpfun(f)       > rm(f)       > fc       funct

[R] Unknown anomaly

2017-04-18 Thread Benjamin Robira
ues had an answer. I hope that you would be able to help me fix that as it must be a pretty straightforward error that I do not realise. I would be thankful for any help, With my very Best Regards, Benjamin. __ R-help@r-project.org mailing list --

[R] plot command error message

2017-06-04 Thread Benjamin Gföhler
I tried to plot a clustered linear regression model with the cplot command in R (code below). Leaflet is a binary variable (I know logit would be better), partisan is nummeric variable (0-4) and partisan_mis a dummy (0,1). As you can see it is clustered around two variables: around individuals

[R] Svyglm Error

2017-07-05 Thread Courtney Benjamin
a.action=na.omit) summary(Othpared)? Any help in resolving this concern would be greatly appreciated. Sincerely, Courtney Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of Ne

Re: [R] Svyglm Error

2017-07-05 Thread Courtney Benjamin
?Problem solved; I did not have the most updated version of R. When I updated it and ran the code, all worked well again. Thanks very much for helping me solve the mistake of an R novice! Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota

[R] Creating New Variable Using Ifelse

2017-08-09 Thread Courtney Benjamin
oach at trying to handle the NAs properly-returns an error elsq2wbl$NONWBLRELJOB <- ifelse(elsq2wbl$PSWBL=="No" & elsq2wbl$EVERRELJOB=="Yes",1,ifelse(is.na(elsq2wbl$PSWBL)&is.na(elsq2wbl$EVERRELJOB),NA, ifelse(elsq2wbl$PSWBL!="No" & elsq2wbl$EVER

Re: [R] Creating New Variable Using Ifelse

2017-08-10 Thread Courtney Benjamin
Thanks very much; with your tips, I was able to get the nested ifelse statement to work properly! Courtney Benjamin From: PIKAL Petr Sent: Thursday, August 10, 2017 5:39 AM To: Courtney Benjamin; r-help@r-project.org Subject: RE: Creating New Variable

[R] How to Display Value Labels in R Outputs?

2016-07-28 Thread Courtney Benjamin
(file="els-Q1-04-21-16.dat", header = TRUE, sep = "\t", quote = "\"", dec =".") or I am not specifying some detail that is required to manually assign labels to the values of the variables.? Courtney Benjamin Broome-Tioga BOCES Automotiv

[R] commercial license

2016-09-12 Thread benjamin . stocker
Dear r-project Team How does It cost a commercial license for the R Console and the R-comander GUI without the Rstudio enviroment. Thanks for helping me. Freundliche Gr�sse/Kind regards Benjamin Stocker Reporting/Controlling MBC Mercedes-Benz Schweiz AG Bernstrasse 55 8952 Schlieren

[R] Svyglm Error in Survey Package

2016-09-23 Thread Courtney Benjamin
TRL==1 & G10COHRT==1) dim(samp1) mc1 <- svyglm(F3ATTAINMENT~F1SES2QU+F1RGPP2,elsq1ch_brr,subset=samp1,na.action) summary(mc1)? Both attempts resulted in the same error stated above. Any advisement in how to resolve this error would be greatly appreciated. Sincerely, Courtney Benjamin ?

Re: [R] Svyglm Error in Survey Package

2016-09-25 Thread Courtney Benjamin
To: Courtney Benjamin Cc: r-help@r-project.org Subject: RE: Svyglm Error in Survey Package Dear Courtney, You're confusing a function call, na.action(na.omit), with an argument specification, na.action=na.omit (and, in any event, there is no na.action() function). But you don't have

Re: [R] non-terminal token lacking children from utils::getParseData

2015-05-02 Thread Benjamin Tyner
Thank you Yihui for also reporting the bug here: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16354 and thank you Duncan for finding the issue and fixing it! I definitely like your idea to report a summary message instead of the long text string. Regards Ben > I tried to reduce the offen

[R] package implementing continuous binomial?

2015-05-06 Thread Benjamin Tyner
Hi I'm wondering if anyone is aware of an R package implementing (i.e., providing a pdf, cdf, and/or quantile function) for the continuous binomial distribution? Specifically the one characterized here: http://www2.math.uni-paderborn.de/fileadmin/Mathematik/AG-Indlekofer/Workshop/Satellite_meetin

Re: [R] package implementing continuous binomial?

2015-05-07 Thread Benjamin Tyner
Thanks David! I'll take a look at zipfR. Regards Ben On 05/07/2015 03:10 PM, David Winsemius wrote: > On May 6, 2015, at 7:00 PM, Benjamin Tyner wrote: > >> Hi >> >> I'm wondering if anyone is aware of an R package implementing (i.e., >> providing a pdf

[R] Scatterplot : smoothing colors according to density of points

2015-06-02 Thread Benjamin Dubreuil
Hello everyone, I have a data frame D with 4 columns id,X,Y,C. I want to plot a simple scatter plot of D$X vs. D$Y and using D$C values as a color. (id is just a text string not used for the plot) But actually, I don't want to use the raw values of D$C, I would prefer to calculate the average v

[R] Rprof and system

2015-08-11 Thread Benjamin Tyner
Hi I have an R script which invokes WriteXLS() (from the package of the same name) which as you may know, calls perl via system(). I've noticed that when I enable profiling using Rprof(), when the script gets to the part where perl is called, it gets "stuck": it just sits there using 99-100% CPU a

Re: [R] non-terminal token lacking children from utils::getParseData

2015-02-19 Thread Benjamin Tyner
I tried to reduce the offending portion as best I could to a more-or-less minimal example (1136 bytes), which can be downloaded via: wget https://www.dropbox.com/s/74rgxr5x2aalr99/badstring.R then once in R, > b <- parse(file = "~/badstring.R", keep.source = TRUE) > d <- getParseData

Re: [R] mboost: Proportional odds boosting model - how to specify the offset?

2015-03-20 Thread Benjamin Hofner
). More details are given in the example below. Best, Benjamin [1] http://r-forge.r-project.org/projects/mboost/ Example code library(MASS) library(mboost) data(iris) iris$Species <- factor(iris$Species, ordered = T) p.iris <- polr(Species ~ Sepal.Length, data = iris) p.ir

[R] Having trouble with gdata read in

2015-03-25 Thread Benjamin Baker
I can find some “solutions” for read.table, but nothing specific to read.xls Many thanks, Benjamin Baker — Sent from Mailbox [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, se

Re: [R] Having trouble with gdata read in

2015-03-27 Thread Benjamin Baker
t;- tempfile() > ami <- " > http://www.ferc.gov/industries/electric/indus-act/demand-response/2008/survey/ami_survey_responses.xls > " > download.file( ami , tf , mode = 'wb' ) > ami.data2008 <- read.xlsx( tf , sheetIndex = 1 ) > On Wed, Mar 25, 2015 at 5:0

Re: [R] Having trouble with gdata read in

2015-03-27 Thread Benjamin Baker
: num 0 0 0 155 0 0 0 0 0 0 ... > $ Q8.Hourly.ResAMI : num 0 NA NA NA 16100 NA NA NA NA > NA ... > $ Q8.Hourly.ComAMI : num 0 NA NA NA 1600 NA NA NA NA > NA ... > > Jim Holtman > Data Munger Guru > What is the proble

Re: [R] Having trouble with gdata read in

2015-03-27 Thread Benjamin Baker
y.ComAMI                     : num  0 NA NA NA 1600 NA NA NA NA NA ... Jim Holtman Data Munger Guru   What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 25, 2015 at 5:01 PM, Benjamin Baker wrote: Trying to rea

[R] lattice: packet.number() versus panel.number()

2014-08-26 Thread Benjamin Tyner
Hi, According to https://svn.r-project.org/R-packages/trunk/lattice/R/print.trellis.R, "[panel.number] is usually the same as, but can be different from packet.number" and I had been under the impression that as long as the user is not using a custom index.cond nor perm.cond, the panel.numbe

Re: [R] lattice: packet.number() versus panel.number()

2014-08-27 Thread Benjamin Tyner
On 08/27/2014 02:10 AM, David Winsemius wrote: > On Aug 26, 2014, at 3:25 PM, Benjamin Tyner wrote: > >> Hi, >> >> According to >> https://svn.r-project.org/R-packages/trunk/lattice/R/print.trellis.R, >> >>"[panel.number] is usually the same as, bu

[R] from cut.Date

2014-09-17 Thread Benjamin Tyner
Hello, I'm wondering if this is expected? > cut(structure(1, class="Date"), structure(c(11100,1), class="Date")) [1] Levels: 2000-05-23 The help page says that "for ‘"Date"’ objects, only ‘"day"’, ‘"week"’, ‘"month"’, ‘"quarter"’ and ‘"year"’ are allowed" [for the 'breaks' a

Re: [R] from cut.Date

2014-09-17 Thread Benjamin Tyner
t; args(cut.Date) function (x, breaks, labels = NULL, start.on.monday = TRUE, right = FALSE, ...) I suppose the latter does make sense, given that days, months, years etc are right-continuous functions of time. Regards Ben > On 17/09/2014 12:04, Benjamin Tyner wrote: > >/ Hello, > />/

[R] scaling of Amat still recommended for quadprog::solve.QP ?

2014-09-25 Thread Benjamin Tyner
Greetings, I ran across this recommendation, to keep the norms of the columns of the Amat on similar scales, https://stat.ethz.ch/pipermail/r-help/2007-September/141335.html However, when I looked at the code, I noticed that the norms are already being calculated: c c calculate the

[R] quadprog::solve.QP sometimes returns NaNs

2014-09-26 Thread Benjamin Tyner
Hello, Here is an example; hopefully it is reproducible on others' platform: library(quadprog) n <- 66L set.seed(6860) X <- matrix(1e-20, n, n) diag(X) <- 1 Dmat <- crossprod(X) y <- seq_len(n) dvec <- crossprod(X, y) Amat <- diag(n) bvec <- y + runif(n)

[R] backsolve, chol, Matrix, and SparseM

2015-09-24 Thread Benjamin Tyner
Hi I have some code which does (on a symmetric matrix 'x') backsolve(chol(x), diag(nrow(x))) and I am wondering what is the recommended way to accomplish this when x is also sparse (from package:Matrix). I know that package:Matrix provides a chol method for such matrices, but not a backsolve

Re: [R] backsolve, chol, Matrix, and SparseM

2015-09-25 Thread Benjamin Tyner
path in the first place. By the way, is R-forge still the correct place to report bugs in package:Matrix? Regards Ben On 09/25/2015 04:25 AM, Martin Maechler wrote: > Dear Ben, > >>>>>> Benjamin Tyner >>>>>> on Thu, 24 Sep 2015 13:47:58 -0400 writes:

[R] efficiently multiply each column of a sparse Matrix by a sparse vector

2015-11-28 Thread Benjamin Tyner
Hi, Say I have a sparse Matrix X, and a sparse vector (stored as a 1-column sparse Matrix A), with X and A having the same number of rows, and I wish to multiply each column of X by A, but would like the operation to take full advantage of the sparseness of both X and A. In other words I want

[R] choropleth packages (US)

2015-12-06 Thread Benjamin Tyner
Hi I wish to draw a basic choropleth (US, by state) and am wondering if anyone has any recommendations? I've tried the following thus far: 1. choroplethr: this works, but required installation of 30+ dependencies. I would prefer something with fewer dependencies. 2. tmap: this also seems prom

Re: [R] choropleth packages (US)

2015-12-10 Thread Benjamin Tyner
ec 7, 2015 at 9:34 AM, Erich Neuwirth wrote: ggplot2 also can do this with fortify geom_polygon Von meinem iPad gesendet Am 06.12.2015 um 21:03 schrieb Benjamin Tyner : Hi I wish to draw a basic choropleth (US, by state) and am wondering if anyone has any recommendations? I've t

[R] R_DirtyImage and Rprof

2016-05-11 Thread Benjamin Tyner
Hello, I have some code which was running in interactive mode while Rprof(..., line.profiling = TRUE). Near the end of my script, it opens up a pipe(..., open = "w") to a perl script, and at that point the execution gets stuck using 100% cpu. (The perl script itself never showed up in pstree

[R] Significance of Svyrepdesign Object Warning

2016-10-23 Thread Courtney Benjamin
es.1252 #attached base packages: # [1] grid stats graphics grDevices utils datasets methods base #other attached packages: #[1] survey_3.31-2 survival_2.39-4 Matrix_1.2-6RCurl_1.95-4.8 bitops_1.0-6 #loaded via a namespace (and not attached): #[1] tools_3.3.1 splines

Re: [R] Significance of Svyrepdesign Object Warning

2016-10-23 Thread Courtney Benjamin
el of two of my predictor variables (BYINCOME & F1HIMATH) were changed. Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenj...@btboces.org<mailto

Re: [R] Significance of Svyrepdesign Object Warning

2016-10-27 Thread Courtney Benjamin
") elsq1ch_brr #Logistic regression call which yields a warning regarding svyrepdesign object allCC <-svyglm(formula=F3ATTAINB~F1PARED+BYINCOME+F1RACE+F1SEX+F1RGPP2+F1HIMATH+F1RTRCC,family="binomial",design=elsq1ch_brr,subset=BYSCTRL==1&G10COHRT==1,na.action=na.exclude) summar

Re: [R] Significance of Svyrepdesign Object Warning

2016-10-27 Thread Courtney Benjamin
​Thank you; I will do so. Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenj...@btboces.org<mailto:cbenj...@btboces.org> 60

[R] Resetting Baseline Level of Predictor in svyglm Function

2016-10-31 Thread Courtney Benjamin
for the predictors allCC <- svyglm(formula=F3ATTAINB~F1PARED+BYINCOME+F1RACE+F1SEX+F1RGPP2+F1HIMATH+F1RTRCC,family="binomial",design=elsq1ch_brr,subset=BYSCTRL==1&G10COHRT==1,na.action=na.omit) summary(allCC) Any guidance is greatly appreciated.? Sincerely, Courtney? Courtney B

Re: [R] Resetting Baseline Level of Predictor in svyglm Function

2016-11-03 Thread Courtney Benjamin
Thank you, Anthony; it worked flawlessly.? Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenj...@btboces.org<mailto:cbenj...@btboces.org>

[R] Archer-Lemeshow Goodness of Fit Test for Survey Data with Log. Regression

2016-11-16 Thread Courtney Benjamin
naming/specifying the new variables of r and g properly transform(elsq1ch,r=r,g=g) elsq1ch_brr <- update(elsq1ch_brr,tag=g,tag=r) #then: decilemodel<- svyglm(r~g, design=newdesign) regTermTest(decilemodel, ~g) #is the F-adjusted mean residual test from the Archer Lemeshow paper Thank you, Courtney

Re: [R] Archer-Lemeshow Goodness of Fit Test for Survey Data with Log. Regression

2016-11-18 Thread Courtney Benjamin
indicate a poor model fit. Sincerely, Courtney Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenj...@btboces.org<mailto:cbenj...@btboces.or

Re: [R] Archer-Lemeshow Goodness of Fit Test for Survey Data with Log. Regression

2016-11-18 Thread Courtney Benjamin
​Thank you; I appreciate your advisement. Courtney Benjamin Broome-Tioga BOCES Automotive Technology II Teacher Located at Gault Toyota Doctoral Candidate-Educational Theory & Practice State University of New York at Binghamton cbenj...@btboces.org<mailto:cbenj...@btboces.org>

Re: [R] Archer-Lemeshow Goodness of Fit Test for Survey Data with Log. Regression

2016-11-18 Thread Courtney Benjamin
-svrepdesign(variables = elsq1ch, repweights = elsq1ch[,18:217], weights = elsq1ch[,17], combined.weights = TRUE, type = "BRR") decilemodel<- svyglm(r~your_g, design=newdesign,subset=BYSCTRL==1&G10COHRT==1) regTermTest(decilemodel, ~your_g) ​ ​ Courtney Benjamin Broome-

[R] Further Subsetting of Data for Log. Reg. Results in qr.default Error

2016-11-23 Thread Courtney Benjamin
is resulting in the qr.default error CTE <- svyglm(formula=F3ATTAINB~F1PARED+BYINCOME+F1RACE+F1SEX+F1RGPP2+F1HIMATH,family="binomial",design=elsq1ch_brr,subset=BYSCTRL==1&G10COHRT==1&F1RTRCC=="Academic",na.action=na.omit) summary(CTE) Courtney Benjamin Broome-Tioga

[R] Svyolr-Properly Specifying Start Values

2016-11-29 Thread Courtney Benjamin
[,1:16], repweights = elsq1ch[,18:217], weights = elsq1ch[,17], combined.weights = TRUE, type = "BRR") elsq1ch_brr allCColr <- svyolr(F3ATTAINMENT~F1PARED+BYINCOME+F1RACE+F1SEX+F1RGPP2+F1HIMATH+F1RTRCC,design=subset(elsq1ch_brr,BYSCTRL==1&G10COHRT==1),na.action=na.omit) ?

[R] modify the imported version of a function

2016-12-16 Thread Benjamin Tyner
Hi I saw on the assignInNamespace help page, that it changes "the copy in the namespace, but not any copies already exported from the namespace, in particular an object of that name in the package (if already attached) and any copies already imported into other namespaces." So now I'm wonder

Re: [R] modify the imported version of a function

2016-12-19 Thread Benjamin Tyner
= FALSE, dotall = FALSE, ...) { options <- stri_opts_regex(case_insensitive = ignore_case, multiline = multiline, comments = comments, dotall = dotall, ...) structure(pattern, options = options, class = c("regex", "patt

[R] file.exists() on device files

2017-01-11 Thread Benjamin Tyner
Hi, On my linux machine (Ubuntu, and also tested on RHEL), I am curious to know what might be causing file.exists (and also normalizePath) to not see the final device file here: > list.files("/dev/fd", full.names = TRUE) [1] "/dev/fd/0" "/dev/fd/1" "/dev/fd/2" "/dev/fd/3" > file.exis

Re: [R] [FORGED] file.exists() on device files

2017-01-13 Thread Benjamin Tyner
Thank you for the insights, Rolf and Henrik. To give another example, this time in non-interactive mode, Rscript -e "file.exists(commandArgs(TRUE))" <(echo "Hi") [1] TRUE versus Rscript -e "normalizePath(commandArgs(TRUE))" <(echo "Hi") [1] "/dev/fd/63" Warning message: In n

[R] flushing on.exit prior to q()

2017-02-21 Thread Benjamin Tyner
Hi, When using a custom error function that calls q(), what is the recommended way to "flush" the calling function's on.exit ? For example, say I have a script: #!/usr/bin/Rscript --no-init-file options(error = function() { cat("on error message\n", file = stderr()) q(sav

Re: [R] Simple... but...

2008-07-23 Thread Nutter, Benjamin
> x <- c(1,3,5) > y <- c(2,4,6) > xy <- sort(c(x,y)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 8:55 AM To: [EMAIL PROTECTED] Subject: [R] Simple... but... Hi R, If x=c(1,3,5) y=c(2,4,6)

Re: [R] Matrix barplot

2008-07-25 Thread Nutter, Benjamin
> data <- data.frame(Year=c(2000,2001,2002), A=c(4,2,1), B=c(3,1,2), C=c(0,3,5)) > data.mat <- as.matrix(data)[,2:4] > rownames(data.mat) <- data$Year > data.mat <- t(data.mat) > barplot(data.mat,beside=TRUE) -Original Message--

Re: [R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-28 Thread Nutter, Benjamin
e a way to change the axis bar in your code, so I suppressed the axis in the call to barplot, and manually replaced the axis using the axis function. I hope this works for you. Benjamin data <- data.frame(Year=c(2000,2001,2002), A=c(2,2,1), B=c(

[R] parent in Creating environment object

2008-08-01 Thread Benjamin Otto
() function influence the final environment. So: 1. Do I ALWAYS have to supply a parent during creation? 2. If yes, what would that be, when all I want is a conversion from a simple list? Best regards Benjamin == Benjamin Otto University Hospital Hamburg-Eppendorf

[R] Saving environment object

2008-08-15 Thread Benjamin Otto
: protect(): protection stack overflow Regards, benjamin == Benjamin Otto University Hospital Hamburg-Eppendorf Institute For Clinical Chemistry Martinistr. 52 D-20246 Hamburg Tel.: +49 40 42803 1908 Fax.: +49 40 42803 4971

Re: [R] Saving environment object

2008-08-15 Thread Benjamin Otto
Hi Erik, Yes this is what I was trying and your example or the one of luke is working fine with me. So now I'm not sure if this is due to an environment which takes too much space. The environment troubling me has 644276 entries. Is this too much? Benjamin -Ursprüngliche Nachricht

Re: [R] Saving environment object

2008-08-15 Thread Benjamin Otto
Hi Luke, hi all, You have been right guys, the hashing solved the problem. Thanks for your hard efforts. :) Best regards Benjamin -Ursprüngliche Nachricht- Von: Luke Tierney [mailto:[EMAIL PROTECTED] Gesendet: Friday, August 15, 2008 6:29 PM An: Prof Brian Ripley Cc: Benjamin Otto; R

[R] Generic attribute in multinom function

2009-08-11 Thread Benjamin Geckle
__ 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.

[R] Generic attribute in multinom function

2009-08-11 Thread Benjamin Geckle
-1.8 2 -3.36 0.4-1.8 32.10-0.5-1.8 Thanks. Best Regards Benjamin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] How can I do a generic specification in multiple logistic regression

2009-08-14 Thread Benjamin Geckle
: (Intercept)time costs 14.79-0.3-1.8 2 -3.36 0.4-1.8 32.10-0.5-1.8 Thank you for you help. Best Regards Benjamin __ R-help@r-project.org

[R] applying summary() to an object created with ols()

2009-08-21 Thread Benjamin Volland
r)..." Unfortunately no information seems to be available on lm.pfit. Does anyone know why the using that function leads to an abbreviated return list? Is there a trick to circumvent that? Thanks Benjamin Volland P.S. Currently using R-version 2.7.1 on a Windows PC.

[R] Problem with specifying variance-covariance matrix for random effects (nlme package)

2010-02-14 Thread Benjamin Cheah
Hi all, I've been struggling with trying to specify a diagnoal matrix for linear mixed effects model. I think I've got nearly everything correct, except the following message appears: In lme.formula(fixed = fwave ~ sex + sexXbulbar + visit + age + : Fewer observations than random effects in

Re: [R] all possible subsets, with AIC

2010-02-15 Thread Nutter, Benjamin
ls for all possible subsets of predictors in lm, glm, or coxph. If requested, it will also plot the R-squared, Adjusted R-squared, AIC, or BIC of those models (when the values are applicable to the model). It might give you a good starting point. Benjamin -Original Message- From: r-help

Re: [R] First. Last. Data row selection

2010-02-23 Thread Nutter, Benjamin
e attached are in no way my original work. Benjamin -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of wookie1976 Sent: Tuesday, February 23, 2010 12:40 PM To: r-help@r-project.org Subject: [R] First. Last. Data row selection I

[R] Circles around letters or numbers in plot title

2010-02-23 Thread Nutter, Benjamin
a circle in the margin? Benjamin Benjamin Nutter | Biostatistician | Quantitative Health Sciences Cleveland Clinic | 9500 Euclid Ave. | Cleveland, OH 44195 | (216) 445-1365 === P Please consider the environment before printing this e-mail C

Re: [R] counting the number of ones in a vector

2010-02-26 Thread Nutter, Benjamin
What you did works well. You could also try the following. table(x)["1"] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Randall Wrong Sent: Friday, February 26, 2010 9:41 AM To: r-help@r-project.org Subject: [R] counting the num

Re: [R] counting the number of ones in a vector

2010-02-26 Thread Nutter, Benjamin
But if x has any missing values: > x <- c(1, 1, 1, NA, NA, 2, 1, NA) > > sum( x == 1) [1] NA > > sum(x==1, na.rm=TRUE) [1] 4 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique Dallazuanna Sent: Friday, February 26, 2010

Re: [R] Row-wisely converting a data frame into a list

2010-03-02 Thread Nutter, Benjamin
> as.data.frame(t(df)) For example > x <- as.data.frame(t(mtcars)) > typeof(x) [1] "list" -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sebastian Bauer Sent: Tuesday, March 02, 2010 8:12 AM To: r-help@r-project.org Subject: [R]

Re: [R] Help on getting help from manuals

2010-03-12 Thread Nutter, Benjamin
quot;Introductory Statistics with R." It's a very small, basic introduction to R, but laid a solid enough foundation that I soon found myself able to produce and refine my own solutions. In short, the best way to improve our knowledge of R is lots of reading and a bit of trial and error.

[R] Retrieving latitude and longitude via Google Maps API

2010-03-16 Thread Nutter, Benjamin
gram, then loading the coordinates in R and merging them back into the data frame I want to use. It'd be nice to be able to do it all in one script, but I'm not comprehending the API thing very well. I'm using R 2.9.1 on Windows XP. Any suggestions or pointers? Benjam

Re: [R] mboost: Interpreting coefficients from glmboost if center=TRUE

2010-03-19 Thread Benjamin Hofner
rg/package=mboost) for possible help and/or to report bugs. HTH Benjamin Kyle Werner wrote: Thanks for your reply. In fact, I do use the predict method for model assessment, and it shows that centering leads to a substantial improvement using even the bluntest of assessments of 'goodness

[R] dump() an object of type raw ?

2009-07-21 Thread Benjamin Tyner
Is there a way to do this? I tried x <- writeBin(pi, raw()) dump("x","x.R") source("x.R") but is seems x.R is not source()-able, as it contains an unexpected symbol. Thanks Ben __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] dump() an object of type raw ?

2009-07-21 Thread Benjamin Tyner
Thank you David for taking the time to respond to my question. Perhaps I should clarify: the man page says "a 'dump' file can be 'source'd"; have I taken the documentation too literally in this case? David Winsemius wrote: On Jul 21, 2009, at 7:19 PM, Benjamin

Re: [R] numbers on barplot

2009-07-27 Thread Nutter, Benjamin
The only thing you're missing is the midpoints of the bars. Since you specified > Graph <- barplot(dat$Average) You can get the midpoints from the Graph object. So to put the number on top of each bar you might use something like: > text(Graph, dat$Average, dat$Average) -Original Message

Re: [R] Drawing lines in margins

2009-07-29 Thread Nutter, Benjamin
Look at the xpd option in ?par. If you set par(xpd=TRUE) you should be able to add a segment for what you want. But please let me know if someone gives you a better way to do this. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Al

Re: [R] Converting date format

2010-03-23 Thread Nutter, Benjamin
If x is your vector of character date variables: orig.date <- as.Date(x, format=c("%m/%d/%Y")) new.date <- format(x, format=c("%m/%d/%y")) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hosack, Michael Sent: Tuesday, March 23, 2010

[R] (no subject)

2010-04-21 Thread Benjamin Stewart
I've got a problem with the sparseby command (reshape library), and I have reached the peak of my R knowledge (it isn't really that high).   I have a small data frame of 23 rows and 15 columns, here is a subset, the first four columns are factors and the rest are numeric (only one, line54 is pro

[R] RExcel

2009-10-06 Thread Benjamin Ward
Hello- I am a Graduate Assistant for an instructor who has written programs for statistics calculations such as binomial distributions and regressions. The programs had worked with no problem in Excel 2003. Now we are trying to use it with Excel 2007, and we are having some trouble. I have downl

Re: [R] row selection

2009-10-08 Thread Nutter, Benjamin
> x[seq(1, nrow(x), by=5), ] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: Thursday, October 08, 2009 4:19 PM To: Ashta Cc: R help Subject: Re: [R] row selection On Oct 8, 2009, at 4:14 PM, Ashta wrote: >

Re: [R] row selection

2009-10-09 Thread Nutter, Benjamin
sub3 <- x[-seq(1, nrow(x), by=5), ] Notice the '-' in front of the seq() command. This will select everything but what is in the sequence. From: Ashta [mailto:sewa...@gmail.com] Sent: Friday, October 09, 2009 12:42 PM To: Nutter, Benjamin

[R] Functional data analysis - problems with smoothing

2009-10-22 Thread Benjamin Cheah
Hi all, I'm having major issues with smoothing my functional data I'm referring to Jim Ramsay's examples in his books. The following error message keeps appearing, despite all my data being numeric can anyone kindly offer any suggestions? isi - vector of argument values - i.e. the independen

Re: [R] Functional data analysis - problems with smoothing

2009-10-23 Thread Benjamin Cheah
a *factor* object? I'm willing to bet that it is. Use str() to check your data. -Peter Ehlers Benjamin Cheah wrote: > Hi all, > > I'm having major issues with smoothing my functional data > > I'm referring to Jim Ramsay's > examples in his books. The followin

Re: [R] extracting the last row of each group in a data frame

2009-11-17 Thread Nutter, Benjamin
I usually use the following function: last.record <- function(data, id, ..., na.last=TRUE, decreasing=FALSE){ #*** Make vector of variables to sort by v <- c(id, unlist(list(...))) #*** Sort Data Frame data <- data[do.call(order, c(data[,v, drop=FALSE], na.last=na.last, decre

[R] Adding and Multiplying two Unevaluated Expressions

2009-12-01 Thread Benjamin Müller
ns, and how? Thank you so far. Benjamin Müller Geographer (B.Sc.) -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

[R] [Fwd: Re: Adding and Multiplying two Unevaluated Expressions]

2009-12-02 Thread Benjamin Müller
Original-Nachricht Betreff:Re: [R] Adding and Multiplying two Unevaluated Expressions Datum: Tue, 01 Dec 2009 23:49:39 +0100 Von:Benjamin Müller An: Rolf Turner Referenzen: <20091201144125.316...@gmx.net> <8e40e49f-e8fc-4fbd-8cc5-

  1   2   3   4   >