Folks,
The following function works like a charm!
> #Amortization for multiple rows
> createAmorts<-function(ams, numPer, term) {
> fctrs<-rep(1:term, each = numPer)
>
> oneRow<-function(am, fac){
> tdf<-data.frame(ams = c(am), yrs=fac)
> agg<-aggregate(ams ~ yrs, data
Folks,
I am using the XLConnect package. I can download all the named ranges except a
couple that are defined by the Excel function “Offset”.
For example I have this named range:
=OFFSET(APA!$A$1,0,0,APA!$K$11,3)
I am pretty sure that this won’t work but I thought I would give it a shot
here
-----------
> Sent from my phone. Please excuse my brevity.
>
> On October 26, 2015 6:16:47 AM PDT, Keith S Weintraub
> wrote:
>> I uninstalled all versions of R on my computer and killed all R
>> directories
> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> On October 25, 2015 7:50:07 AM PDT, Keith S Weintraub
> wrote:
>>
I get the following error:
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:\Users\Administrator\My Documents/R/win-library/3.2": Access is
denied
This may be the first time that I have tried to upgrade R since I upgraded my
Windows installation (on Parall
d."
>
> Best,
>
> -- Zack
> -
> Zack W. Almquist
> Assistant Professor
> Department of Sociology and School of Statistics
> Affiliate, Minnesota Population Center
> University of Minnesota
>
> On Tue, Aug 4, 2015 at 2:12 PM, Zack Almquist wrote:
> Hi K
starts at position 328 and ends at 336. just modify this loop and you'll get
> a table with one-record-per-census-block in every state.
>
> https://github.com/davidbrae/swmap/blob/master/how%20to%20map%20the%20consumer%20expenditure%20survey.R#L104
>
> (1) line 134 cha
Folks,
I am using the UScensus2010 package and I am trying to figure out the number of
households per census block.
There are a number of possible data downloads in the package but apparently I
am not smart enough to figure out which data-set is appropriate and what
functions to use.
Any help
Will it work with .xlsm files?
Best,
KW
> You might try the readxl package - it's only available on github but it
> reads both xlsx and xls. All going well, it should be on its way to CRAN
> next week.
>
> Hadley
>
> On Friday, April 3, 2015, Luigi Marongiu wrote:
>
>> Dear all,
>> I am tryin
me to have the right size font and Tk window to be able to do
debugging using the debug package.
In case you are interested I use Windows 7 on my Mac via Parallels.
Thanks again,
Best,
KW
> On Mar 30, 2015, at 2:05 PM, Duncan Murdoch wrote:
>
> On 30/03/2015 1:50 PM, Keith S W
Folks,
I would like change some of the options for the Tk window that pops up when
using the debug package.
I know how to change the options: e.g. options(debug.font = "Courier 12
italic”).
Is there a way to “preset” these in my environment so when debug starts up I
have all the options set u
I will keep this short as this might be the wrong list:
I have found one (beta) project that allows R to interface with C#.
Are there others? Any favorites.
Best,
KW
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.eth
Folks,
I was wondering if anyone has put together a list of R job interview questions?
I’m thinking of about 5-20 possibly open ended questions for interviewing a
candidate to do R programming. Just programming. Not statistics or mathematics.
What I don’t want are tricky “puzzles” that are more
then it made more sense.
>
> Dennis
>
> On Thu, Oct 2, 2014 at 7:19 AM, Keith S Weintraub wrote:
>> Folks,
>>
>> I have the following data:
>>
>> mdf<-structure(list(a = 1:3, b = c(10, 20, 30)), .Names = c("a", "b"
>> ), row.
Folks,
I have the following data:
mdf<-structure(list(a = 1:3, b = c(10, 20, 30)), .Names = c("a", "b"
), row.names = c(NA, -3L), class = "data.frame")
And function:
defCurveBreak<-function(x, y) {
cumsum(rep(diff(c(0, x)), each = y)/y)
}
lapply'ing to get the result "foo"
foo<-data.frame(l
ware/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> On September 25, 2014 8:25:44 PM PDT, Keith S Weintraub
> wrote:
>> Folks,
&g
Folks,
I have the following problem.
tstSet<-structure(list(corr = c(0.59, 0.62), term = c(7, 7), am = c("AmYes",
"AmNo"), prem = c(19.5, 14.75)), .Names = c("corr", "term", "am",
"prem"), out.attrs = structure(list(dim = structure(c(3L, 2L,
2L, 41L), .Names = c("corr", "term", "am", "prem")),
t.ethz.ch/mailman/listinfo/r-sig-debian. You may have
> better luck asking your question there.
>
> Best,
> Ista
>
> On Thu, Jul 31, 2014 at 8:46 AM, Keith S Weintraub wrote:
>> Ista Et Al,
>> Unfortunately your suggestion to use remove.packages did exactly the reverse
:Basics: ##.#. ##.#. Live Go...
>> Live: OO#.. Dead: OO#.. Playing
>> Research Engineer (Solar/Batteries O.O#. #.O#. with
>> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
>> -
29 08:28
/home/refserv/R/i686-pc-linux-gnu-library/3.1/rJava/libs/rJava.so
The file rJava.so exists.
Thanks so much for your time and help,
Best,
KW
--
On Jul 24, 2014, at 11:16 PM, John McKown wrote:
> On Thu, Jul 24, 2014 at 8:36 PM, Keith S Weintraub wrote:
>> Folks,
>>
>
Folks,
I have been trying to get XLConnect to work on my Linux Mint Maya machine.
R works fine but this package doesn't seem to want to build. Here is the
message I get after supposedly building XLConnect and rJava:
>> require(XLConnect)
> Loading required package: XLConnect
> Error : .onLoad
Arun et al.
Thanks,
This is exactly what I need.
All the best,
KW
--
On Mar 7, 2014, at 10:59 PM, arun wrote:
> Try:
> oof1 <- list()
> oof1[foo$name] <- foo$num
> A.K.
>
>
>
>
> On Friday, March 7, 2014 10:43 PM, Keith S Weintraub wrote:
> Folks,
Folks,
I have a data frame as follows:
> foo<-structure(list(name = c("A", "B", "C"), num = c(3L, 2L, 1L)), .Names =
> c("name",
"num"), row.names = c(NA, -3L), class = "data.frame")
> str(foo)
'data.frame': 3 obs. of 2 variables:
$ name: chr "A" "B" "C"
$ num : int 3 2 1
> foo
name
Regarding : "... I don't know
what the 4th to last page would be called (could add another ante-, or
in R just use tail(book,4))..."
According to wordsmith.org (sign up it's free, note I have no affiliation to
that site) the word is "preantepenultimate".
Check it out:
http://wordsmith.org/words
My sentiments exactly!
Thanks to all for taking the time to flesh out the potential flaws of the
stackexchange "solution".
KW
> Date: Tue, 04 Feb 2014 10:36:21 +1300
> From: Rolf Turner
> To: Bert Gunter
> Cc: "r-help@r-project.org"
> Subject: Re: [R] creating an equivalent of r-help on
>
Thanks to Dan Wang, Petr Pikal, Arun, Jim Holtman and Arun for all of your
solutions.
All the best,
KW
--
__
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/post
Folks,
I got the following prices by scraping a web page just for my own edification:
thePrices<-
c("id=\"p0\">$69.95", "id=\"p1\">$44.95", "id=\"p2\">$69.95",
"id=\"p3\">$59.95", "id=\"p4\">$69.95", "id=\"p5\">$79.95",
"id=\"p6\">$89.95", "id=\"p7\">$59.95", "id=\"p8\">$59.95",
"id=\"p9\">$79
In your example that doesn't work you are
> ending up with a vector rather than a one
> column data frame.
>
> Pat
>
>
> On 07/01/2014 17:44, Keith S Weintraub wrote:
>> Folks,
>>
>> # I have the following function:
>>
>> breakByFreq<-fu
Folks,
# I have the following function:
breakByFreq<-function(freq, defData) {
breakUpFun<-function(freq, defs) {
if(freq != 1) {
defs<-diff(c(0, defs))
defs<-cumsum(rep(defs/freq, each = freq))
}
defs
}
defMat<-sapply(defData[,-1], function(x) breakUpFun(freq, x))
Folks,
I have a working version of the code below for my "real world" problem. I was
wondering if there was a better way to do this.
I have 3 sets of parameters and I want to iterate over all combinations and
label the results.
Would some of the plyr tools make this easier?
# Input Scenarios
Folks,
I was wondering if anyone has an example or a pointer to an example of code to
scrape a web page.
The tricky parts for me are the following:
* I might need to get multiple pages in sequence.
* I need to login with user-name and password.
Thanks for your time and help,
KW
--
___
Tom,
Here is my solution. Note that I assume the columns are interleaved as you
describe below. I'm sure others will have better replies.
Note that using dput helps the helpers.
# From dput(mdat)
mdat<-structure(list(x1 = c(2L, 2L, 2L, 3L, 3L, 30L, 32L, 33L, 33L),
y1 = c(100L, 100L, 100L,
Yes. I was able to run it in RStudio but it did seem much slower than in R.app
(on the Mac).
Note that the "it" that I ran still didn't give the same results as plotmatrix.
Thanks,
KW
--
On Jun 11, 2013, at 11:16 AM, John Kane wrote:
> Note that the code below might not work in RStudio. I a
John,
Thanks for that. Unfortunately it doesn't reproduce the chart in the plotmatrix
call from the original question.
That chart had what looked like densities (I think that is correct as I looked
at the plotmatrix code) down the diagonal.
I am not sure which options would give that result in
Folks,
Sorry for butting in here. I ran the code from John Kane below and it worked
fine.
I did however get a deprecation message suggesting the use of ggpairs from the
GGally package to make this chart.
Unfortunately I haven't found the correct incantation to get the diagonal to
display th
Jim,
Thanks for your comments.
KW
--
On May 6, 2013, at 5:48 PM, Jim Lemon wrote:
> see inline
>
> On 05/07/2013 02:14 AM, Keith S Weintraub wrote:
>> Folks,
>>
>> I have been working on an R project that has a few dozen functions.
>>
>> I have so
Folks,
I have been working on an R project that has a few dozen functions.
I have some questions that are only tangentially related and might only be a
difference in style.
1. Some of my functions take single-row data.frames as input parameters lists.
I don't force the user of the function to
Folks,
I recently was given a simulated data set like the following subset:
sim_sub<-structure(list(V11 = c(0.01, 0, 0, 0.01, 0, 0.01, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0), V12 = c(0, 0, 0, 0.01, 0.03, 0,
0, 0, 0, 0, 0, 0.01, 0, 0.01, 0, 0, 0, 0, 0, 0.04), V13 = c(0,
0, 0, 0.01, 0, 0, 0,
Folks,
I have some computations in a function that create some large matrices.
I have been in the habit in these circumstances to call "null out" a matrix
once used and call gc().
Some pseudo code:
theFunction<-function(x, y, z, 1) {
myMatrix <- black.box.function(x, y, z, 100
>>
>> On Apr 3, 2013, at 7:53 AM, Keith S Weintraub wrote:
>>
>>> Folks,
>>>
>>> I have Googled but not found much regarding arrayInd aside from the "which"
>>> help page.
>>>
>>> Any good examples or docs on
Folks,
I have Googled but not found much regarding arrayInd aside from the "which"
help page.
Any good examples or docs on what arrayInd does that is better or different
from which()?
In addition take the following 20x10 matrix:
td<-structure(c(1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6,
Andras,
I am no expert but you could start with correlated normal random variables
and then convert to lognormal.
You can use rmvsnorm from the {fCopulae} package to generate the correlated
normals.
Here is a call that I have used in the past:
set.seed(12345)
numSims<-10 # number of mult
42 matches
Mail list logo