Re: [R] Prediction of response after glm on whitened data

2015-01-28 Thread ONKELINX, Thierry
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

Re: [R] Suggestions for workaround for R Markdown problem with data() ?

2015-01-12 Thread ONKELINX, Thierry
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.

Re: [R] ggplot with sparse layout

2015-01-07 Thread ONKELINX, Thierry
: 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 the sample dataframe, this code better represents the situation

Re: [R] ggplot with sparse layout

2015-01-06 Thread ONKELINX, Thierry
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 /

Re: [R] nlme package: changing reference for varIdent parameter estimates in summary.gls

2014-12-23 Thread ONKELINX, Thierry
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

Re: [R] R - Aggregate 3-Hourly Block Data into Weekly (Melt)

2014-12-19 Thread ONKELINX, Thierry
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

Re: [R] Run script automatically on several input files in the directory and produce separate outputs?

2014-12-05 Thread ONKELINX, Thierry
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

Re: [R] ggplot facet and subsetting

2014-11-27 Thread ONKELINX, Thierry
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

Re: [R] the bug of function base::order

2014-11-10 Thread ONKELINX, 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

Re: [R] rgdal: Convert ESRI ArcGis geo database (gdb directory) to geojson, or shapefile map

2014-10-27 Thread ONKELINX, Thierry
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.

Re: [R] Dealing with NAs in lm or gmm

2014-10-21 Thread ONKELINX, Thierry
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

Re: [R] Dealing with NAs in lm or gmm

2014-10-21 Thread ONKELINX, Thierry
...@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 with NAs (In my case, 94*1 matrix)? gmm8-gmm

Re: [R] How to get rid of my for loop

2014-09-29 Thread ONKELINX, Thierry
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

Re: [R] Performance (speed) of ggplot

2014-09-26 Thread ONKELINX, Thierry
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

Re: [R] How to avoid the three loops in R?

2014-08-01 Thread ONKELINX, Thierry
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 =

Re: [R] Trying to change a qplot() to a ggplot()+

2014-07-23 Thread ONKELINX, Thierry
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

Re: [R] Publication-ready figures with two plots

