[R] RODBC Multiple Results

2020-03-25 Thread Doran, Harold
I'm calling a stored procedure that returns multiple tables and my current framework uses RODBC and sqlQuery() to communicate between R and the databases we connect to. A new stored procedure returns multiple tables and I found this on SO indicating that RODBC "may not" be able to retrieve

Re: [R] N Sizes between Pairs of Columns using cor(, , , use = 'pairwise')

2020-01-21 Thread Doran, Harold
Now that’s brilliant! And to get a vector of counts I could extend it to rr <- crossprod(!is.na(tmp)) rr[lower.tri(rr),] Thanks, Bill! From: William Dunlap Sent: Tuesday, January 21, 2020 3:00 PM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] N Sizes between Pairs of Colu

[R] N Sizes between Pairs of Columns using cor(, , , use = 'pairwise')

2020-01-21 Thread Doran, Harold
I'm trying to find an efficient way to find the N size on correlations produced when using the pairwise option in cor(). Here is a sample to illustrate: ### Create a sample data frame tmp <- data.frame(v1 = rnorm(10), v2 = rnorm(10), v3 = rnorm(10), v4 = rnorm(10)) ### Create some random

Re: [R] Help Installing Rtools

2019-09-06 Thread Doran, Harold
John Indeed, this was the issue. I needed to modify my windows path to include both Rtools and the version of R I am using. Thank you. -Original Message- From: Fox, John Sent: Friday, September 6, 2019 9:35 AM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] Help

[R] Help Installing Rtools

2019-09-05 Thread Doran, Harold
I've done the following steps, but am unable to source in the Cpp files. Details of my session and sessionInfo are below. Am I missing a package, or a critical step? I found one answer regarding the 'make" error on stackoverflow suggesting the problem is resolved by grabbing the more recent

Re: [R] Gtk3 into R

2019-08-27 Thread Doran, Harold
Yes, see Shiny by R studio. Here is an example of my site that is built on Shiny and R. It also combines CSS, SQL, javascript, and some HTML. https://shiny.airast.org/METRICS/ -Original Message- From: R-help On Behalf Of Cleber N.Borges Sent: Monday, August 26, 2019 7:48 PM To:

[R] xyplot() conventions for multiple conditioning vars lattice pkg

2019-07-19 Thread Doran, Harold
Here is a toy example of what I want library(lattice) result <- data.frame(score = 1:10, theta = seq(from = -5, to = 5, length = 10)) result$theta2 <- result$theta + .3 xyplot(score ~ theta + theta2, result, type = c('g', 'l')) However, in reality, the number of variables along the x-axis will

Re: [R] mirt-simdata question.

2019-07-11 Thread Doran, Harold
You're asking a question unrelated to R programming and so you won't get a useful response here. However, your question also suggests a misunderstanding of IRT. Generating multi-dimensional data involves generating ability estimates with additional nuisance dimensions and that has no

[R] Curious about pairwise limits with cov()

2019-07-11 Thread Doran, Harold
The help for cov() clearly notes that pairwise only works with pearson. I'm curious why as it is surely not computational. Certainly an analyst knows the nature of the missingness in their data and if it's not MCAR then applying pairwise to spearman would have the same inferential consequence

Re: [R] Regarding R doubt on rasch model

2019-06-19 Thread Doran, Harold
You need to say what function in R is creating this. However, how are you getting a discrimination parameter for Rasch? -Original Message- From: R-help On Behalf Of shreepad khandve Sent: Wednesday, June 19, 2019 2:49 AM To: r-help@r-project.org Subject: [R] Regarding R doubt on rasch

Re: [R] saving an R script

2019-05-10 Thread Doran, Harold
David Most of us use an editor of some kind to write our code. I use Notepad++ but there are many options. In this way, you simply write your code in a text file and save it. Some editors allow for you to execute your code from the script. -Original Message- From: R-help On Behalf

Re: [R] Read_fwf in package readr, double vs. numeric

2019-04-24 Thread Doran, Harold
_1.0.0 crayon_1.3.4 utf8_1.1.4 fansi_0.2.3 [13] rlang_0.3.0.1 -Original Message- From: Sarah Goslee Sent: Wednesday, April 24, 2019 11:12 AM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] Read_fwf in package readr, double vs. numeric Hi, I can't rep

[R] Read_fwf in package readr, double vs. numeric

