Dear HC
On 30 June 2013 18:53, hck wrote:
> Generally I would have the following equations X_i = IV3_i + IV4_i * Y_i
> applying for every company (i). In a first step, I am interested in
> estimating the relationship between X and Y: Y_i = a + b * X_i + u to
> ultimatly estimate X_i by substituti
Hi,
May be this helps:
dat1<- read.table(text="
Country, Pet
France, Dog
France, Cat
France, Dog
Canada, Cat
Canada, Cat
Japan, Dog
Japan, Cat
Italy, Cat
",sep=",",header=TRUE,stringsAsFactors=FALSE)
dat1[with(dat1,as.numeric(ave(Pet,Country,FUN=function(x)
length(unique(x)>1,]
# Country
I think you ought to take a look at
fortune("Lewis Carroll")
cheers,
Rolf Turner
On 14/07/13 01:45, Simon Zehnder wrote:
Hi Duncan,
thank you very much for your advice! That makes it all work.
I check in addition for a "title" argument in the device via
if (any(names(getO
try this:
> x <- read.csv(text = "Country, Pet
+ France, Dog
+ France, Cat
+ France, Dog
+ Canada, Cat
+ Canada, Cat
+ Japan, Dog
+ Japan, Cat
+ Italy, Cat", as.is = TRUE)
> # split by Country and then see if dups in "Pet"
> xs <- split(x, x$Country)
> Dups <- do.call(rbind
+ , lapply(xs,
Hi,
I want to select elements which have duplicates by are not all duplicated.
Here is what I mean. Suppose I have a two column matrix with columns
"Country" and "Pet"
Country, Pet
--
France, Dog
France, Cat
France, Dog
Canada, Cat
Canada, Cat
Japan, Dog
Japan, Cat
Italy, Cat
I
I tried it on a slightly bigger dataset:
A1 <- matrix(t(expand.grid(1:90, 15, 16)), nrow = 3)
B1 <- combn(90, 3)
which(is.element(columnsOf(B1), columnsOf(A1)))
# [1] 1067 4895 8636 12291 15861 19347 22750 26071 29311 32471 35552 38555
#[13] 41481
which(apply(t(B1),1,paste,collapse="")%in%appl
Hi,
One way would be:
which(apply(t(B),1,paste,collapse="")%in%apply(t(A),1,paste,collapse=""))
#[1] 105 196 274 340 395
B[,105]
#[1] 1 15 16
B[,196]
#[1] 2 15 16
B1<-B[,!apply(t(B),1,paste,collapse="")%in%apply(t(A),1,paste,collapse="")]
dim(B1)
#[1] 3 555
dim(B)
#[1] 3 560
#or
B2<-B[,
Try
columnsOf <- function(mat) split(mat, col(mat))
newB <- B[ , !is.element(columnsOf(B), columnsOf(A))]
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of Thiem A
Hi,
as.integer(dat$COUNTRY) # would be the easiest (Rui's solution).
Other options could be also used:
library(plyr)
as.integer(mapvalues(dat$COUNTRY,levels(dat$COUNTRY),seq(length(levels(dat$COUNTRY)
# [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4
#or
match(dat$COUNTRY,levels(dat$COUNTRY))
Hi,
"when the value of Debut of lines i = value Fin of lines i-1"
That part is not clear esp. when it is looked upon with the expected output
(df2). Also, in your example dataset:
df1$contrat[grep("^CDD",df1$contrat)]
#[1] "CDD détaché ext. Cirad" "CDD détaché ext. Cirad" "CDD détaché ext. Cirad
Dear list,
I have two matrices
A <- matrix(t(expand.grid(c(1,2,3,4,5), 15, 16)), nrow = 3)
B <- combn(16, 3)
Now I would like to exclude all columns from the 560 columns in B which are
identical to any 1 of the 6 columns in A. How could I do this?
Many thanks and best wishes,
Alrik
_
Hi Duncan,
thank you very much for your advice! That makes it all work.
I check in addition for a "title" argument in the device via
if (any(names(getOption("device")) == TRUE)) {
dev.new(title = "title")
}
Thanks again!
Simon
On Jul 13, 2013, at 2:40 PM, Duncan Murdoch wrote:
> O
Hello,
It's better if you keep this on the list, the odds of getting more and
better answers is greater.
Inline.
Em 13-07-2013 15:38, serenamas...@gmail.com escreveu:
Hi Rui,
thanks for your reply.
No, my problem isn't one of reshaping. It is just that I want R to know I have
a panel and n
We really need to see the data, I think.
You can use the function dput(), see ?dput
dput(filename) will give you a formatted output that you can just copy and
paste into an e-mail. An R-help reader can just copy and paste that into R and
have an exact copy of your data set.
John Kane
Kingston
Here is how you can do it with the 'data.table' package:
> require(data.table)
> df1 <- data.table(df1)
> result <- df1[
+ , list(Debut = Debut[1L] # first entry
+ , Fin = Fin[1L]
+ )
+ , keyby = c("Matricule", "Nom", "Sexe", "DateNaissance", "contrat",
"Pays")
+ ]
> result
MatriculeN
Hello,
It would be better if you post a data example. Like this, I will make up
one. I'm not sure I understand the question, but if you want to change
your data from long to wide format there are several ways of doing it.
# Make up some data
dat <- data.frame(
year = rep(1:2, each =
On 13-07-13 1:33 PM, Simon Zehnder wrote:
Dear R-Users,
I am writing a package using S4 classes. In the generic method "plot" I want to
set the title for the plotting window as I will have several windows and window titles
help the users to distinguish the graphics without putting a title into
Hi,
I am new to R and am a STATA user. I am using R as I need the np package to
perform a local linear non parametric regression on a panel data of
countries. My data contains 138 countries, each observed for 31 years, from
1981 to 2011.
I am aware of the panel package in R which sets the data in
Dear R-Users,
I am writing a package using S4 classes. In the generic method "plot" I want to
set the title for the plotting window as I will have several windows and window
titles help the users to distinguish the graphics without putting a title into
the plot itself (this can be done by users
Considering that I devised the code initially on a computer with only 8K
bytes for program and data, and it appears that your problem has 1
parameters, I'm surprised you got any output. I suspect the printout is
the BUILD phase where each weight is being adjusted in turn by the same
shift.
Zhao Jin cornell.edu> writes:
> I am using the capscale function in vegan_2.0-7 to do a constrained
> principal coordinates analysis, and I kept getting the following error
> message:
> Error in Y.r[, oo, drop = FALSE] : subscript out of bounds
>
> I googled but I couldn't find an answer. Could
Dear Kathrinchen
It seems to me that your question is about statistics rather than
about R and systemfit. If you find out how the statistical test should
be conducted theoretically, I can probably advise you how to implement
the test in R (systemfit).
Best wishes,
Arne
On 11 July 2013 13:21, Ka
22 matches
Mail list logo