[R] Online, automatic evaluation of class assessment R scripts

2014-06-03 Thread Werner W.
Dear R group, I will be giving a course on R in a bit of time. I am very intrigued by the way R coding assessments are done in several courses on Coursera and would like to figure out whether I am capable of setting up such a system for my course. On Coursera, R scripts are submitted online and th

Re: [R] Problem with new(er) R version's matrix package

2014-04-27 Thread Werner W.
ious results were wrong or this newly occurring error is wrong. Many thanks, Werner Martin Maechler schrieb am 22:00 Samstag, 26.April 2014: >>>>> Arne Henningsen > >>>>>>    on Sat, 26 Apr 2014 08:15:37 +0200 writes: > >    > On 25

[R] Problem with new(er) R version's matrix package

2014-04-25 Thread Werner W.
Dear Rs, I am re-executing some older code. It does work in the ancient R 2.12.0 which I still have on my PC but with the new version R 3.1.0 it does not work any more (but some other new stuff, which won't work with 2.12). The problem arises in context with the systemfit package using the matr

[R] R book or other materials for teaching a one week class on data analysis

2013-07-06 Thread Werner W.
Dear Rusers, I am starting to develop a one week course in which I want to cover an R programming introduction and go over data analysis / statistics / econometrics incl. visualization and maybe reproducible research as an extra. The goal is to give research students a kick start with R so that

[R] Simple Likert count data visualization

2012-11-09 Thread Werner W.
Hello, Before I start to construct something inferior myself I would like to know if such a plot function is already out there. I have count data of a small survey with a few questions which use a scale from "Strongly disagree" to "Strongly agree" and similar things. What I would like to have

[R] Print to console from within Sweave script

2010-11-30 Thread Werner W.
Hi, is it possible to send some message to the console from within a .Rnw Sweave script, ie. when executing Sweave()? The background is that only in particular circumstances my script is doing some lengthy computations and I would like to print some status information to the console. It seems S

[R] function which can apply a function by a grouping variable and also hand over an additional variable, e.g. a weight

2010-10-01 Thread Werner W.
Hi, I was wondering if there is an easy way to accomplish the following in R: Often I want to apply a function, e.g. weighted.quantile from the Hmisc package to grouped subsets of a data.frame (grouping variable) but then I also need to hand over the weights which seems not possible with summary

[R] How to comment out entire code parts in Sweave files

2010-09-11 Thread Werner W.
Hi, I am wondering if there is any convenient way to comment out an entire region of a Sweave file which comprises R and Latex code. Currently I'm doing it for the R and Latex parts separately or transfer the unwanted part into a different file. But both are not great solutions. (I am doing t

Re: [R] data.frame: return all rows where at least one...

2010-08-06 Thread werner w
Thanks for the answers! The any function was basically exactly what I was looking for. (previously I used something with rowSums() which is probably not the most efficient way.) Thanks so much, Werner -- View this message in context: http://r.789695.n4.nabble.com/data-frame-return-all-rows-w

[R] data.frame: return all rows where at least one...

2010-08-06 Thread Werner W.
Hi, I know ways to do this but they all seem awkward and I somehow believe that there is a convenient shortcut. If I have a data.frame with many columns, how can I request all rows for which at least one column satisfy an expression? For instance, all rows where at least one column is negativ

[R] how can I look at .Internal(model.matrix(t, data))?

2010-03-05 Thread Werner W.
Hi, I would like to see how model.matrix expands factor column to a set of dummy columns. I think that is done int .Internal(model.matrix(t, data)) which is called from model.matrix.default. But I have not idea how I can look at this function. How can I get to such internal functions? Thanks s

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread werner w
Thanks Matthew, you are absolutely right. I am working on Windows XP SP2 32bit with R versions 2.9.1. Here is an example: d <- as.data.frame(matrix(trunc(rnorm(6*27136, 1, 100)),ncol=6)) d[,4:5] <- trunc(100*runif(2*27136, 0, 1)) d[,6] <- trunc(1000*runif(27136, 0, 1)) for (i in 4:6)

[R] Once again: Error: cannot allocate vector of size

2010-01-21 Thread Werner W.
Hi, I have browsed the help list and looked at the FAQ but I don't find conclusive evidence if this is normal or I am doing something wrong. I am running a lm() on a data.frame with 27136 observations of 6 variables (3 num and 3 factor). After a while R throws this: > lm(log(y) ~ log(a) + log(

Re: [R] Remove term from formula for predict.lm

2010-01-19 Thread werner w
Thanks a lot for the answers! Somehow I thought there will be a facility to modify the formula. But setting unwanted variables to zero will of course work and maybe is simple enough. Thanks again! -- View this message in context: http://n4.nabble.com/Remove-term-from-formula-for-predict-lm-t

Re: [R] Remove term from formula for predict.lm

2010-01-19 Thread werner w
Thanks Gabor and Henrique! Sorry for the imprecise question. I want predict() to use the coefficients estimated by the original regression but to exclude terms from the prediction formula. If I originally estimated y ~ x1 + x2 and got coefficients b0, b1, b2, I would like to remove x2 and predict

[R] Remove term from formula for predict.lm

2010-01-19 Thread Werner W.
Hi, probably just a quick question: can I somehow change the formula used with predict? E.g., the regression was run on "y ~ u + v + w" but for the prediction the term v should be removed from the formula contained in the regression object and only "y ~ u + w" be used. I could use model.matrix

[R] Functions for QUAIDS and nonlinear SUR?

2010-01-08 Thread Werner W.
Hi, I would like to estimate a quadratic almost ideal demand system in R which is estimated usually by nonlinear seemingly unrelated regression. But there is no such function in R yet but it is readily available in STATA (nlsur), see B. Poi (2008): Demand-system estimation: Update, Stata Journa

Re: [R] Viewing function code

2009-08-10 Thread Werner W.
Brilliant, that works! Thanks a lot for the quick help, Werner Dimitris Rizopoulos-4 wrote: > > well, you almost have it -- try this: > > # two methods for the merge generic > methods(merge) > > merge.default > merge.data.frame > > > I hope it helps. > > Best, > Dimitris > > -- Vie

[R] Viewing function code

2009-08-10 Thread Werner W.
Hi, in the quest of learning from others' codes, I am still stumbling over the problem how to view some of the functions. I know about methods() & getAnywhere(), showMethods(), getMethods() but I still cannot view every function. How would I look at the code of the "merge" function? Thanks a m

Re: [R] solving system of equations involving non-linearities

2009-08-06 Thread Werner W.
Many thanks, BBsolve works like a charm. First I thought I should use the squares of the equations because BBsolve would use some minimization objective function anyway but it actually only works if I don't use the squared equations. I'll check the documentation if I find something about the obj

Re: [R] portable R editor

2009-03-12 Thread Werner W.
file, a link to the ini files on the USB stick is created in the user's application data directory in the local harddrive of the PC used. But note that this does not work if there exists a Tinn-R directory already in the user's application data dir in local harddrive. All the best, Wern

Re: [R] portable R editor

2009-03-05 Thread Werner W.
JauntePE is really easy to use. It does not take any particular skill. Just launch the main application, click on the Lauch JPE Quickie Button and it will guide you through the process. I left everything with the default settings. In brief, one starts the Tinn-R installer once from within JPE prob

Re: [R] portable R editor

2009-03-04 Thread Werner W.
Many, many thanks for all the answers! Notepad++ looks very promising although it does not have a project file management facility. But it has a very clean appearance. I'll have to look into SciTE which also sounds quite good. There seem to be some good alternatives. Meanwhile, I found a freewar