2019-04-24 Thread Doran, Harold
Suppose I have the following data sitting in a fwf file 'foo.txt'. The point of this email is to ask the group how to properly read in the value in this pseudo-data "1e-20" using the read_fwf function in the package readr. 11e-201043 1712201043 1912201055 First, suppose I do it this way, where

Re: [R] Common elements

2019-03-08 Thread Doran, Harold
Do you mean like this? tmp <- data.frame(v1 = c(1,2,1,4,2), v2 = c(10, 11, 10, 14, 11)) vals <- paste(tmp$v1, tmp$v2, sep ='') tmp[which(vals %in% vals[duplicated(vals)]),] On 3/8/19, 12:51 PM, "Silvano Cesar da Costa" wrote: >Hi, > >I have a dataset with ten columns, but I need extract only

Re: [R] Save creates huge files, dump doesn't

2019-02-19 Thread Doran, Harold
Lars Typically answers regarding shiny are not answered here (I do wish there was a SIG, however). With that said, are you saying that the object size is increasing for objects that previously were much smaller? Or, are other things now being saved into the workspace that were not there

[R] Optimization with Parallel Processing Functions/Packages

2018-11-07 Thread Doran, Harold
More of a general query, but looking to see if others have successfully used something like the foreach package (or other parallel style functions) with certain functions that minimize likelihood or objective functions (e.g., optim/nlminb). I have had great success with embarrassingly parallel

Re: [R] Fast matrix multiplication

2018-08-10 Thread Doran, Harold
Yeah, you might not be able to go much faster here unless A has some specialized structure that you can take advantage of (e.g., sparsity)? On 8/10/18, 11:22 AM, "Ravi Varadhan" wrote: >Hi, > >I would like to compute: A %*% B %*% t(A) > > > >A is a mxn matrix and B is an nxn symmetric,

Re: [R] SQL Database

2018-07-26 Thread Doran, Harold
ppens to know, hints are appreciated Harold -Original Message- From: MacQueen, Don [mailto:macque...@llnl.gov] Sent: Thursday, July 26, 2018 11:26 AM To: Doran, Harold ; 'r-help@r-project.org' Subject: Re: [R] SQL Database From my point of view, the logic is this: If the exte

[R] SQL Database

2018-07-25 Thread Doran, Harold
I'm doing some work now to learn which SQL database package is the most optimal for the task I am working on. There are many packages, and I'm reviewing the documentation on some of them now. I am seeking advice from those of you who might suggest a package to use for the task I am currently

Re: [R] Possible Improvement to sapply

2018-03-14 Thread Doran, Harold
other 59 where isTRUE() can be used: > >> $ grep -E "identical[(][^,]+,[ ]*TRUE[)]" -r --include="*.R" | grep -F >>"/R/" | wc >> 59 3075021 > >Beautiful use of 'grep' -- thank you for those above, as well. >It does need a

Re: [R] Possible Improvement to sapply

2018-03-13 Thread Doran, Harold
, March 13, 2018 12:14 PM To: Doran, Harold <hdo...@air.org> Cc: Martin Morgan <martin.mor...@roswellpark.org>; r-help@r-project.org Subject: Re: [R] Possible Improvement to sapply Could your code use vapply instead of sapply? vapply forces you to declare the type and dimensions of

Re: [R] Possible Improvement to sapply

2018-03-13 Thread Doran, Harold
You’re right, it sure does. My suggestion causes it to fail when simplify = ‘array’ From: William Dunlap [mailto:wdun...@tibco.com] Sent: Tuesday, March 13, 2018 12:11 PM To: Doran, Harold <hdo...@air.org> Cc: r-help@r-project.org Subject: Re: [R] Possible Improvement to sapply Wo

Re: [R] Possible Improvement to sapply

2018-03-13 Thread Doran, Harold
. -Original Message- From: Martin Morgan [mailto:martin.mor...@roswellpark.org] Sent: Tuesday, March 13, 2018 9:43 AM To: Doran, Harold <hdo...@air.org>; 'r-help@r-project.org' <r-help@r-project.org> Subject: Re: [R] Possible Improvement to sapply On 03/13/2018 09:23 AM, D

[R] Possible Improvement to sapply

