Dear All, Happy new year! wonder if you could help with the following: we have: hist(runif(1000,0,100),xlab=expression(AUC[0 - 24]~ (xyz)),ylab="Frequency") the plan is to have part of the xlab expression change dynamically, specifically the values of 0 and 24 should be able to update 'automatically" , based on vectors low and high, so if we had: low <-24 high <-48 then we should have this: hist(runif(1000,0,100),xlab=expression(AUC[24 - 48]~ (xyz)),ylab="Frequency") appreciate your insights, Andras [[alternative HTML version deleted]]
Hi,May be this helps: ? hist(runif(1000,0,100),xlab=bquote(AUC[.(low) - .(high)]~ (xyz)),ylab="Frequency") A.K. On Wednesday, January 1, 2014 10:30 AM, Andras Farkas <motyocska at yahoo.com> wrote: Dear All, Happy new year! wonder if you could help with the following: we have: hist(runif(1000,0,100),xlab=expression(AUC[0 - 24]~ (xyz)),ylab="Frequency") the plan is to have part of the xlab expression change dynamically, specifically the values of 0 and 24 should be able to update 'automatically" , based on vectors low and high, so if we had: low <-24 high <-48 then we should have this: hist(runif(1000,0,100),xlab=expression(AUC[24 - 48]~ (xyz)),ylab="Frequency") appreciate your insights, Andras ??? [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Dear All,
From the dataframe df1
df1 <-
structure(list(Nom = structure(1:9, .Label = c("A1", "A2",
"A3",
"B1", "B2", "C1", "C2", "C3",
"C4"), class = "factor"), Pays1 = c(1,
1, 0, 0, 1, 0, 0, 0, 0), Pays2 = c(0, 0, 0, 1, 1, 0, 1, 0, 1),
Pays3 = c(0, 0, 0, 0, 1, 0, 0, 0, 0), Pays4 = c(1, 0, 0,
0, 0, 0, 1, 0, 1), Pays5 = c(1, 1, 0, 0, 0, 0, 0, 0, 0)), .Names =
c("Nom",
"Pays1", "Pays2", "Pays3", "Pays4",
"Pays5"), row.names = c(1L,
3L, 4L, 2L, 5L, 6L, 7L, 8L, 9L), class = "data.frame")
I look for a way to build the new dataframe df2
df2 <-
structure(list(Nom = structure(1:9, .Label = c("A1", "A2",
"A3",
"B1", "B2", "C1", "C2", "C3",
"C4"), class = "factor"), Pays1 = c(1,
1, 1, 1, 1, 0, 0, 0, 0), Pays2 = c(0, 0, 0, 1, 1, 1, 1, 1, 1),
Pays3 = c(0, 0, 0, 1, 1, 0, 0, 0, 0), Pays4 = c(1, 1, 1,
0, 0, 1, 1, 1, 1), Pays5 = c(1, 1, 1, 0, 0, 0, 0, 0, 0)), .Names =
c("Nom",
"Pays1", "Pays2", "Pays3", "Pays4",
"Pays5"), row.names = c(NA,
-9L), class = "data.frame")
The purpose is to transform df1 it df2 by giving for every group of lines A, B
and C the value 1 if there is at least a value equal to 1 or a value 0 if there
is no value equal to 1
Thanks for your helps
--
Michel ARNAUD
Charg? de mission aupr?s du DRH
DGDRD-Drh - TA 174/04
Av Agropolis 34398 Montpellier cedex 5
tel : 04.67.61.75.38
fax : 04.67.61.57.87
port: 06.47.43.55.31