Dear Thomas,
list.files() will be your new best friend.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525
You are looking for the round_date(), floor_date() or ceiling_date() functions
from the lubridate package. Those functions can round timestamps to weeks.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team
Dear John,
R-sig-mixed-models is more suited for this kind of questions. All follow-up
mail should be posted only to that mailing list.
It seems like varIdent() by default relevels the grouping factor and that the
user cannot control this.
Best regards,
ir. Thierry Onkelinx
Instituut voor nat
Dear Tom,
Does ggplot(data,aes(x=x,y=y))+geom_point(aes(color=group))+facet_wrap(~group +
id) gives what you need?
Note that facet_grid by design aligns the subplots into rows and columns with
the same level.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research
r can be extracted from a given body of data.
~ John Tukey
Van: Tom Wright [mailto:t...@maladmin.com]
Verzonden: woensdag 7 januari 2015 15:43
Aan: ONKELINX, Thierry
CC: R. Help
Onderwerp: Re: [R] ggplot with sparse layout
Thanks, this is pretty good. Unfortunately I made an error in generating th
Dear Molly,
Is the package in which the data is stored loaded in the Rmd? If not try
library(yourPackage)
data(yourData)
or
data(yourData, package = "yourPackage")
If this doesn't solve your problem, please provide a minimal reproducible
example of the problem.
Best regards,
Thierry
ir. Th
Dear Xochitl,
Have a look at gls() from the nlme package. It allows you to fit auto
correlated errors.
gls(k ~ NPw, correlation = corAR1(form = ~ Time))
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwalit
It is ggplot (double G), not qqplot (double Q)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
th
It is possible to do without loops if you start by calculating the totals. Then
is just aggregating and merging data.
Best regards,
Thierry
set.seed(21)
n.country <- 5
average.price <- runif(n.country, max = 200)
price <- expand.grid(
Product = 1:10,
Country = factor(LETTERS[seq_len(n.coun
You are using ggplot2 very inefficiently. Many geom's plot only one data point.
You can combine several of them in a single geom. Have a look at this gridExtra
package which has some useful functions like grid.arrange and tableGrob.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en b
Dear Barry,
You have to rethink the input format. This is easy if you use a matrix.
A <- cbind(A_01, A_02, A_03, A_04)
index <- cbind(seq_along(VFD_ID), VFD_ID)
A[index]
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Bi
You want na.action = na.exclude. Or remove rows with NA values from your
dataset. Which is IMHO the safest way to build a model.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assu
pm miao [mailto:miao...@gmail.com]
Verzonden: dinsdag 21 oktober 2014 11:35
Aan: ONKELINX, Thierry
CC: r-help
Onderwerp: Re: [R] Dealing with NAs in lm or gmm
I tries "na.action = na.exclude" but it returns a fitted vector with NAs
removed.
Is there any way to return the fitted vector wit
Dear Guido,
Do you know how the gdb is stored? I had problems reading for a gdb on our
networkdrive. Reading from a local copy worked. It turned out that the original
copy on the networkdrive was indexed. Reading an unindexed gdb from the
networkdrive was no problem.
Best regards,
ir. Thierry
No that is not a bug. You are confusing order() with sort(). Please do read the
helpfiles.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Dear Petr,
You need to use aes_string() instead of aes().
The.cols <- colnames(data)[n:m]
for (i in The.cols) { p<-ggplot(data, aes_string(x="x", y= i, colour="f"))),
...}
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team
Have a look at the buffer function in the adehabitat package.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwalitei
Buffer works on a 2D dataset like a matrix. Have a look at the examples
in ?buffer. But you probably will have to create a set of coordinaten of
the points you want to buffer.
HTH,
Thierry
ir. Thierry Onkelinx
Instit
Dear Megh,
You need to use the ggplot2 package instead of ggplot. Use the size
argument in geom_point() to get bigger circles. Have a look at Hadley's
website for more info (and examples) on ggplot2:
http://had.co.nz/ggplot2/
library(ggplot2)
library(mnormt)
Sigma = matrix(c(1, 0.6, 0.6, 1), 2,
Alessandro,
Have a look at the gstat package.
library(gstat)
demo(examples)
demo(krige)
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biomet
Sascha,
Have a look at ?krige in the gstat package.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg /
Something like sort(c(x, y)) should do the trick.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Sec
(x1 + x2 + x3) ^2 will give you the main effects and the interactions.
So this will shorten your equation to
ft <- lm(y ~ (x1 + x2 + x3) ^2 + I(x1 * x1)+ I(x2 * x2) + I(x3 * x3),
mydata)
HTH,
Thierry
ir. Thierry Onke
Kevin,
Open a new plot window before plotting the second plot.
plot(rnorm(10), runif(10))
X11()
plot(rnorm(10), runif(10))
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Instit
Dear Denise,
It looks like you want to replace all NA with 0 in the dataset? The code
below should do that trick without loops. And it will be rather fast.
dat[is.na(dat)] <- 0
> dat <- matrix(rbinom(40, 1, 0.75), ncol = 4, nrow = 10)
> dat[dat == 0] <- NA
> dat
[,1] [,2] [,3] [,4]
[1,]
Dear Frederike,
#Both your functions are vectorized. So you don't need loops. Working
with vectorized functions is much faster than looping.
fn <- function (x) {
ifelse(x>46 & x<52, 1, 0)
}
res <- fn(40:60)
fn <- function (x,y) {
ifelse(x>46 & x<52 & y<12, 1, 0)
}
datagrid <- exp
Or simply
Datagrid <- expand.grid(rep(list(0:1), 8))
apply(Datagrid, 1, paste, collapse = "")
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel bi
Dear Alessandro,
For the vgm-helpfile:
"Anisotropy parameters define which direction this is (the main axis), and how
much shorter the range is in (the) direction(s) perpendicular to this main
axis."
Notice that the directions should be perpendicular. 90° and 45° are not
perpendicular.
Please
Look at %in% or match
"foo" %in% x
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
Another option is ?by
test <- as.data.frame(cbind(c(rep(1,5),rep(2,5)), rnorm(10), rnorm(10)))
names(test)[1] <- "groupID"
test$groupID <- factor(test$groupID)
by(test[, -1], test$groupID, mean)
HTH,
Thierry
ir. Thie
Dear Sorn,
It's hard to guess what your problem is, as you don't provide any sample
code. My guess is that the graphics are empty. Did you use
print(qplot(...)) or just qplot(). The latter won't work. You need
print(qplot(...))
HTH,
Thierry
-
Dear Robert,
Try ggplot2
library(ggplot2)
ggplot(your.dataframe.name, aes(x = age, y = score, group = subject)) +
geom_line()
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Inst
Dear Steven,
Take a look at the lmList function in the nlme package. It does what you
want to do.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
C
Just use as.numeric. Non numeric will be NA. So the solution of your
problem is na.omit(as.numeric(temp1))
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and
Here's a solution with ggplot2
library(ggplot2)
ggplot(na.omit(d), aes(x = EPT.Taxa, colour = Site)) + geom_density()
ggplot(na.omit(d), aes(x = EPT.Taxa)) + geom_density() + facet_grid(Site
~ .)
HTH,
Thierry
ir. Th
On a windows machine you get the same problem. Useless one uses tha same
trick as Rolf suggested: don't install the packages in the default
directory and set R_LIBS to that directory. Then all you need to do
after an upgrade is to set R_LIBS in the new version and run
update.package(checkBuilt = T
Kevin,
Notice the subtle difference between Hadley's and your code:
Hadley
m2008$DayOfYear <- factor(m2008$DayOfYear, levels = 1:365)
Kevin
m2007$DayOfYear <- factor(m2008$DayOfYear, levels = 1:365)
Your are using the m2007 object instead of the suggested m2008 object!
HTH,
Thierry
--
Dear Paul,
How are you generating (saving) your plots? I tend to play with the
pointsize argument of the graphical device, something in conjunction
with the size argument in ggplot2 (size of points and lines). Working
like that I get plots with nicely propotioned labels without overlaps.
HTH,
T
A more generic solution is
allComb <- expand.grid(rep(list(letters[1:5]), 7))
whichComb <- sapply(seq_len(ncol(allComb) - 1), x = allComb, function(i,
x){
whichCombination <- sapply(seq(i + 1, ncol(x)), y = x, function(j,
y){
as.numeric(y[, i]) <= as.numeric(y[, j])
})
apply(w
Try to add options(stringsAsFactors = FALSE) in your Rprofile.site (in
the etc directory). Using as.is = TRUE seems safer than stringsAsFactors
= FALSE in the read.fwf function. Because as.is is set to FALSE by
default and stringsAsFactors is not set.
HTH,
Thierry
-
an: r-help@r-project.org
Onderwerp: Re: [R] Avoiding factors and levels in data frames
On 01-Sep-08 08:20:25, ONKELINX, Thierry wrote:
>
> Try to add options(stringsAsFactors = FALSE) in your Rprofile.site
> (in the etc directory). Using as.is = TRUE seems safer than
> stringsAs
Antje,
Have a look at ?hist. It seems like you want this:
data <- rnorm(100)
hist(data, xlim = c(0,6))
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and F
Lara,
The first category is nor missing, nor ignored. It is used as the
reference. So the temperature effect for semio1 is only temperature. The
temperature effect for semio2 is temperature + temperature:semio2. For
semio3 it is temperature + temperature:semio3. Hence the main effect of
temperatur
Brian,
The easiest way is to create the entire timeseries and then set the
missing values to NA. The NA values will lead to the gaps you want.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
Dear Robin,
RSiteSearch("skewness", restrict = "functions") gave me 222 hits. There
are several functions that calculate skewness.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research I
It's much easier to extract that info from lm itself.
Model <- lm(Intensity ~ Time, data = totalD, subset = Name ==
"increase1")
coef(Model)
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek /
Dear John,
You need to change colour = "darkgreen" into aes(colour = Food). This
will give a different colour along Food.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute
Another option is to use ggplot2
Dataset <- data.frame(x = runif(100, -5, 5))
Dataset$y <- 3 + 2 * Dataset$x + rnorm(100, sd = 2)
library(ggplot2)
ggplot(Dataset, aes(x = x, y = y)) + geom_smooth(method = "lm") +
geom_point()
-
hat a reasonable answer can be extracted from a given body of data.
~ John Tukey
-Oorspronkelijk bericht-
Van: John Kane [mailto:jrkrid...@yahoo.ca]
Verzonden: dinsdag 11 augustus 2009 16:38
Aan: r-h...@stat.math.ethz.ch; ONKELINX, Thierry
Onderwerp: RE: [R] ggplot: colours to geom_segments
&
This can be done much easier and transparent with ggplot2
library(ggplot2)
ggplot(mtcars, aes(x = factor(round(wt)), y = mpg, colour = factor(am)))
+ geom_boxplot() + geom_point(stat = "summary", fun.y = "mean", position
= position_dodge(width = 0.75))
HTH,
Thierry
not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey
Van: Tal Galili [mailto:tal.gal...@gmail.com]
Verzonden: woensdag 12 augustus 2009 12:48
Aan: ONKELINX, Thierry
CC: r-help@r-project.org
Onderwerp: Re: [R] A fun
Here is an example in pseudo code.
Instead of
Object <- function that can generate error
Other things to do
Do something like
Object <- try(function that can generate error)
if(class(Object) == "try-error"){
things to do when an error occures
} else {
other things to do
}
HTH,
Dear all,
I am struggling with a problem and I am hoping that somebody could point
me in the right direction.
I am trying to match the locations of two peak patterns. A is the true
pattern. B is the measured pattern. Hence A and B have a very strong
linear relationship. The problem is that B can
Dear Steve,
You need something like this.
cast(Latitude ~ Longitude, data = finalframe, value = "Blaney", fun =
mean)
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for
ggplot2 has it's own build in wrapper-function to store plots: ggsave.
p <- ggplot(a,aes(x=V1,colour=V2,fill=V2)) + geom_density(alpha =
0.2,xlim=c(-10,10),ylim=c(0,0.5))
ggsave(p, filename = "/alpha/dtc.pdf")
HTH,
Thierry
Dear Jason,
Both models have a correct syntax. Although I would write the last model
rather as lmer(DV ~ IV1 + IV2 + (1|Subject) + (IV1 - 1| Subject) + (IV2
- 1| Subject))
The only difference is indeed the correlation between the random
effects. The random effects in the model I wrote are all ind
Dear Chris,
First of all I would go for the density plot. The 'extra' info from the
histogram is just noise. So I guess you are not interessed in it.
ggplot(xy, aes(x=value, colour=case, group=case)) + geom_density()
But is you want to stick with a histogram then I would use one of the
two below
Dear Chris,
That problem is due to the fact that ggsave() and png() use different
default for the resolution. ggsave() uses 300 dpi and png() 72 dpi. If
you set the resolution in ggsave() to 72 then you get exactly the same
output as on the screen. But the resolution is way to low for
publication
Dear Christoph,
Why should (1) not work? As long as you have enough levels, it should
not be a problem. You need at least 6 levels for each random effect.
When you have less than six levels, then you better move those variables
to the fixed effects.
An example: 2 blocks with each 2 plots. Each pl
Have a look at the ggplot2 package. You will find a lot of examples at
http://had.co.nz/ggplot2/
library(ggplot2)
dataset <- data.frame(x = seq(-1, 1, length = 101))
dataset$y <- dataset$x + dataset$x^2
dataset$z <- 10 * dataset$x + 1
ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_point()
Show us how you extract the confidence interval from the functions in
the hdrcde library and then we might be able to help you.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Ins
Have a look at the reshape package.
Assuming that your data is in a data.frame called "dataset".
cast(Date ~ ., data = dataset, value = "count", fun = sum)
cast(Date ~ class, data = dataset, value = "count", fun = sum)
cast(Date + class ~ ., data = dataset, value = "count", fun = sum)
Or the
Dear Robert,
Since you have only 4 sites, a random effect is not so good. You would
need at least 6 sites for a good estimate of the variance. You have
enough data to treat site as a fixed effects. It only costs 2 extra
degrees of freedom. Therefore I would model this like:
lm(response ~ (area/s
Remove the y=c2 from your histogram plot.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, metho
Have a look at the gls() function from the nlme package. The helpfile of gls()
contains an example of an AR1 structure.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute fo
Have a look at the ggplot2 package.
library(ggplot2)
dat <- read.table("mydat.txt")
ggplot(dat, aes(x = V1, colour = factor(V2))) + geom_density()
#or a few alternatives
ggplot(dat, aes(x = V1, fill = factor(V2))) + geom_density(alpha = 0.2)
ggplot(dat, aes(x = V1)) + geom_density() + facet_wrap(
some data and an aching desire for an answer does not ensure
that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-Oorspronkelijk bericht-
Van: Gundala Viswanath [mailto:gunda...@gmail.com]
Verzonden: woensdag 2 september 2009 14:33
Aan: ONKELINX, Thierry
CC
some data and an aching desire for an answer does not ensure
that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-Oorspronkelijk bericht-
Van: Gundala Viswanath [mailto:gunda...@gmail.com]
Verzonden: woensdag 2 september 2009 14:47
Aan: ONKELINX, Thier
.com]
Verzonden: woensdag 2 september 2009 14:54
Aan: ONKELINX, Thierry
CC: r-h...@stat.math.ethz.ch
Onderwerp: Re: [R] Howto Superimpose Multiple Density Curves Into One Plot
> str(dat)
'data.frame': 200 obs. of 2 variables:
$ V1: num 0.98 0.19 1.09 0.21 0.26 0.98 0.31 0.88 0.23 0.2 ..
-
Van: Gundala Viswanath [mailto:gunda...@gmail.com]
Verzonden: woensdag 2 september 2009 15:21
Aan: ONKELINX, Thierry
CC: r-h...@stat.math.ethz.ch
Onderwerp: Re: [R] Howto Superimpose Multiple Density Curves Into One Plot
Which version of ggplot2 you use?
Mine is:
Version: 0.7
Date:
Here is a solution assuming that all files have the same structure and a
variable TimePoint which contains the time info.
CombinedData <- do.call(rbind, lapply(seq_len(20), function(i){
fileName <- paste("output", i, ".dat", sep="")
read.table(fileName, header=TRUE)
}))
library(ply
That is not very complex with densities instead of counts.
library(ggplot2)
ggplot(mtcars, aes(x = mpg)) +
geom_histogram(aes(y = ..density..), fill = "red") +
stat_function(
fun = dnorm,
args = with(mtcars, c(mean = mean(mpg), sd = sd(mpg)))
Using tail() for the selection is more elegant and slightly faster.
> N<- 100
> x <- runif(N)
> system.time(x[order(x)[c(N-1,N)]])
user system elapsed
1.080.011.10
> system.time(sort(x)[c(N-1,N)])
user system elapsed
0.360.000.35
> system.time(tail(sort(x), 2)
You could use a glm with the binomial family to model that.
A solution with ggplot2
library(ggplot2)
ggplot(dataset, aes(x = x, y = y, weights = n)) +
geom_smooth(method = "glm", family = binomial)
geom_point()
Have a look at glht() from the multcomp package. That will allow you to
specify the contrasts for posthoc tests.
A more direct approach is the create the required dummy variables
yourself.
HTH,
Thierry
ir. Thierry Onk
Dear Wen,
Since each worker only works on one machine, your model fm2 does not
make sense. Your random effects tries to model how the effect of each
worker differs between machines. But you don't have that kind of
information if a work only works one machine.
HTH,
Thierry
Here is a solutions using ggplot2 and reshape
library(reshape)
library(ggplot2)
data <- data.frame(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56,
1.08), fkest = c(11.85, 17.78, 8.89, 1.48))
Molten <- melt(data, id.vars = "k")
ggplot(Molten, aes(x = k, y = value, colour = variable)) + g
Dear Steve,
Here are a fex examples for empirical variograms using ggplot2
library(gstat)
library(ggplot2)
data(meuse)
coordinates(meuse) = ~x+y
vgIso <- variogram(log(zinc)~x+y, meuse)
vgIso$id <- "iso"
vgAniso <- variogram(log(zinc)~x+y, meuse, alpha=c(0,45,90,135))
vgAniso$id <- "aniso"
Empir
Dear Sock,
I'm wondering if that mean_sdl function is return what you are
expecting. I would calculate the statistics outside ggplot.
RibbonData <- ddply(dat.less, "Day", function(x){
mean(x$Y) + c(ymin = -1, ymax = 1) * sd(x$Y)
})
p + stat_summary(data=dat.less, aes(group=1), geom="cross
You might need to change the type quantile. The default is type = 7,
whereas default for SAS is type = 3 and for SPSS type = 6. Have a look
at the helpfile of quantile() for more details on the type.
HTH,
Thierry
ir.
Dear Denis,
Have a look at the lme() and nlme() functions, both in the nlme package.
You find more details in Pinheiro & Bates (2000).
A linear trend over time:
lme(Y ~ Year, random = ~1|Department/Person)
Contrasts between years:
lme(Y ~ factor(Year), random = ~1|Department/Person)
You might w
rep() is your friend.
HTH,
Thierry
> x <- c(86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138,
> 142, 146, 150, 154, 158, 162, 166, 170, 174)
> y <- c(2, 5, 10, 17, 26, 60, 94, 128, 137, 128, 77, 68, 65, 60, 51, 26, 17,
> 9, 5, 2, 3, 7, 3)
> rep(x, y)
[1] 86 86 90 90
Dear Beto,
The code below gives a correct result.
library(ggplot2)
df <- data.frame(
trt = factor(c("intact", "intact", "removed", "removed")),
coon = c(0.093, 0.06, 0.057, 0.09),
group = factor(c("veget", "fruit", "veget", "fruit")),
se = c(0.01, 0.01, 0.02, 0.0
Have a look at this presentation of Matthew Keller:
http://www.matthewckeller.com/Lecture1.ppt
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstra
Dear Daryl,
1) use pdDiag to get indepedent random effects.
lme(Y ~ disease, random = list(radiologist = pdDiag(~disease)), weight =
varGroup(~disease))
2) lmer can't handle variance structures like nlme can. I believe it is
on Douglas Bates to do list. But rather at the bottom of it.
HTH,
Thie
Andriy,
It does exactly what you want it to do. So if the result is not what you
expected, then you are supplying R with a wrong command.
If you would have read the helpfile of read.csv you would have noticed
the sep and dec argument would be very useful in this case.
Thierry
-
Dear Deepak,
You'll need to clarify what EXACTLY is happening? If empty plots are
created then try to wrap the plot() in print() statements.
print(plot(...)).
Furthermore I would recommend to avoid attach.
HTH,
Thierry
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)
cuts <- unique(diamonds[, c("cut", "A")])
cuts <- cbind(cuts, predict(dmod, cuts, se=T)[c
Have a look at ?write.table
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and qua
Dear all,
I'm using Roxygen for the first time and I'm getting a rather cryptic
error message. I must be doing something wrong but I have no clue what
is it. Any suggestions?
Regards,
Thierry
roxygenize("AFLP", roxygen.dir = "AFLP", copy.package = FALSE,
unlink.target = FALSE)
Writing AFLP.outl
Dear Saurav,
I get the feeling that you are looking for mixed models. Try something
like.
library(lme4)
glmer(s ~ age + gender + gemedu + gemhinc + es_gdppc + imf_pop +
estbbo_m + (1|yearctry), family = binomial(link = "probit"), data =
adpopdata)
HTH,
Thierry
Dear Thomas,
You don't need parse()
X <- c(mean = 2, sd = 3)
pnorm(0, mean = X["mean"], sd = X["sd"])
Have a look at
library(fortunes)
fortune(106)
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en boso
Dear Mo
You only need to use the name of a variable in your dataframe. The
example below lets the size of the points depend on the variable carat.
library(ggplot2)
ggplot(diamonds, aes(x = table, y = price, size = carat)) + geom_point()
HTH,
Thierry
---
Have a look at the reshape and ggplot2 package.
ds <- matrix(rnorm(100), nrow = 10)
library(reshape)
molten <- melt(data = ds)
library(ggplot2)
ggplot(molten, aes(x = X1, y = X2, z = value)) + geom_contour()
HTH,
Thierry
---
Well, you did not specify the dataset. You want:
ds <- data.frame(dat1 = rsn(1000, 0, 1, 0))
ggplot(ds, aes(x = dat1)) + geom_histogram(aes(y = ..density.., fill =
..count..)) + xlab("Distribution") + scale_y_continuous("")
HTH,
Thierry
Have a look at the colour argument of geom_line()
http://had.co.nz/ggplot2/geom_line.html
You need colour = A_Factor_With_Names_Of_Timeseries
I recommend to you read the first chapters of Hadley's book on ggplot2
(it's on the ggplot2 website). That will answer much of your basic
ggplot2 questions
Have a look at Sweave (in the utils package) or the R2HTML package.
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en k
Dear Alisia,
These are not very easy questions to answer without detailed knowledge
on your design. That's probably why you did not get any responses so far
(I've seen your mail pop-up several times). I would recommend that you
seek guidance with your supervisor or with the local statistician.
Ha
Dear Angela,
lme() is a part of the nlme package. The lme4 package has the function
lmer() which is the equivalent of lme() from nlme. Both function differ
in their capabilities. Briefly: lmer() can (easly) do crossed random
effects and GLMM, lme() can handle variance and correlation structures.
Have a look at ?read.table
HTH,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
method
1 - 100 of 618 matches
Mail list logo