2014-06-19 Thread ONKELINX, Thierry
Dear Adam, ggsave() works only with single ggplot object. You need the standard R way of saving those plots. 1) open a suitable device 2) plot the figures 3) close the device tiff(filename = Figure 1.tiff, scale = 1, width = 10, height = 5, units = cm, dpi = 300) grid.arrange(plot1, plot2,

Re: [R] help in writing an R-function for Residual correlated structures

2014-06-12 Thread ONKELINX, Thierry
R works faster if you can avoid loops the loops. There is an example. Note that it required global variables (like your function). You better avoid that. rspat - function(rhox, rhoy, s2e = 1){ require(matlab) R - s2e * eye(N) i - rep(seq_len(N), each = N) j - rep(seq_len(N), N) j - j[j

Re: [R] aov + pairwise.t.test: only selected pairs

2014-06-11 Thread ONKELINX, Thierry
Have a look at the multcomp package. The examples in glht() demonstrate how to specify the required contrasts. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality

Re: [R] Identifying one or more TRUE in the middle of an array

2014-06-06 Thread ONKELINX, Thierry
Here is my solution. falses - which(!x) first.false - head(falses, 1) last.false - tail(falses, 1) which(x[first.false:last.false]) + first.false - 1 Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

Re: [R] Subsets of a function

2014-05-20 Thread ONKELINX, Thierry
Another option is the plyr package. library(plyr) result - dlply(size, ~ Year +Season, function(.sub){ with(.sub, smooth.spline(Size, Prop, spar = 0.25)) } ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

Re: [R] stop a function

2014-05-14 Thread ONKELINX, Thierry
2014 22:13 Aan: ONKELINX, Thierry; r-packages-ow...@r-project.org; r-help@r-project.org; r-help-requ...@r-project.org Onderwerp: Re: [R] stop a function Hi, Another problem arised now. I got this error: Error in match(x, table, nomatch = 0L) : reached CPU time limit I googled it but nothing could

Re: [R] stop a function

2014-05-13 Thread ONKELINX, Thierry
Have a look at evalWithTimeout() from the R.utils package 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

Re: [R] lme4 Error Help: “maxstephalfit…pwrssUpdate”

2014-04-28 Thread ONKELINX, Thierry
Dear Craig, It is better to ask questions about lme4 at r-sig-mixed-models (in cc). Are you using a recent version of lme4? Try upgrading lme4 and see if you still get the error. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature

Re: [R] linear mixed model for non-normal negative and continous data

2014-04-28 Thread ONKELINX, Thierry
Dear Caroline, Check the homogeneity of the variances. If they are inhomogeneous, you can add a variance function to deal with it. However, you will need to switch to the lme() from the nlme package. Best regards, Thierry PS R-Sig-mixed-models is a better list for this kind of questions.

Re: [R] why does it say all the cases are complete?

2014-04-25 Thread ONKELINX, Thierry
You have no missing data. Note that the string is not missing! You need to code missings as NA. Have look at ?is.na ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-23 Thread ONKELINX, Thierry
Have a look at the knitr package. http://yihui.name/knitr/demo/minimal/ 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

Re: [R] ggplot2: using coord_trans for logit - probability

2014-04-17 Thread ONKELINX, Thierry
Dear Michael, You can use geom_smooth directly. ggplot(pred, aes(x = Age, y = Better)) + geom_smooth(method = glm, family = binomial) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg /

Re: [R] data.table and R package check

2014-03-17 Thread ONKELINX, Thierry
This is workaround by defining the 'global variables' as NULL. Use it with caution. ### Fooling R CMD check transition_group_id - NULL ### Fooling R CMD check setkey(aligtable,transition_group_id,align_origfilename) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research

[R] UTF-8 characters in pandoc template variables using knitr

2014-03-13 Thread ONKELINX, Thierry
Dear all, Consider the simpel RMarkdown file below. I've saved it as test.md with UTF-8 encoding. Notice that I have embedded a custom pandoc variable 'test' in the file. This variable holds an UTF-8 character ©. %My title %The authorslist !--pandoc format: latex V: test:Copyright notice. ©

Re: [R] shapes of woodpeckers' cavities

2014-03-07 Thread ONKELINX, Thierry
Dear Violette, Search for elliptical Fourier analysis. RSiteSearch(elliptical fourier analysis) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance

Re: [R] boxcox alternative

2014-02-24 Thread ONKELINX, Thierry
Dear Michael. The normality of _covariates_ is seldom relevant. The relevance of normality of the _response variable_ depends on the model assumptions. In case of linear models the only the **residuals** (and not the responses) are assumed to be normally distributed. Transformation of

Re: [R] princomp/prcomp packages not available for 3.0.2

2014-02-19 Thread ONKELINX, Thierry
Both are functions (not packages) and available in the stats package. 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

Re: [R] Overlaying two graphs using ggplot2 in R

2014-01-28 Thread ONKELINX, Thierry
Dear Kristi, You could do something like this. ggplot(dat1, aes(x = factor(site), y = Present)) + geom_boxplot(aes(colour = layer)) + geom_line(data = dat2, aes(group = 1, y = present)) + geom_point(data = dat2, aes(y = present)) Note that - ggplot provides no second axis - the boxplots

Re: [R] Publication-ready figures in R?

2014-01-28 Thread ONKELINX, Thierry
Dear Dan, Have a look at ggplot2. It allows to define themes. I've create two theme for our institution: one according our internal styling guide, one according to the styling guide for Elsevier journal. Applying the Elsevier theme to all plots in a script requires just adding

Re: [R] ifelse...

2014-01-16 Thread ONKELINX, Thierry
You want y - ifelse(x == 'a', 1, 2) 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

Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread ONKELINX, Thierry
Dear Michael, Calculate the propotions. Then it is easy to use the weight option of glm data(SpaceShuttle, package=vcd) SpaceShuttle$trials - 6 fm - glm(cbind(nFailures, 6 - nFailures) ~ Temperature, data = SpaceShuttle, family = binomial) fm2 - glm(nFailures/trials ~ Temperature, data =

Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula

2013-12-17 Thread ONKELINX, Thierry
Van: Michael Friendly [frien...@yorku.ca] Verzonden: dinsdag 17 december 2013 19:42 Aan: ONKELINX, Thierry; R-help Onderwerp: Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula Thanks very much for this helpful reply, Thierry Using aes(weight=trials

Re: [R] lmer specification for random effects: contradictory reults

2013-11-25 Thread ONKELINX, Thierry
Dear Benedetta, I think you might want (1+T+Z|subject) as random effects rather than (1+T|subject) + (1 + Z|subject). The latter has two random intercepts per subject: a recipe for disaster. Follow-up posts should only go to the mixed models mailing list which I'm cc'ing. Best regards, ir.

Re: [R] Anova split by factors

2013-11-18 Thread ONKELINX, Thierry
Dear Catalin, Have a look at the plyr package. library(plyr) dlply( eg, .(Exp), function(x) { aov(masa.uscat.tr~Clona,data=x) } ) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and

Re: [R] Sending a matrix in an email

2013-11-18 Thread ONKELINX, Thierry
Have you tried dput(your.matrix)? 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

Re: [R] Problem while reading Data from a data frame

2013-11-05 Thread ONKELINX, Thierry
You don't need a loop nor a growing object. data(mtcars) mtcars mtcars[seq(1, nrow(mtcars), by = 2), ] ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070

Re: [R] Save P values calculated with anova

2013-11-04 Thread ONKELINX, Thierry
You'll need to add quotes MyAnova$Pr(F) Or use the bracket notation MyAnova[, Pr(F)] 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

Re: [R] S3 Methods for Linear Regression

2013-09-09 Thread ONKELINX, Thierry
Dear Harold, An easy work-around would be to pass the names of the variables as a character vector. fm - lm.eiv(y ~ x1 + x2, dat, ind = c(2,3), semDep = 0, semMat = c(sem1, sem2)) And the change your lm.eiv.fit accordingly. Or you could have a look at the .() function of the plyr package.

Re: [R] Sweave: printing an underscore in the output from an R command

2013-09-02 Thread ONKELINX, Thierry
You have to escape the underscore \Sexpr{gsub(_, \_, print(version$platform))} Best regards, Thierry Van: r-help-boun...@r-project.org [r-help-boun...@r-project.org] namens David Epstein [david.epst...@warwick.ac.uk] Verzonden: maandag 2 september 2013

Re: [R] SimpleR

2013-08-27 Thread ONKELINX, Thierry
I think you want the UsingR package 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

Re: [R] arbitrary subset of dataframe

2013-08-26 Thread ONKELINX, Thierry
You've misplaced the comma. mysample - df[, sample(ncol(df), 50, replace=FALSE)] 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 +

Re: [R] Lme4 and syntax of random factors

2013-08-14 Thread ONKELINX, Thierry
Dear Robert, (1|A/B) is shorthand for (1|A) + (1|A:B) 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

Re: [R] Double return statement

2013-08-14 Thread ONKELINX, Thierry
Dear Katherine, Combine both outputs in a list and return that. return(list(first = output.1, second = output.2)) Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality

Re: [R] linking to help pages in other packages

2013-08-09 Thread ONKELINX, Thierry
Dear Jannis, I think you want \link[package]{function} instead of \link[package:function]{function} \link[Rssa]{ssa} Best regards, Thierry Van: r-help-boun...@r-project.org [r-help-boun...@r-project.org] namens Jannis [bt_jan...@yahoo.de] Verzonden:

Re: [R] Varying statistical significance in estimates of linear model

2013-08-08 Thread ONKELINX, Thierry
Dear Stathis, I recommend that you try to get some advice from a local statistician or read an introductory book on statistics. This kind of question is beyond the scope of a mailing list. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for

Re: [R] GGplot 2 – cannot get histogram and box plot axis to match.

2013-07-26 Thread ONKELINX, Thierry
Dear John, Use xlim() and ylim() instead of expand_limits() library(ggplot2) #sample data from ggplot2 data(Cars93, package = MASS) dataSet - Cars93 #variables to calculate the range to extend the axis dataVector - unlist(dataSet[,MPG.city]) dataRange - diff(range(dataSet$MPG.city))

Re: [R] lme (weights) and glht

2013-07-26 Thread ONKELINX, Thierry
Dear Sibylle, Have you tried to create a new variable? ME$fDiversity - factor(ME$Diversity) H08_lme - lme( log(Height2008_mean) ~ fDiversity, data = ME, random = ~ 1|Plot/SubPlot, weights = varPower(form = ~Diversity), na.action = na.omit, subset = ME$Species == Ace_pse, method = ML )

Re: [R] Help to improve prediction from supervised mapping using kohonen package

2013-07-24 Thread ONKELINX, Thierry
Try rescaling your data prior to splitting it up into a training and test set. Otherwise you end up with two different ways of scaling. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics

[R] stopping functions with long execution times

2013-07-18 Thread ONKELINX, Thierry
Dear all, I am running the same model on several datasets, each dataset is a different species. The problem is that for some datasets the model is not converging. Currently I have an INLA model running for 35 days and still no results. The process still uses near 100% of the CPU and less than

Re: [R] stopping functions with long execution times

2013-07-18 Thread ONKELINX, Thierry
...@gmail.com] Namens Henrik Bengtsson Verzonden: donderdag 18 juli 2013 12:43 Aan: ONKELINX, Thierry CC: r-help@r-project.org Onderwerp: Re: [R] stopping functions with long execution times See evalWithTimeout() of R.utils, e.g. tryCatch({ evalWithTimeout({ slowFunction(); }, timeout=7*24*3600

Re: [R] nearest stations in distance matrix

2013-04-15 Thread ONKELINX, Thierry
Dear Eliza, If you have the coordinates of the stations you can use the nnwhich() function from the spatstat package. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality

Re: [R] R crash

2013-04-10 Thread ONKELINX, Thierry
Have a look at the warning in ?geepack::geeglm It should be mentioned in ?geepack::geese as well. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070

Re: [R] RStudio and R version 3.0

2013-04-05 Thread ONKELINX, Thierry
Dear John, According to the Rstudio website you need the latest version of Rstudio to work with R 3.0.0. I had the same problem yesterday (on WinXP). Installing the latest Rstudio solved it. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for

Re: [R] A==A false?

2013-03-07 Thread ONKELINX, Thierry
FAQ 7.31 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 thierry.onkel...@inbo.be www.inbo.be To

Re: [R] combining column having same values

2013-03-06 Thread ONKELINX, Thierry
Dear Eliza, You question is not very clear. I think you are looking for the which() function. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance

Re: [R] Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?

2013-03-06 Thread ONKELINX, Thierry
Dear Anna, Is this what you would like? Summ - ddply(mydata, .(factor3,factor1), summarize, mean = mean(var1, na.rm = FALSE), sdv = sd(var1, na.rm = FALSE), se = 1.96*(sd(var1, na.rm=FALSE)/sqrt(length(var1 Summ$Grouping

Re: [R] Color spalettes for black/white printing

2013-03-05 Thread ONKELINX, Thierry
Have a look at bpy.colors() 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 02 51 + 32 54 43 61 85

Re: [R] urgent: question concerning data manipulation

2013-03-04 Thread ONKELINX, Thierry
Have a look at cast() from the reshape package. library(reshape) cast(personId ~ law, data = testdata, value = article, fun = length) cast(personId ~ law, data = testdata, value = article, fun = function(x){1 * (length(x) 0)}) Van:

Re: [R] to check if a character string is in a group of character strings

2013-01-23 Thread ONKELINX, Thierry
I think you want %in% subpool %in% pool pool %in% subpool 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

Re: [R] column selection

2013-01-02 Thread ONKELINX, Thierry
You have two options. Q[, 117:ncol(Q)] Or using the negation, thus not selecting the first 116 cols. Q[, -1:-116] ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance

[R] Problem loading .Rdata file

2012-12-14 Thread ONKELINX, Thierry
Dear all, I'm having troubles migrating a large matrix from one system to another. #system 1: Ubuntu 12.04, 64-bit, running R 2.15.2 # do some simulations # save the simulations save(Output, file = Simulations.Rdata) #Output is a numeric matrix with 6 columns and about 2M rows. Use ftp to

Re: [R] help with predict.glm, and charting with factors

2012-12-12 Thread ONKELINX, Thierry
Dear Chad, Did you post your entire dataset? If so: 1) your model is too complex for the amount of data you have. See the quotes below... 2) There is complete separation, leading to large parameter estimates and fits very close to 0 and 1 (in terms of probabilities) 3) You fit temperature as a

Re: [R] puzzling RODBC error

2012-12-06 Thread ONKELINX, Thierry
Dear all, Thanks to Marc and Bart for looking in to this. It turns out to be due to a typo of me: I misspelled channel. Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team

[R] puzzling RODBC error

2012-11-26 Thread ONKELINX, Thierry
Dear all, I'm trying to connect to an MSAccess database (ArcGIS personal geodatabase). I keep getting an error about the channel when using sqlQuery(). However, sqlTables() does not complain about the channel and lists all tables in the database. If I try sqlFetch(), then R crashes. I'm happy

Re: [R] aggrete data from combination

2012-11-14 Thread ONKELINX, Thierry
You can use combn(100, 2) to generate the combinations of the plots. It is not clear to me what you want to do with the diameters. You have 4 diameter for plot 1 and 2 for plot 2. What should the output look like? ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute

Re: [R] aggrete data from combination

2012-11-14 Thread ONKELINX, Thierry
Please be more specific about what you want. Give an example of the required output. And keep the mailing list in cc when replying. Van: catalin roibu [catalinro...@gmail.com] Verzonden: woensdag 14 november 2012 17:54 Aan: ONKELINX, Thierry Onderwerp: Re: [R

Re: [R] A panel of contour plots through a iteration process

2012-11-09 Thread ONKELINX, Thierry
[mailto:spinelilouki...@gmail.com] Verzonden: vrijdag 9 november 2012 12:06 Aan: Jose Iparraguirre CC: ONKELINX, Thierry; r-help@r-project.org help Onderwerp: Re: [R] A panel of contour plots through a iteration process Hm, the problem is a little bit more complicated than I thought. Let me give you more

Re: [R] A warning message in glht

2012-11-08 Thread ONKELINX, Thierry
Dear Yulia, When you have an interaction between a continuous and a categorical variable, then the multiple comparison on the categorical variabel makes only sense conditional that the continuous variable is zero. Hence the warning. Best regards, Thierry ir. Thierry Onkelinx Instituut voor

Re: [R] A panel of contour plots through a iteration process

2012-11-08 Thread ONKELINX, Thierry
I would rather use facet_wrap() instead of multiplot() Just combine all your data in one data.frame and make sure that you have a variable indication the iteration. library(reshape2) volcano3d - melt(volcano) names(volcano3d) = c(x, y, z) volcano3d - merge(volcano3d, data.frame(Iteration =

Re: [R] total number of citations for R project

2012-11-07 Thread ONKELINX, Thierry
http://scholar.google.be/scholar?q=www.R-project.orgbtnG=hl=nlas_sdt=0 http://scholar.google.be/scholar?q=%22R+Core+Team%22btnG=hl=nlas_sdt=0 http://scholar.google.be/scholar?q=%22R+Foundation+for+Statistical+Computing%22btnG=hl=nlas_sdt=0 ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] averaging a list of matrices element wise

2012-11-06 Thread ONKELINX, Thierry
bericht- Van: Bert Gunter [mailto:gunter.ber...@gene.com] Verzonden: maandag 5 november 2012 16:13 Aan: D. Rizopoulos CC: ONKELINX, Thierry; r-help@r-project.org Onderwerp: Re: [R] averaging a list of matrices element wise Gents: Although it is difficult to say what may be faster, as it typically

[R] averaging a list of matrices element wise

2012-11-05 Thread ONKELINX, Thierry
Dear all, I have a list of n matrices which all have the same dimension (r x s). What would be a fast/elegant way to calculate the element wise average? So result[1, 1] - mean(c(raw[[1]][1, 1] , raw[[2]][1, 1], raw[[...]][1, 1], raw[[n]][1, 1])) Here is my attempt. #create a dummy dataset n -

Re: [R] issues with krige function

2012-10-31 Thread ONKELINX, Thierry
Dear Adrienne, What is the output of summary(casestudy) and summary(gridmeta)? What happens if you set nmax to 10? krige(formula=bias~1,locations=~lon+lat,data=casedata,newdata=gridmeta ,model=v.fit, nmax = 10) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute

Re: [R] help with lme

2012-10-30 Thread ONKELINX, Thierry
Dear Sylvia, R-sig-mixed-models is a better list for questions about mixed models. The summary gives you the standard error for the fixed effects. See the output in your mail. E.g. AGQ has a standard error of 0.044 Have a look at http://glmm.wikidot.com/faq, it covers some topics on mixed

Re: [R] newbie: embeding seq in a list

2012-10-30 Thread ONKELINX, Thierry
You first example is a list of 5 items, each item is a number The second example is a list with one item: a vector with 5 elements. You'll need c() to make a vector of the item to get the same result. all.equal(list(c(0.8,0.9,1.0,1.1,1.2)), list(seq(0.8, 1.2, by = 1.1))) ir. Thierry Onkelinx

Re: [R] 4253H twice implementation

2012-10-22 Thread ONKELINX, Thierry
Have a look at library(sos) findFn(twice filter) 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

Re: [R] Simple question about formulae in R!?

2012-08-10 Thread ONKELINX, Thierry
Dear Johan, Why should it be complicated? You have a very simple model, thus a very simple formula. Isn't that great? Your formula matches the model. Though Trust~Culture + Structure * Speed_of_Integration is another option. The model fit is the same, the only difference is the

Re: [R] Error Bars ggplot2

2012-07-27 Thread ONKELINX, Thierry
How about this? Andpleasemakeusofthelargekeyatthebottomofyourkeyboard.Itmakescodemuchmorereadable. library(ggplot2) spd - factor(c(s,f,f,s,f,s,s,s,f,f,s,f)) r - c(4.9,3.2,2.1,.2,3.8,6.4,7.5,1.7,3.4,4.1,2.2,5) dataset - data.frame(spd, r) dataset - rbind(cbind(dataset, Type = DOE, delta = 2),

Re: [R] producing a graph with glm poisson distributed respons count data and categorical independant variables

2012-07-27 Thread ONKELINX, Thierry
Dear Babs, This is how I would present the model, if I had enough data to support the model. The model is too complicated for your data and leads to a perfect fit. Is this the aggregated dataset, or does your design has no replicates? Best regards, Thierry dataset$combinatie -

Re: [R] CPU usage while running R code

2012-07-04 Thread ONKELINX, Thierry
Dear Laurent, An R proces uses only one core. It is possible to use multiple cores. Have a look at he Hig-Performance and Parallel Computing task view (http://cran.freestatistics.org/web/views/HighPerformanceComputing.html) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] assign object with loop (translation from SAS to R)

2012-06-29 Thread ONKELINX, Thierry
You can use a combination of the outer() and apply() functions n - 10 p - 9 dataset - data.frame(matrix(rep(seq_len(p), each = n), nrow = n, ncol = p)) colnames(dataset) - paste(p, seq_len(p), sep = ) test - t(apply(dataset, 1, function(x){ x %o% x})) colnames(test) - paste(p, rep(seq_len(p),

Re: [R] lme: extract result-function

2012-06-13 Thread ONKELINX, Thierry
Dear Christof, You want the predict() function. See ?predict.lme for the details. Best regards, Thierry PS Questions on lme() can be asked at r-sig-mixed models. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

Re: [R] Two-way linear model with interaction but without one main effect

2012-06-12 Thread ONKELINX, Thierry
Dear Helios, I think you rather want a mixed model with shoe as random effect. library(lme4) lmer(Y ~ Ground + (1|Shoe)) #the effect of shoe is independent of the ground effect or lmer(Y ~ Ground + (0 + Ground|Shoe)) #the effect of shoe is different per ground. Best regards, Thierry ir.

Re: [R] R-SCRIPT Label Calling Method

2012-06-12 Thread ONKELINX, Thierry
Is this homework? If it is, please read the posting guide. 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

Re: [R] lme random slope results the same as random slope and intercept model

2012-06-12 Thread ONKELINX, Thierry
Dear John, R-sig-mixed-models is a better list for this kind of questions. It looks like the model finds no evidence for a random slope. Notice the very small variance of the random slope. In the model without random intercept, the random slope tries to mimic the effect of a random intercept.

Re: [R] Transform counts into presence/absence

2012-05-31 Thread ONKELINX, Thierry
Just use the logical operators. Counts - c(1,0,21,2,0,0,234,2,0) Counts 0 1 *(Counts 0) 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

Re: [R] GLMMPQL spatial autocorrelation

2012-05-30 Thread ONKELINX, Thierry
Dear Alex, I'm cc'ing this to the mixed models list which is more appropriate for the question. Please send all follow up posts only to that list. First a few more general remarks. - You are using the data argument of glmmPQL. So there is no need to attach() the data.frame. I recommend avoid

Re: [R] alternative generator for normal distributed variables

2012-05-30 Thread ONKELINX, Thierry
Please give a reproducible example when making bold statements. I find no evidence of autocorrelation in set.seed(12345) x - rnorm(100, mean = 0, sd = 1) acf(x) x - rnorm(1e6, mean = 0, sd = 1) acf(x) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature

Re: [R] setting parameters equal in lm

2012-05-29 Thread ONKELINX, Thierry
offset() fixes the parameter to 1. So offset(I(.5*X2)) should do the trick. 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

Re: [R] What's wrong with MEAN?

2012-05-22 Thread ONKELINX, Thierry
You'll need to pass the data as a vector. mean(16, 18) is asking the mean of 16. 18 is passed to the second argument which is trim. So you are doing mean(16, trim = 18) What you want is mean(c(16, 18)) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek /

Re: [R] problem with get() inside of lme()

2012-05-16 Thread ONKELINX, Thierry
You can achieve that with a combination of as.formula and paste. library(nlme) data(petrol, package = MASS) lme(as.formula(paste(Y.VAR, ~EP)), random= ~1|No, data=petrol) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and

Re: [R] ANOVA question

2012-05-11 Thread ONKELINX, Thierry
Dear Robert, It is easier to use lm instead of aov if you want coefficients for each group. Note that you can use rnorm vectorised. set.seed(0) N - 100 # sample size MEAN - c(10, 20, 30, 40, 50) VAR - c(20,20,1, 20, 20) LABELS - factor(c(A, B, C, D, E)) # create a data frame with labels df -

Re: [R] Outcome~predictor model evaluation, repeated measurements

2012-05-11 Thread ONKELINX, Thierry
Dear nameless, A mixed model seems reasonable for your kind of data. lme() from nlme or lmer() from lme4 are good starting points. Please note that there is R-sig-mixed-models: a R mailing list dedicated to mixed models. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] please help!

2012-05-08 Thread ONKELINX, Thierry
From the posting guide of this mailing list: Basic statistics and classroom homework: R-help is not intended for these. Ask your fellow students or your teacher. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

  1   2   3   4   5   6   >