Hi,
May be this helps. But, the conditions are not very clear.
lst1 <- lapply(split(test,test$V1),function(x) unique(as.vector(t(x
indx <- unlist(lapply(lst1,function(x) which(names(lst1) %in% x)))
lst2 <- split(gsub("\\d+","",names(indx)),indx)
indx1 <-
duplicated(lapply(lst2,`[`,1))|!(dup
Hi,
Try:
df <- data.frame(ID=c("ID1","ID1","ID2","ID3","ID1","ID2"),
date=c("Mar03","Mar01","Mar05","Mar02","Mar02","Mar01"),stringsAsFactors=FALSE)
#as.Date(paste0(1,df[,2]),"%d%b%y") #assuming that year represents the digits
#as.Date(paste0(2001,df[,2]),"%Y%b%d")# if the digits represent day
#Would like to create a cross-table (Region, district, response) and
#(Region, district, cost. The flat table function does not look so good
region <- c("A","A","A","A","B","B", "B", "B", "C","C", "C", "C")
district <- c("d","d","e","e","f","f", "g", "g", "h","h", "i", "j")
response <- c("ye
On 11/10/2013 03:54 AM, daniel schnaider wrote:
Thanks Martin. It worked well.
Two new questions related to the same subject.
1) Why create this semantic of a final argument name specifically names value?
I do not know. It is a requirement of replacement methods in R in general, not
just S4 m
On 11/09/2013 11:31 PM, Hadley Wickham wrote:
Modelling a mutable entity, i.e. an account, is really a perfect
example of when to use reference classes. You might find the examples
on http://adv-r.had.co.nz/OO-essentials.html give you a better feel
for the strengths and weaknesses of R's differe
Your specification is a unclear (to me anyway): What do you want to
return if the intersection is empty? What if intersect(ja[[i]],
ja[[i+1]]) is empty for all i? What if length(intersect( ja[[i]],
ja[[i+1]] )) ==0 but intersect(ja[[i]],ja[[i+2]]) is nonempty? Your
example isn't -- you did not sp
I'll leave it to others to muddle through your code. It appears to
refer to an earlier post that you did not include. Note also that you
still have not specified what you want to get from your example ja
list. Doing so might help you get a useful response, which mine
clearly is not.
Cheers,
Bert
Hi all,
I am plotting very nice looking mattrices with plotrin...
so far so good, I would like though to ask you if it would be possible to add
at the bottom of the color.legend (this lovely color bar that maps colors to
numbers).
Would that be possible to do that?
I would like to thank you i
There seems to be some inappropriate quoting in the tabular function from
the tables package. Consider this example:
library(tables)
sampledf <- data.frame( Manufacturer=c(rep("Joe & Co.",6)
,rep("\\tabular, Inc.",4))
, Tool=rep(c("Shov
The simplest would be to create a variable combining region and
district:
> data$region_district <- with(data, paste(region, district))
> prop.table(xtabs(~region_district+response, data), 1)
response
region_district no yes
A d 0.5 0.5
A e 0.0 1.0
My purpose is to create chains of list objects if elements of the object
overlap. If there is no overlap the object remains as it is. My plan is to
identify snps that are in ld. The letters in each list object represent
snps that are in ld in respect to the first snp (or letter). The first snp
(or
It appears to be legitimate to include multi-level categorical and continuous
variables in defining the model for earth (e.g. y ~ cat + cont1 + cont2) but is
it also then possible use categoricals in the predict method using the earth
result?
Chris
_
I guess I found a solution though it is not very elegant.
Hermann
snp.block <- function (huz)
{
for (i in names (huz))
{
chain1 <- huz[[i]]
for (k in names (huz))
{
chain2 <- huz[[k]]
Thanks Martin. It worked well.
Two new questions related to the same subject.
1) Why create this semantic of a final argument name specifically names
value?
2) Regarding performance. When CustomerID(ac) <- "54321" runs, does it only
change the slot from whatever it was to 54321, or it really creat
Hi all,
I am plotting very nice and sexy images with plotrix :)
so far so good, I would like though to ask you if it would be possible to add
at the bottom of the color.legend (this lovely color bar that maps colors to
numbers).
Would that be possible to do that?
I would like to thank you in adv
Because of the issue raised in
https://stat.ethz.ch/pipermail/r-help/2013-November/362896.html, I am
switching to R on Mac OS X (10.6.8) to create some plots. Using
CairoPDF(), however, the commands I use in Windows (7) to select my
fonts don't have any effect on Mac OS X, where the output .pdf fil
Hi,
How can I calculate and mark each group centroid in a linear discriminant
analysis plot (using ggplot2)?
Script:
## originate from
http://r.789695.n4.nabble.com/LDA-and-confidence-ellipse-td4671308.html
require(MASS)
require(ggplot2)
iris.lda<-lda(Species ~ Sepal.Length + Sepal.Width + Peta
It is excellent. thanks!
On Sun, Nov 10, 2013 at 12:49 PM, Martin Morgan wrote:
> On 11/09/2013 11:31 PM, Hadley Wickham wrote:
>
>> Modelling a mutable entity, i.e. an account, is really a perfect
>> example of when to use reference classes. You might find the examples
>> on http://adv-r.had.
Christofer Bogaso gmail.com> writes:
>
> Hi again,
>
> In R, there are various numerics like, NA, Inf, or simple integers etc.
> However I want to include one custom type: "TBD", which R should treat as
> numeric, not character.
>
> That "TBD" should have same property like Inf, however except
Charles:
That was my initial thought, too. But then I wondered whether what was
meant was to use "TBD" as an alternative kind of numeric value that
would be part of numeric vectors, lists, etc. in the same way that NA
or Inf is. It is not clear to me that a new object class provides a
way to do t
On Nov 9, 2013, at 11:01 AM, Sverre Stausland wrote:
> I'm using 'expression()' in R plots in order to get italicized text.
> But it appears as if I cannot use Unicode symbols inside 'expression'
> outside of ASCII characters. Is there some way I can work around this?
> My goal is to get the 'fi'
Hello,
Try the following.
> class(NA)
[1] "logical"
> class(NaN)
[1] "numeric"
> class(Inf)
[1] "numeric"
So my guess is that what the op wants is not possible. And that to
declare a new class shouldn't solve the problem.
Rui Barradas
Em 10-11-2013 21:07, Bert Gunter escreveu:
Charles:
T
On 13-11-10 4:52 PM, Rui Barradas wrote:
Hello,
Try the following.
> class(NA)
[1] "logical"
This doesn't actually prove anything, since there are multiple different
objects that display as NA. For example:
> 1+NA
[1] NA
> class(1+NA)
[1] "numeric"
See ?"NA" for other ways to represent
On 11/11/2013 04:57 AM, Alaios wrote:
Hi all,
I am plotting very nice looking mattrices with plotrin...
so far so good, I would like though to ask you if it would be possible to add
at the bottom of the color.legend (this lovely color bar that maps colors to
numbers).
Would that be possible
Hello
I've written previously about my problem with the Nadaraya-Watson kernel
estimator
this is a copy of my message
---
Hello
i want to compute the Nadaraya-Watson kernel estim
On 13-11-10 1:16 PM, Jeff Newmiller wrote:> There seems to be some
inappropriate quoting in the tabular function from
> the tables package. Consider this example:
>
> library(tables)
> sampledf <- data.frame( Manufacturer=c(rep("Joe & Co.",6)
> ,rep("\\tabu
On 13-11-10 1:16 PM, Jeff Newmiller wrote:
There seems to be some inappropriate quoting in the tabular function from
the tables package. Consider this example:
This turned out to be different than I thought at first. It was simply
that I mis-used the latexTranslate function from the Hmisc pac
Thanks! It worked.
Regards
Alex
On Monday, November 11, 2013 12:02 AM, Jim Lemon wrote:
On 11/11/2013 04:57 AM, Alaios wrote:
> Hi all,
>
> I am plotting very nice looking mattrices with plotrin...
>
> so far so good, I would like though to ask you if it would be possible to add
> at t
Dear all,
Could anyone help me annotate and decode the below codes?
Many thanks in advance.
Best,
coverage.col <- rep(0, length(mean))
coverage.col[coverage=="a"] <- rainbow(50)[30]
coverage.col[coverage=="b"] <- rainbow(50)[15]
coverage.col[coverage=="c"] <- rainbow(50)[8]
coverage.col[cove
This is not a homework assistance forum. You really need to use the resources
provided by your educational institution for that. Please read the Posting
Guide, and note for future reference that HTML email distorts your R code so it
is not appropriate on this list.
As regards your question, you
Hi,
Im new R users. In my research I use rainfall data and Im interested in
estimating missing data. I would like to use Normal Ratio Method to
estimate missing data. My problem is, how do I introduce missing data
randomly within my complete set of data?
Stn ID Year Mth Day Amount
4860
31 matches
Mail list logo