2018-03-13 Thread Doran, Harold
While working with sapply, the documentation states that the simplify argument will yield a vector, matrix etc "when possible". I was curious how the code actually defined "as possible" and see this within the function if (!identical(simplify, FALSE) && length(answer)) This seems superfluous

Re: [R] MCMC Estimation for Four Parametric Logistic (4PL) Item Response Model

2018-01-18 Thread Doran, Harold
I know of no existing functions for estimating the parameters of this model using MCMC or MML. Many years ago, I wrote code to estimate this model using marginal maximum likelihood. I wrote this based on the using nlminb and gauss-hermite quadrature points from statmod. I could not find that

Re: [R] Revolutions blog: December 2017 roundup

2018-01-09 Thread Doran, Harold
The blog post that the vocal range directs to is *highly* offensive and off color and in very poo taste to share with this group. -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Smith (CDA) via R-help Sent: Tuesday, January 09, 2018 12:47 PM To:

Re: [R] installing package lme4

2017-08-18 Thread Doran, Harold
?install.packages On 8/18/17, 7:39 AM, "Lucy McMahon" wrote: >I am hoping to run a generalised linear mixed effect model but I don't >seem to have access to package lme4. > > >library (lme4) >Error in library(lme4) : there is no package called �lme4� > > >I'm

[R] Force argument to have quotes

2017-06-06 Thread Doran, Harold
I am writing a program where non-technical R users will read in a config file and the config file will then parse the arguments found within the config and pass them to respective functions. I'm having trouble (efficiently) writing a piece of code to retain quotation marks around the argument

Re: [R] About calculating average values from several matrices

2017-05-09 Thread Doran, Harold
Im not sure if you’re asking a question or confirming that it works for you. But, obviously, the code below behaves as expected From: lily li [mailto:chocol...@gmail.com] Sent: Tuesday, May 09, 2017 11:13 AM To: Doran, Harold <hdo...@air.org> Cc: Charles Determan <cdeterma...@gmai

Re: [R] About calculating average values from several matrices

2017-05-09 Thread Doran, Harold
?round From: lily li [mailto:chocol...@gmail.com] Sent: Tuesday, May 09, 2017 11:10 AM To: Charles Determan <cdeterma...@gmail.com> Cc: Doran, Harold <hdo...@air.org>; R mailing list <r-help@r-project.org> Subject: Re: [R] About calculating average values from several matrices

Re: [R] About calculating average values from several matrices

2017-05-09 Thread Doran, Harold
orm(100), 10, 10) } ### mean over all cells sapply(myData, function(x) mean(x)) ### mean over all columns sapply(myData, function(x) colMeans(x)) From: lily li [mailto:chocol...@gmail.com] Sent: Tuesday, May 09, 2017 10:44 AM To: Doran, Harold <hdo...@air.org> Cc: R mailing list

Re: [R] About calculating average values from several matrices

2017-05-09 Thread Doran, Harold
Are you trying to take the mean over all cells, or over rows/columns within each dataframe. Also, are these different dataframes stored within a list or are they standalone? -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of lily li Sent: Tuesday, May

Re: [R] Too strange that I cannot install several packages

2017-04-10 Thread Doran, Harold
. -Original Message- From: Bruce Ratner PhD [mailto:b...@dmstat1.com] Sent: Monday, April 10, 2017 2:13 PM To: Doran, Harold <hdo...@air.org> Cc: r-help@r-project.org Subject: Re: [R] Too strange that I cannot install several packages Dear Harold: If you do not want to answer my questions, t

Re: [R] Too strange that I cannot install several packages

2017-04-10 Thread Doran, Harold
You really need to stop spamming this list and take time to learn R basics. You sent me emails directly on this and asked me this specific question before. These are not packages, but are functions and you do not work with R this way. -Original Message- From: R-help

Re: [R] Taking the sum of only some columns of a data frame

2017-03-31 Thread Doran, Harold
Let's keep r-list on the email per typical protocol. Apply is a function in base R, so you don't need to install it -Original Message- From: Bruce Ratner PhD [mailto:b...@dmstat1.com] Sent: Friday, March 31, 2017 1:06 PM To: Doran, Harold <hdo...@air.org> Subject: Re: [R] Taking t

Re: [R] Taking the sum of only some columns of a data frame

2017-03-31 Thread Doran, Harold
Apologies, my code below has an error that recycles the vector x. Hopefully, the concept is clear. -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Friday, March 31, 2017 12:34 PM To: 'Bruce Ratner PhD' <b...@dmstat1.com>; r-

