Thanks, Felix! That works.
best,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3081792.html
Sent from the R help mailing list archive at Nabble.com.
__
Thanks for the reply, Dieter.
I'm sorry I should have made it clear in my original post - the number
(output of which.max()) IS dependent on the grouping..
Thanks,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel
Sorry, just realized that there was a typo in the following code of my
original post. The correct code is as shown below (corrected 'data=swtop16'
to 'data=DF'):
sales <- xyplot(pct_inv_left ~ week_num|sku_num, data=DF,type =
"l",lwd=2,panel = function(...) {
panel.abline(h = 75, lty
Hi folks,
I need some help in customizing the abline() function to be used in a
lattice plot. I have attached a reproducible example below.
I need help in the following snippet:
disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type =
"h",lwd=2,panel = function(...) {
panel
Check the following thread from a couple of years ago:
http://www.mail-archive.com/r-help@r-project.org/msg14521.html
cheers,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/Substitute-NAs-by-zero-tp2546715p2546725.html
Sent from the R help mailing list archive at Nabble.
Venkatesh,
Check out the package lpSolve. It has the function lp.assign() that can be
used to solve linear assignment problems.
cheers,
-Girish
--
View this message in context:
http://r.789695.n4.nabble.com/R-help-tp2340772p2340818.html
Sent from the R help mailing list archive at Nabble.com.
Check out package survey
cheers,
-Girish
--
View this message in context:
http://n4.nabble.com/Stratified-random-sampling-tp1690475p1690730.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://st
Hi All,
Say I have a data set with the following structure:
Lines <- "ID ref_rankR1 R2 R3 R4 R5 R6
A 6 3 NA NA7 8 2
B 7 4NA NA 9 5 10
C 3 7NA NA 8 10 8
D 4 2NA NA 4 8 1
E 2 5NA NA 4 7 7
F 8 5
Check the package doBy as well (pretty handy for analysis of grouped data).
library(doBy)
summaryBy(PM~ID,data=d,FUN=median)
HTH,
-Girish
--
View this message in context:
http://n4.nabble.com/median-of-grouped-data-tp1311971p1312386.html
Sent from the R help mailing list archive at Nabble.com.
Interestingly, Hmisc::describe() and summary() seem to be using one Type, and
stats::fivenum() seems to be using another Type.
> fivenum(cbiomass)
[1] 910.0 1039.0 1088.5 1156.5 1415.0
> summary(cbiomass)
Min. 1st Qu. MedianMean 3rd Qu.Max.
9101048108811041139
Thanks for the replies, Jim, David, and Dennis (who replied to me directly)!
To summarize, here's what worked for me:
===
dflist <- list(df1, df2, df3)
lsfun <- function(df) with(df, lsfit(A, B)$coef)
res <- lapply(dflist, lsfun)
do.call(rbind, res)
===
cheers,
-G
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain function on
the same set of columns in each of the data set. Let's take, for ex, the
typical data set is:
df1 <- as.data.frame(cbind(rnorm(10),rnorm
Works alright for me:
> summarise(baseball,duration = max(year) - min(year),nteams =
> length(unique(team)))
duration nteams
1 136132
> ddply(baseball, "id", summarise, duration = max(year) - min(year), nteams
> = length(unique(team)))
id duration nteams
1aaronha01
See if this works:
qfun2 <- function(x, digits=3,sci=F,...){
c(q=quantile(x, probs=c(1,5,10,95,99)/100,type=6,...)
)
}
cheers,
-Girish
===
premmad wrote:
>
> I tried thanks for your help and got the same result for percentile 5 & 95
> as in SAS.But if i need to calcu
Replace your qfu as follows:
qfu <- function(x, digits=3,sci=F,...){
c(q=fivenum(x, ...)
)
}
Look up fivenum function for more information.
cheers,
-Girish
=
premmad wrote:
>
> Thanks for the help.I got the required quantiles by altering ur code
> as follows
>
> q
Here's the code that does the job for quartiles (0,25,50,75,100). To get to
your objective of (5,10,25,75,90) is left as an exercise. There are several
well-written introductory books in R, in addition to the freely available
presentations and other online resources. I think you should spend some
Can you post a reproducible code snippet, along with the output/error
messages, and the output of sessionInfo(). That way other folks on R-help
may be able to offer help.
Here's myl output of sessionInfo()
> sessionI
I'm not able to replicate your problem. Here's what I get. See if this is
what you want:
> dt$date<-strptime(as.character(dt$datetime),"%d%b%Y")
> dt
datetime date
1 01OCT1987:00:00:00.000 1987-10-01
2 12APR2004:00:00:00.000 2004-04-12
3 01DEC1987:00:00:00.000 1987-12-01
4
"2003-06-26"
[7] "1900-01-01" "1998-05-13" "1998-09-30"
cheers,
-Girish
premmad wrote:
>
> Girish it works for me also if its a vector.I have problem if the data is
> stored as dataframe(rows and columns) please
Seems to work alright for me.
datetime <-c(
"01OCT1987:00:00:00.000",
"12APR2004:00:00:00.000",
"01DEC1987:00:00:00.000",
"01OCT1975:00:00:00.000",
"01AUG1979:00:00:00.000",
"26JUN2003:00:00:00.000",
"01JAN1900:00:00:00.000",
"13MAY1998:00:00:00.000",
"30SEP1998:00:00:00.000")
> date<-strptime(
Hi Ravi,
See if the following helps:
=
Lines <- "Date1 Date2
29-Dec-06 25-Jan-07
29-Dec-06 25-Jan-07
29-Dec-06 25-Jan-07
2-Jan-07 25-Jan-07
2-Jan-07 25-Jan-07
2-Jan-07 25-Jan-07"
DF <- read.table(con<- textConnection(Lines), skip = 1)
close(con);
names(DF) <- scan(textCo
Thanks, Chris and Thierry! I think I can explore both your solutions.
best,
-Girish
It is a plot with pointranges. Here is an example with the ggplot2
package
library(ggplot2)
#use the diamond data set from ggplot2
diamonds$A <- diamonds$depth < 60
dmod <- lm(price ~ cut * A, data=diamonds)
c
Hi folks,
Can someone please help me in identifying the type of plot shown here?
Sample R code or specific package name would be of help as well.
Thanks,
-Girish
http://www.nabble.com/file/p24477714/example_plot.jpg
--
View this message in context:
http://www.nabble.com/Help-needed-in-iden
Hi,
This doesn't quite answer your question, but the following discussion
(posted some time back in this forum) would lead you in that direction:
http://www.nabble.com/Re%3A-More-Logistic-Regression-Tools--td3793516.html#a3793516
best,
-Girish
alon.benari wrote:
>
> Hello R experts,
>
> Is
Joanne,
[...snip...]
x <- sample(1:2, 100) #without replacement
Now I want x to contain to 20% missing data (NA). Could anyone help me
how to do this?
See if this helps:
n <- length(x)
x[sample(n, 0.2*n)] <- NA
cheers,
-Girish
--
View this messag
Thanks, Marc! This is what I was looking for.
best,
-Girish
PS: Also appreciate your concern about this being a part of a variable
selection process.
On Jun 17, 9:01 pm, Marc Schwartz wrote:
> On Jun 17, 2009, at 10:06 AM, Girish A.R. wrote:
>
>
>
> > Hi folks,
>
> >
Hi folks,
I'm trying to consolidate the outputs (of anova() and lrm()) from
multiple runs of single-variable logistic regression. Here's how the
output looks:
y ~ x1 y ~ x2 y ~ x3 y ~
x4
Chi-Squa
Eugene,
Check out the following R package:
---
arules: Mining Association Rules and Frequent Itemsets
Provides the infrastructure for representing, manipulating and
analyzing transaction data and patterns (frequent itemsets and
association rules). Also prov
Hi Martin,
Thanks for your prompt response! As suggested, I re-installed 'lme4'
and am now able to load it without any problem.
best,
-Girish
---
> packageDescription("lme4")
Package: lme4
Version: 0.999375-31
Date:
Hi Martin,
I upgraded to R 2.9.0, but still have the same problem. The error
message, output of packageDescription("lme4"), and sessionInfo() are
displayed below.
Thanks,
-Girish
--
> library(lme4)
Loading required package: Matrix
Loadi
Hi folks,
When I try to load package 'lme4' on my Linux box (64-bit Ubuntu
9.04), I get the following error:
-
> library(lme4)
Error in dyn.load(file, DLLpath = DLLpath, ...) :
function 'cholmod_start' not provided by package 'Matrix'
Error: package/namespace
Thanks a bunch, Coltrey! That works like a charm as well!
In summary, the code that solves both my queries is shown below:
---
mdat <- matrix(c
(-2.65,-3.7,-0.8,-1.4,-2.39,-1.12,-4.78,-4.9,-0.76,-1.56,
1.77,1.41,1.92,1.78,0.05,0.96,0.29,
title",cex=1),
> xlab="x-axis labels"
> )
>
>
>
> On Wed, Jun 3, 2009 at 09:42, David Winsemius wrote:
>
> > On Jun 3, 2009, at 9:56 AM, Girish A.R. wrote:
>
> >> Hi,
>
> >> I have been recently experimenting with the lattice
Hi,
I have been recently experimenting with the lattice package, which I
must admit is just great! However, I'm sort of stuck in modifying
certain parameters; Would appreciate some pointers on a couple of
things:
1) Is it possible to change the font of the labels (say to computer
modern) -- eith
stance ~ fitted(.) | Subject, abline = c(0,1)))
@
Renaud
On Jun 1, 10:45 am, "Girish A.R." wrote:
> Hi,
>
> I seem to be facing a strange problem when I use Sweave for creating a
> LaTeX document of the R lme() outpu
Hi,
I seem to be facing a strange problem when I use Sweave for creating a
LaTeX document of the R lme() output --- The EPS and PDF figure files
get created, but are empty. I have attached a reproducible example
below (taken from the R lme() help example).
On Mar 3, 9:58 am, Ajay ohri wrote:
> for an " inefficient " language , it sure has dominated the predictive
> analytics world for 3 plus decades.
> I referred once to intellectual jealousy between newton and liebnitz.
>
> i am going ahead and creating the R package called "Anne".
>
> It basically
Thanks, All!
-Girish
On Feb 9, 7:49 am, Dirk Eddelbuettel wrote:
> On 8 February 2009 at 18:29, Girish A.R. wrote:
> | So, does that mean I can install Ubuntu 64-bit "amd64" server edition
> | on a machine that has Intel Xeon processor without much of a problem?
>
> Yes
So, does that mean I can install Ubuntu 64-bit "amd64" server edition
on a machine that has Intel Xeon processor without much of a problem?
Thanks,
-Girish
On Feb 9, 5:33 am, "M. Edward (Ed) Borasky" wrote:
> On Sun, Feb 8, 2009 at 3:54 PM, Dirk Eddelbuettel wrote:
> > To differentiate the then
Just an extension of the query posed by the OP --- Similar problem
arises in the case when one has to deal with weekly data spanning 2 or
more years, and one of the years happens to have 53 weeks because it
is a leap year (2004, for ex.). In a sci.stats newsgroup where I had
posed this problem for
Not sure with decompose(), but the output object of the 'stl' function
has a 'time.series' attribute - you need to add the trend and the
irregular components to get the seasonally adjusted series.
Hope this helps.
best,
-Girish
On Dec 6, 1:45 pm, RON70 <[EMAIL PROTECTED]> wrote:
> using decompos
41 matches
Mail list logo