Displaying 20 results from an estimated 6000 matches similar to: "Create a function "automatically" from lm formula and coefficients?"
2012 May 14
3
Scraping a web page.
Folks,
I want to scrape a series of web-page sources for strings like the following:
"/en/Ships/A-8605507.html"
"/en/Ships/Aalborg-8122830.html"
which appear in an href inside an <a> tag inside a <div> tag inside a table.
In fact all I want is the (exactly) 7-digit number before ".html".
The good news is that as far as I can tell the the <a>
2012 Nov 07
8
Aggregate data frame across columns
Folks,
I have a data frame with columns 200401, 200402, ..., 201207, 201208.
These represent years/months. What would be the best way to sum these columns by year? What about by quarter?
Thanks for your time,
KW
--
[[alternative HTML version deleted]]
2013 Jun 11
2
R-help Digest, Vol 124, Issue 12
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 the density plots using the "diag" parameter.
Any suggestions?
Just trying to learn,
2012 Feb 12
2
Is it possible or has it been done?
A port of R to iOS?
Thanks for your time,
KW
--
[[alternative HTML version deleted]]
2012 Nov 09
2
Creating yyyymm regexp strings on the fly for aggregation.
Folks,
This question is somewhat related to a previous posting of mine.
I just can't seem to create a generic solution.
Here is a function that I found searching around the internet:
splitIt <- function(x, n) {split(x, sort(rank(x) %% n))}
I use it like so:
> splitIt(1:12, 2)
$`0`
[1] 1 2 3 4 5 6
$`1`
[1] 7 8 9 10 11 12
Or
> splitIt(1:12, 4)
$`0`
[1] 1 2 3
$`1`
[1] 4 5 6
2013 Apr 03
3
arrayInd and which
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, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6,
6, 6, 1, 6, 6, 6, 6,
2012 Feb 16
2
Problem building up ggplot graph in a loop.
Folks,
I want to automate some graphing using ggplot.
Here is my code
graphChargeOffs2<-function(coffs) {
ggplot(coffs, aes(levels))
dataNames<-names(coffs)[!names(coffs) == "levels"]
for(i in dataNames) {
thisData<-coffs[[i]]
last_plot() + geom_line(aes(y = thisData, colour = i))
}
last_plot() + ylab("Total Chargeoffs")
}
coffs is a data.frame.
2012 Oct 25
1
Estimating credit card default probabilities.
Folks,
I am working on a credit card defaults and transition probabilities. For example a single credit card account could be in a number of states: up-to-date, 30, 60, 90 days in arrears or in default.
* Are there packages in R that do estimation of the transition probabilities given historical cohort defaults?
* Any pointers to papers specific to this type of estimation?
* Simulation of future
2012 Jun 19
1
Scaling a "density".
Folks,
I have a small dataset of counts of recoveries on defaulted loans:
recoveries<-structure(c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1,
0, 0, 0, 0, 0, 4, 0, 1, 2, 2, 12), .Dim = c(11L, 2L), .Dimnames = list(
NULL, c("pcts", "counts")))
Here is the data in columnar form:
pcts counts
[1,] 0.0 0
[2,] 0.1 0
[3,] 0.2 0
[4,] 0.3
2012 Aug 29
1
mach_override.c
Folks,
I just upgraded my Mac to Mountain Lion and on running R.app I get the following message:
mach_override: some instructions unknown! Need to update mach_override.c
err = f8000001 /Volumes/Haxdisk/Projects/DefaultFolderX/DFCarbonPatch/../../Libraries/mach_star-1.2-intel-0.3/mach_override/mach_override.c:215
err = f8000001
2012 Jun 15
1
Divide all rows of a data frame by the first row.
Folks,
I call the function calcAmorts like so:
calcAmorts(prevAm, amort, myDates)
Note that I use the package lubridate.
The last line where do.call is called to first divide all the rows by the first row and then rbind gives the following error:
Error in do.call("rbind", apply(amortsByYears, 1, "/", amortsByYears[, :
second argument must be a list
By contrast if
2013 Jan 31
1
Packages with functionality related to Oil/Gas exploration
Folks,
As the subject describes: I would like to know if there are packages that have functionality tailored for standard Oil/Gas exploration and monetization.
Thanks,
KW
--
[[alternative HTML version deleted]]
2013 Feb 26
2
What happened to "financial" package?
Folks,
I have been using the cf function from the "financial" package for a few years now.
Upon updating my version of R to ... I found that the package no longer exists in the main collection of R packages.
Has this package been renamed or merged with another package?
If the functionality is no longer available what is the best way to integrate the archived version of the package
2013 Jun 11
2
ggpairs in GGally replaces plotmatrix in ggplot2
Hi Keith,,
ggpairs(dat1, upper = list(continuous = "density", combo = "box"))
appears to be what you want.
John Kane
Kingston ON Canada
> -----Original Message-----
> From: kw1958 at gmail.com
> Sent: Tue, 11 Jun 2013 09:25:48 -0400
> To: r-help at r-project.org
> Subject: Re: [R] R-help Digest, Vol 124, Issue 12
>
> Folks,
>
> Sorry for
2014 Aug 01
1
Update R on a new Linux Mint Maya 13 + rJava and XLConnect
Folks,
I was able to get R installed using:
apt-get install r-base-core
R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
* What is the best way to upgrade to the latest version of R.
* What is the best way to install rJava and XLConnect.
Thanks for your time,
Best,
KW
PS. I know some of you
2012 Mar 20
1
Plot method for ca.jo
Folks,
How would I find the code for a plot function that is in a package?
I want to understand exactly what is being plotted.
Thanks,
KW
--
[[alternative HTML version deleted]]
2012 Apr 15
1
Approximately how big is an installation of all packages.
Folks,
If you know the answer great.
If you can tell me which command to use to find out that information please let me know.
If this is the wrong forum, my apologies.
Thanks,
KW
--
[[alternative HTML version deleted]]
2012 Jan 10
1
Can "prototype" and "initialize" coexist?
Folks,
My object oriented background is in Java and C++. I am a novice to using S4/object-oriented coding in R but not to R. Below is an example that I found that I have expanded on.
I am not getting how "prototype" and "initialize" work together, if at all.
Here is output from a short "session"
> setClass("xx",
+
2011 Aug 23
1
obtaining p-values for lm.ridge() coefficients (package 'MASS')
Dear all
I'm familiarising myself with Ridge Regressions in R and the following
is bugging me: How does one get p-values for the coefficients obtained
from MASS::lm.ridge() output (for a given lambda)? Consider the
example below (adapted from PRA [1]):
> require(MASS)
> data(longley)
> gr <- lm.ridge(Employed ~ .,longley,lambda = seq(0,0.1,0.001))
> plot(gr)
> select(gr)
2008 Jan 15
4
Moving zfs to an iscsci equallogic LUN
We have a Mirror setup in ZFS that''s 73GB (two internal disks on a sun fire v440). We currently are going to attach this system to an Equallogic Box, and will attach an ISCSCI LUN from the Equallogic box to the v440 of about 200gb. The Equallogic Box is configured as a Hardware Raid 50 (two hot spares for redundancy).
My question is what''s the best approach to moving the ZFS