Re: [R] Taking the sum of only some columns of a data frame

2017-03-31 Thread Doran, Harold
I do not believe this can be done in one step dat <- data.frame(matrix(rnorm(50), 5)) pos <- c(1,3) res <- apply(dat[, pos], 2, sum) x <- numeric(5) x[pos] <- res rbind(dat,x) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bruce Ratner PhD Sent:

Re: [R] [FORGED] standard error for regression coefficients corresponding to factor levels

2017-03-17 Thread Doran, Harold
bels = c("Ctl","Trt")) weight <- c(ctl, trt) lm.D9 <- lm(weight ~ group) X <- model.matrix(lm.D9) Xqr <- qr(X) Q <- qr.Q(Xqr) R <- qr.R(Xqr) ### this is same as just (X'X)^-1 chol2inv(R) ### Compared to the prior way I mentioned solve(crossprod(X)) -Original

Re: [R] [FORGED] standard error for regression coefficients corresponding to factor levels

2017-03-17 Thread Doran, Harold
A slightly more ³R-ish² way of doing S <- solve(t(X)%*%X) Is to instead use S <- solve(crossprod(X)) And the idea idea of inverting the SSCP matrix only and not actually solving the linear system is not so great, which is why it is better to do as Rolf is suggesting and get all things you need

Re: [R] "Safe" use of iterator (package iterators)

2016-12-09 Thread Doran, Harold
That is a helpful, and important, caveat. So, perhaps I should amend my original question to ask something like is it safe *when* length(r1) == length(r2) -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Friday, December 09, 2016 1:27 PM To: Doran, Harold

[R] "Safe" use of iterator (package iterators)

2016-12-09 Thread Doran, Harold
I believe I now see the light vis-à-vis iterators when combined with foreach() calls in R. I have now been able to reduce computational workload to minutes instead of hours. I want to verify that the way I am using them is "safe". By safe I mean does the iterator traverse elements in the same

[R] Benefit of Iterators (package iterator)

2016-12-08 Thread Doran, Harold
R-Help (and package author) I'm trying to understand within the context of R what the benefit of using an iterator is. My only goal in using the foreach package is to improve computational speed with some embarrassingly parallel tasks I have to compute. I took the example found at the link

Re: [R] error serialize (foreach)

2016-12-03 Thread Doran, Harold
help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Saturday, December 03, 2016 4:26 PM To: r-help@r-project.org Subject: [R] error serialize (foreach) I have a portion of a foreach loop that I cannot run as parallel but works fine when serialized. Below is a representation of the

[R] error serialize (foreach)

2016-12-03 Thread Doran, Harold
I have a portion of a foreach loop that I cannot run as parallel but works fine when serialized. Below is a representation of the problem as in this instance I cannot provide reproducible data to generate the same error, the actual data I am working with are confidential. Within each foreach

[R] Splitting or Subsetting Using foreach

2016-12-01 Thread Doran, Harold
I am having tremendous fortune using the foreach function in the foreach package sending work out to multiple cores in order to reduce computational time. I am experimenting with which types of tasks benefit from running in parallel and which do not and so this is a bit of a learning

Re: [R] Alternative to apply in base R

2016-11-09 Thread Doran, Harold
the suggestions to those on this thread. From: William Dunlap [mailto:wdun...@tibco.com] Sent: Tuesday, November 08, 2016 5:14 PM To: Doran, Harold <hdo...@air.org> Cc: peter dalgaard <pda...@gmail.com>; r-help@r-project.org; Fox, John <j...@mcmaster.ca> Subject: Re: [R] Alternative

Re: [R] Alternative to apply in base R

2016-11-08 Thread Doran, Harold
of columns in this matrix (plus another factor). But the number of columns is never all that large. On 11/8/16, 4:37 PM, "peter dalgaard" <pda...@gmail.com> wrote: > >> On 08 Nov 2016, at 21:23 , Doran, Harold <hdo...@air.org> wrote: >> >> It¹s a g

Re: [R] Alternative to apply in base R

2016-11-08 Thread Doran, Harold
hat are both negative and positive. > >I hope this helps, > John >- >John Fox, Professor >McMaster University >Hamilton, Ontario >Canada L8S 4M4 >web: socserv.mcmaster.ca/jfox > > >________ >From: R-

[R] Alternative to apply in base R

2016-11-08 Thread Doran, Harold
Without reaching out to another package in R, I wonder what the best way is to speed enhance the following toy example? Over the years I have become very comfortable with the family of apply functions and generally not good at finding an improvement for speed. This toy example is small, but my

Re: [R] Faster Subsetting

2016-09-28 Thread Doran, Harold
compared to the indexing method. Perhaps I'm using it incorrectly? -Original Message- From: Constantin Weiser [mailto:constantin.wei...@hhu.de] Sent: Wednesday, September 28, 2016 12:55 PM To: r-help@r-project.org Cc: Doran, Harold <hdo...@air.org> Subject: Re: [R] Faster Subsett

Re: [R] Faster Subsetting

2016-09-28 Thread Doran, Harold
Schneider [mailto:dosc3...@colorado.edu] Sent: Wednesday, September 28, 2016 12:27 PM To: Doran, Harold <hdo...@air.org> Cc: r-help@r-project.org Subject: Re: [R] Faster Subsetting I regularly crunch through this amount of data with tidyverse. You can also try the data.table package. The

[R] Faster Subsetting

2016-09-28 Thread Doran, Harold
I have an extremely large data frame (~13 million rows) that resembles the structure of the object tmp below in the reproducible code. In my real data, the variable, 'id' may or may not be ordered, but I think that is irrelevant. I have a process that requires subsetting the data by id and then

[R] Better use of regex

2016-09-15 Thread Doran, Harold
I have produced a terribly inefficient piece of codes. In the end, it gives exactly what I need, but clumsily steps through multiple steps which I'm sure could be more efficiently reduced. Below is a reproducible example. What I have to begin with is character vector, dimInfo. What I want to

Re: [R] R-specific Software Requirement Specification

2016-09-08 Thread Doran, Harold
-Original Message- From: Michael Friendly [mailto:frien...@yorku.ca] Sent: Thursday, September 08, 2016 9:19 AM To: Doran, Harold <hdo...@air.org>; r-help@r-project.org Cc: Duncan Murdoch <murdoch.dun...@gmail.com> Subject: Re: R-specific Software Requirement Specificati

Re: [R] R-specific Software Requirement Specification

2016-09-07 Thread Doran, Harold
to output etc. I suppose it is easy enough to add an "inherits from" or outputs an object of class "xyz" to this for my purpose. -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Wednesday, September 07, 2016 12:46 PM To: Doran, Harold

Re: [R] R-specific Software Requirement Specification

2016-09-07 Thread Doran, Harold
I use Mercurial for this. -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rich Shepard Sent: Wednesday, September 07, 2016 11:56 AM To: r-help@r-project.org Subject: Re: [R] R-specific Software Requirement Specification On Wed, 7 Sep 2016, Doran

[R] R-specific Software Requirement Specification

2016-09-07 Thread Doran, Harold
I'm building a large program with many different people contributing to the coding in R and so it needs a well-articulated design spec. The program will have many different functions that must interact with each other, but the individual functions will be written by different people. I'm

Re: [R] R Shiny convert into Java

2016-08-16 Thread Doran, Harold
You should ask this on the Shiny google group. But, Shiny depends on R, so what you¹re wanting to accomplish is not possible On 8/16/16, 9:11 AM, "Venky" wrote: >Hi, > >How to run Shiny (Server,UI) into JAVA? > >I am running R Shiny app using R >But i want to run those

Re: [R] Faster Multivariate Normal

2016-06-07 Thread Doran, Harold
ge- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Tuesday, June 07, 2016 10:44 AM To: Doran, Harold <hdo...@air.org>; r-help@r-project.org Subject: Re: [R] Faster Multivariate Normal On 07/06/2016 9:06 AM, Doran, Harold wrote: > I am computing a complex multidi

[R] Faster Multivariate Normal

2016-06-07 Thread Doran, Harold
I am computing a complex multidimensional integral (4 dimensions) using Gauss-legendre and am looking to optimize one piece of code that is currently very expensive. The integral is evaluated for K individuals in my data and once this piece is computed it can be stored and recycled over all K

Re: [R] Grep command

2016-05-04 Thread Doran, Harold
You asked this question yesterday, and received responses on this same response. Is there a reason this is reposted? -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen Sent: Wednesday, May 04, 2016 1:46 AM To: r-help

Re: [R] How to avoid endless loop in shiny

2016-03-08 Thread Doran, Harold
Michael It is not possible to answer this question without seeing reproducible code. More importantly, it is better to ask Shiny-related questions on stackoverflow using the Shiny tag or on the Shiny google group. -Original Message- From: R-help [mailto:r-help-boun...@r-project.org]

Re: [R] Comparing variance components

2016-02-16 Thread Doran, Harold
(adding R mixed group). You actually do not want to do this test, and there is no "shrinkage" here on these variances. First, there are conditional variances and marginal variances in the mixed model. What you are have below as "A" is the marginal variances of the random effects and there is no

Re: [R] Linear regression with a rounded response variable

2015-10-22 Thread Doran, Harold
> Yes, and I think that the suggestion in another post to look at censored > regression is more in the right direction. I think this is right and perhaps the best (or at least better) pathway to pursue than considering this within the framework of measurement error (ME). Of course there *is*

[R] POSIX and ecdf()

2015-03-30 Thread Doran, Harold
Below is some working code that, generally speaking, accomplishes why I want, but am looking for a necessary improvement in the final step. The code below scrapes data from a website (thousands of pages actually) and organizes athlete�s scores in a data frame. The final variable, called

[R] Help with POSIX

2015-03-30 Thread Doran, Harold
I�m struggling a bit with learning about POSIX objects to do some basic things with objects of this class. Suppose I have the following simple example times - c(03:20, 29:56, 03:30, 21:03, 56:26) aa - strptime(times, %M:%S�) I can do means, and some other basic things, but I cannot correlate

[R] automate press enter

2015-03-12 Thread Doran, Harold
I�m dealing with an issue that is seemingly simple, and I�m sure there is an obvious solution. I�m writing a wrapper function that calls functions from another package (twitteR). However, the function I happen to be using in that package prompts the user the user to enter a �1� or a �2� in the

[R] twitteR and wordcloud()

2015-03-11 Thread Doran, Harold
I am trying to replicate the twitter and word cloud example found here https://sites.google.com/site/miningtwitter/questions/talking-about/wordclouds/wordcloud1 When implemented verbatim, I replicate results and all works fine. But, when I make a slight modification to the code it fails in

Re: [R] readHTMLTable() in XML package

2015-03-03 Thread Doran, Harold
] Sent: Monday, March 02, 2015 2:05 PM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] readHTMLTable() in XML package This somewhat simpler rvest code does the trick for me: library(rvest) library(dplyr) i - 1:10 urls - paste0('http://games.crossfit.com/scores/leaderboard.php?stage=5

[R] readHTMLTable() in XML package

2015-03-02 Thread Doran, Harold
I'm having trouble pulling down data from a website with my code below as I keep encountering the same error, but the error occurs on different pages. My code below loops through a wensite and grabs data from the html table. The error appears on different pages at different times and I'm not

[R] Schedule R function/Code to run at specific time

2015-02-26 Thread Doran, Harold
Is there functionality within R proper, without having to revert to the OS, allowing a function or a portion of an R script to be run at a defined time? My google searches haven't provided much other than one at the link below which relies on an OS. Thanks, Harold

Re: [R] multiple parameter optimization with optim()

2015-02-20 Thread Doran, Harold
= T)) r2 - pl2(datat, Q =10) -Original Message- From: Prof J C Nash (U30A) [mailto:nas...@uottawa.ca] Sent: Wednesday, February 18, 2015 9:07 AM To: r-help@r-project.org; Doran, Harold Subject: Re: [R] multiple parameter optimization with optim() Some observations -- no solution here

[R] multiple parameter optimization with optim()

2015-02-17 Thread Doran, Harold
I am trying to generalize a working piece of code for a single parameter to a multiple parameter problem. Reproducible code is below. The parameters to be estimated are a, b, and c. The estimation problem is such that there is one set of a, b, c parameters for each column of the data. Hence, in

[R] Shiny User Group

2015-02-12 Thread Doran, Harold
I found a google user group for shiny, and am curious if there is an SIG as well. Didn't see one in my searches, but looking for an active place to ask questions and share code. Thanks. [[alternative HTML version deleted]] __

Re: [R] sqldf() difference between R 3.1.2 and 3.0.1

2015-02-11 Thread Doran, Harold
That seems to have worked, both in the new and old version of R. I'll do more unit testing on other files. Thank you, Gabor. -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Wednesday, February 11, 2015 10:22 AM To: Doran, Harold Cc: r-help@r

[R] sqldf() difference between R 3.1.2 and 3.0.1

2015-02-11 Thread Doran, Harold
I have a function written and tested using R 3.0.1 and sqldf_0.4-7.1 that works perfectly. However, using this same code with R 3.1.2 and sqldf_0.4-10 yields the error below that I am having a difficult time deciphering. Hence, same code behaves differently on different versions of R and

Re: [R] How to solve this complex equation

2015-02-10 Thread Doran, Harold
?uniroot -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ssuhanchen Sent: Tuesday, February 10, 2015 3:32 AM To: r-help@r-project.org Subject: Re: [R] How to solve this complex equation no, it is not my homework. I would like to know if there is

Re: [R] Lme4 Package Help!

2014-11-07 Thread Doran, Harold
Daniel Lmer has never returned p-values from a model summary; this is a well-known and discussed issue. You must have post-processed the data in some way to get the p-values. Our only way of helping is for you to provide sample code on what you did -Original Message- From:

[R] Using read.csv.sql() to read in specific columns

2014-09-18 Thread Doran, Harold
I am dealing with data frames that have thousands of columns and hundreds of thousands of rows and only need a few specific columns from the data. The data take various formats, but normally are tab-delimited. I have written the following which is working as expected. However, because I�m so

[R] Using sqldf() to read in .fwf files

2014-09-15 Thread Doran, Harold
I am learning to use sqldf() to read in very large fixed width files that otherwise do not work efficiently with read.fwf. I found the following example online and have worked with this in various ways to read in the data cat(1 8.3 210.3 319.0 416.0 515.6 719.8 , file = fixed) fixed -

Re: [R] Using sqldf() to read in .fwf files

2014-09-15 Thread Doran, Harold
) -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Monday, September 15, 2014 12:42 PM To: Doran, Harold Cc: r-help@r-project.org Subject: Re: [R] Using sqldf() to read in .fwf files On Mon, Sep 15, 2014 at 12:09 PM, Doran, Harold hdo...@air.org wrote: I

[R] Better use with gsub

2014-08-01 Thread Doran, Harold
I have done an embarrassingly bad job using a mixture of gsub and strsplit to solve a problem. Below is sample code showing what I have to start with (the vector xx) and I want to end up with two vectors x and y that contain only the digits found in xx. Any regex users with advice most welcome

[R] system()

2014-04-14 Thread Doran, Harold
I need to send a system command to another program from within R but have a small hangup I'm trying to do something like this system(notepad myfile.txt) But, more generally this is happening to multiple files, so I loop over thousands of files. For purposes of an example, my code is something

[R] Save file as Fixed Width using sprintf()

2014-04-11 Thread Doran, Harold
I have working code to write a file out as fwf as shown below. I have one question to try and automate this I cannot get to work. I am generating thousands of data files for a simulation to be run outside of R and each file varies in its dimensions. So I am trying to write code that can write

[R] Generate Binary Matrix

2014-04-09 Thread Doran, Harold
I am trying to generate a binary matrix where every row in the matrix is guaranteed to have at least one 1. Ideally, I would like most rowSums to be equal to 2 or 3 with some 1s and some 4s. But, rowSums cannot be equal to 0. I can tinker with the vector of probability weights, but in doing so

[R] Times and Dates

2014-04-01 Thread Doran, Harold
Is the time and date package the right one to convert a vector, such as the following, into a time format? 12:06 11:51 11:53 12:27 14:20 12:27 The aim is to deal with a time variable numerically (find means, etc). Thanks Harold [[alternative HTML version deleted]]

Re: [R] Extract Data form Website Tables

2014-03-02 Thread Doran, Harold
, , names(data)) names(data) - gsub( +, , names(data)) data[] - lapply(data, function(x) gsub(\\n, , x)) str(data) Hope this helps, Rui Barradas Em 01-03-2014 23:47, Doran, Harold escreveu: There is a website that populates a table with athlete scores during a competition. I would like to be able

[R] Pattern Matching

2014-03-02 Thread Doran, Harold
Suppose I have a character vector as follows: aa [1] 1 (472) 2 (445) 3 (431) 3 (431) 5 (415) 6 (405) 7 (1)” I want to extract the values within parentheses and place them into a column that is numeric. The values in aa vary in length and so using strsplit() won’t work because the positions

[R] Extract Data form Website Tables

2014-03-01 Thread Doran, Harold
There is a website that populates a table with athlete scores during a competition. I would like to be able to extract those scores from the website and place them into a data frame if this is possible. The website is at the link below: http://games.crossfit.com/leaderboard One complication

Re: [R] Help - Trace of matrices

2013-12-06 Thread Doran, Harold
A fast computation I use is based on the following: A - matrix(rnorm(16), ncol = 4) B - matrix(rnorm(16), ncol = 4) C - A %*% B sum(diag(C)) ### This is less expensive to compute when the matrix multiplication is expensive sum(A * t(B)) So, it just uses the elementwise calculations and sums

Re: [R] problem with CSV and R

2013-11-22 Thread Doran, Harold
Rachel Using fix() is not really a good way to view or modify your data. It is better to use functions like head(), tail() or index values in the dataframe to view your data and then also modify elements through indexing. For instance, something like this tmp - data.frame(v1 = rnorm(10), v2

[R] cbind2() in Matrix

2013-11-12 Thread Doran, Harold
Suppose I have three matrices, such as the following: mat1 - Matrix(rnorm(9), 3) mat2 - Matrix(rnorm(9), 3) mat3 - Matrix(rnorm(9), 3) I now need to column bind these and I could do the following if there were only two of those matrices because cbind2() has an x and y argument Zlist - c(mat1,

Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Doran, Harold
Yes, but notice that man2[3,] == .3 [1] FALSE This is because of issues of machine precision when dealing with floating points, not a problem in R. Comparisons for nearly equivalent numbers are done using all.equal() as shown below. all.equal(man2[3,], .3) [1] TRUE -Original

Re: [R] strange behaviour when subsetting a data.frame

2013-11-07 Thread Doran, Harold
...@infinitycloud.com] Sent: Thursday, November 07, 2013 11:59 AM To: Doran, Harold; 'Eckstädt, Elisabeth'; r-help@R-project.org Subject: RE: strange behaviour when subsetting a data.frame So is there a way to make the subsetting behave as expected? -Original Message- From: r-help-boun...@r

Re: [R] repeat a linear regression model

2013-10-14 Thread Doran, Harold
Well, see the help page for by() or an apply() function. But, YIKES, maybe work with a statistician who can help you with the underlying issue. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Valeria Muzzolini Sent: Monday,

[R] Writing Generic (Extractor) Functions

2013-10-08 Thread Doran, Harold
The Writing R Extensions guide has a good section on writing generic functions and methods. However, has anyone generated any additional tutorials, presentations, notes, etc that extend this topic? Perhaps showing additional examples of what works well and what risks to avoid. Thanks, Harold

Re: [R] Writing Generic (Extractor) Functions

2013-10-08 Thread Doran, Harold
Chapter 7 of Writing R Extensions http://cran.r-project.org/doc/manuals/R-exts.html#Generic-functions-and-methods -Original Message- From: gret...@gmail.com [mailto:gret...@gmail.com] On Behalf Of Grant Rettke Sent: Tuesday, October 08, 2013 4:31 PM To: Doran, Harold Cc: r-help@r

[R] S3 Methods for Linear Regression

2013-09-09 Thread Doran, Harold
I have a function for fitting a type of linear regression and have written methods for it as shown below. I exclude the main lm.eiv.fit function as it is large and I don't think necessary for the reproducible example. But, I can certainly provide if that would be needed. These methods allow

Re: [R] Matrix Multiplication using R.

2013-08-14 Thread Doran, Harold
Do your matrices have any special properties we should know about? For example, are they sparse, symmetric, diagonal, etc? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Praveen Surendran Sent: Wednesday, August 14, 2013 11:41 AM

Re: [R] Regular repeats

2013-08-13 Thread Doran, Harold
What about something like this: tmp - data.frame(var1 = rnorm(36), ind = gl(6,6)) with(tmp, tapply(var1, ind, mean)) You can see that your version of mean(tmp[1:6,c(var1)]) gives the same as mine for the first 6 rows. -Original Message- From: r-help-boun...@r-project.org

  1   2   3   4   >