[R] [R-pkgs] Package exams with Moodle and OLAT support

2012-12-21 Thread Achim Zeileis
Dear useRs, this week we have released a new version (1.9) of the exams package which now contains flexible tools for generating e-learning exams for various learning management systems: As in earlier versions of the package exam generation is still based on separate Sweave files for each

[R] How to run chaid in R

2012-12-21 Thread saumya Joshi
Could you please let me know how to run chaid in R.     Thanks, Saumyha [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Jessica Streicher
@David : In my mind it was quite complete enough. @William: Thanks, didn't know you could do that with data frames, if i ever have to do something similar again i might try this. On 20.12.2012, at 22:39, David Winsemius wrote: On Dec 20, 2012, at 10:01 AM, Jessica Streicher wrote: Really

Re: [R] How to run chaid in R

2012-12-21 Thread Pascal Oettli
https://stat.ethz.ch/pipermail/r-help/2009-August/209752.html Le 21/12/2012 18:07, saumya Joshi a écrit : Could you please let me know how to run chaid in R. Thanks, Saumyha [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] How to run chaid in R

2012-12-21 Thread saumya Joshi
Hi,   I don't find the chaid code in the mail/webpage.   Thanks, Saumya --- On Fri, 21/12/12, Pascal Oettli kri...@ymail.com wrote: From: Pascal Oettli kri...@ymail.com Subject: Re: [R] How to run chaid in R To: saumya Joshi saumyaj2...@yahoo.com Cc: r-help@r-project.org Received: Friday, 21

Re: [R] permutation of vectors (1 or 0)

2012-12-21 Thread jim holtman
use the 64-bit version of R and get at least 4e18 bytes of memory. Since that is quite a bit, you might want to use another approach since you would need that much disk to just store the result which might take 1.3 million cpu hours to calculate. On Thu, Dec 20, 2012 at 9:07 AM, Olga Lyashevska

Re: [R] Memory filling up while looping

2012-12-21 Thread jim holtman
have you tried putting calls to 'gc' at the top of the first loop to make sure memory is reclaimed? You can print the call to 'gc' to see how fast it is growing. On Thu, Dec 20, 2012 at 6:26 PM, Peter Meissner peter.meiss...@uni-konstanz.de wrote: Hey, I have an double loop like this: chunk

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Tim Howard
Jessica, In terms of initializing your list for populating it in a later step, I think this partially gets at your question -- it removes the upper loop assignment, but then does require a loop to get the second level. Perhaps there's something here you can work with ... height-c(high,low)

Re: [R] Memory filling up while looping

2012-12-21 Thread Peter Meißner
Thanks for your answer, yes, I tried 'gc()' it did not change the bahavior. best, Peter Am 21.12.2012 13:37, schrieb jim holtman: have you tried putting calls to 'gc' at the top of the first loop to make sure memory is reclaimed? You can print the call to 'gc' to see how fast it is growing.

[R] Can data.frame be saved as image?

2012-12-21 Thread Katherine Gobin
Dear R forum I have one stupid question, but I have no other solution to it in sight? Suppose some R process creates graphs etc alongwith main output as data.frame e.g output1 = data.frame(bands = c(A, B, C), results = c(74, 108,  65)) I normally save this output as some csv file. But I

Re: [R] Memory filling up while looping

2012-12-21 Thread Duncan Murdoch
On 12-12-20 6:26 PM, Peter Meissner wrote: Hey, I have an double loop like this: chunk - list(1:10, 11:20, 21:30) for(k in 1:length(chunk)){ print(chunk[k]) DummyCatcher - NULL for(i in chunk[k]){ print(i load something) dummy - 1

[R] useR meetup group in Munich, Germany

2012-12-21 Thread Markus Schmidberger
Dear all, I would like to invite Munich (Germany) area R users for our first meeting: 16th January 2013. The group is aimed to bring together practitioners (from industry and academia) in order to exchange knowledge and experience in solving data analysis statistical problems by using R. More

Re: [R] Can data.frame be saved as image?

2012-12-21 Thread jim holtman
do you want to save the dataframe used in the plot and then the plot itself? If so consider using 'lattice' or 'ggplot2' which create an object for print and this would allow you to use 'save' to save both objects in a file. If you want to generate the 'png' file, the you would have to 'save'

[R] how can I import op.gz files with read.csv or otherwise

2012-12-21 Thread herr dittmann
Dear R-users, I am struggling to directly read an op.gz file into R. NOAA kindly provides daily weather data on their FTP server for download. sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United Kingdom.1252 

Re: [R] How to run chaid in R

2012-12-21 Thread Sarah Goslee
The link given mentions a function and package. You can also go to www.rseek.org and type in CHAID yourself. Or google, for that matter. Let me demonstrate: http://lmgtfy.com/?q=chaid+r It's incumbent on querents here to do at least a bit of their own work before asking for help. Sarah On

Re: [R] Why can't I unclass an array?

2012-12-21 Thread Martin Maechler
[ Diverted from R-devel : ] Terry Therneau thern...@mayo.edu on Fri, 21 Dec 2012 08:05:21 -0600 writes: In a real example I was trying to remove the class from the result of table, just because it was to be used as a building block for other things and a simple integer vector

Re: [R] Memory filling up while looping

2012-12-21 Thread Peter Meißner
Here is an working example that reproduces the behavior by creating 1000 xml-files and afterwards parsing them. At my PC, R starts with about 90MB of RAM with every cycle another 10-12MB are further added to the RAM-usage so I end up with 200MB RAM usage. In the real code one chunk-cycle

Re: [R] Memory filling up while looping

2012-12-21 Thread Peter Meißner
I'll consider it. But in fact the whole data does not fit into memory at once with the overhead to create it in addition - I think. That was one of the reasons I wanted to do it chunk by chunk in the first place. Thanks, Best, Peter Am 21.12.2012 15:07, schrieb Duncan Murdoch: On 12-12-20

Re: [R] comparison of large data set

2012-12-21 Thread Adams, Jean
Irucka, I did not test this code out on any data, but I think it will work. Jean # a function to read in the data as a matrix of logicals myreadfun - function(file) { as.matrix(read.ascii.grid(file)$data)!=0 } # names of the 54 modeled depth files modfiles - paste0(MaxFloodDepth_, 1:54, .txt)

[R] how to recode an ordered factor

2012-12-21 Thread Francesco Sarracino
Dear R helpers, I'm trying to recode an ordered factor to reverse its scale, but I can't figure out how to make it. I am using the Recode function provided by the Car package. I've created an ordered variable: data$o.var1 - ordered(data$var1, levels=c(1,2,3,4), labels =c(very satisfied, fairly

Re: [R] how to recode an ordered factor

2012-12-21 Thread William Dunlap
Will calling factor(var,levels=rev(levels(var))) work for you? o - factor(c(Good,Bad,Good,Neutral), levels=c(Bad,Neutral,Good), ordered=TRUE) orev - factor(o, levels=rev(levels(o))) str(o) Ord.factor w/ 3 levels BadNeutral..: 3 1 3 2 str(orev) Ord.factor w/ 3 levels

[R] Rterm does not load personal library

2012-12-21 Thread Bond, Stephen
Greetings, I am trying to run a short script from a shell: c:\projects\hellRscript --default-packages=mypack X:/4Stephen/commit/curve.R X:/4Stephen/commit/run1.out Loading required package: utils Warning message: package 'RODBC' was built under R version 2.12.2 Error: could not find function

Re: [R] Can data.frame be saved as image?

2012-12-21 Thread Katherine Gobin
Dear Sir, Thanks a lot for your suggestion. In the meantime I came across http://stackoverflow.com/questions/10587621/how-to-print-to-paper-a-nicely-formatted-data-frame and got to know about the package gridExtra So I used following code png(filename = output1.png, width=480,height=480)

Re: [R] how can I import op.gz files with read.csv or otherwise

2012-12-21 Thread arun
HI, May be this link helps you: http://stackoverflow.com/questions/5764499/decompress-gz-file-using-r A.K. - Original Message - From: herr dittmann herrdittm...@yahoo.co.uk To: r-help@r-project.org r-help@r-project.org Cc: Sent: Friday, December 21, 2012 9:51 AM Subject: [R] how can

[R] Parallel code using parLapply

2012-12-21 Thread Chris Hergarten
Dear R-users I was running into problems with my R code trying to run clh sampling (clhs package) in parallel mode (=on various data sets simultaneously). Here is the code (which I developed with some help:)): ** library(clhs) library(snow) a -

Re: [R] Can data.frame be saved as image?

2012-12-21 Thread arun
Hi Katherine, You could try this: library(plotrix) png(katherine.png)  plot(0:3,0:3,xlab=,ylab=,type=n,axes=FALSE)  addtable2plot(1,1,output1,cex=2)  dev.off() A.K. - Original Message - From: Katherine Gobin katherine_go...@yahoo.com To: r-help@r-project.org Cc: Sent: Friday,

Re: [R] Memory filling up while looping

2012-12-21 Thread Patrick Burns
Circle 2 of 'The R Inferno' may help you. http://www.burns-stat.com/pages/Tutor/R_inferno.pdf In particular, it has an example of how to do what Duncan suggested. Pat On 21/12/2012 15:27, Peter Meißner wrote: Here is an working example that reproduces the behavior by creating 1000 xml-files

Re: [R] Memory filling up while looping

2012-12-21 Thread Peter Meißner
Yeah, thanks, I know: !DO NOT USE RBIND! ! But it does not help, although using a predefined list to store results as suggested there, it does not help. The problems seems to stem from the XML-package and not from the way I store the data until saved. Best, Peter Am 21.12.2012 18:33,

Re: [R] how can I import op.gz files with read.csv or otherwise

2012-12-21 Thread John Kane
Try downloading it and decompress it: url - ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2012/285880-9-2012.op.gz; dest - /home/john/rdata/weather.op.gz download.file(url, dest) However it does not look like a nicely formatted file and you may have to do some cleanup in a text editior or

Re: [R] Rterm does not load personal library

2012-12-21 Thread Uwe Ligges
On 21.12.2012 18:16, Bond, Stephen wrote: Greetings, I am trying to run a short script from a shell: c:\projects\hellRscript --default-packages=mypack X:/4Stephen/commit/curve.R X:/4Stephen/commit/run1.out Loading required package: utils Warning message: package 'RODBC' was built under R

Re: [R] Rterm does not load personal library

2012-12-21 Thread Bond, Stephen
Uwe, Thank you for the suggestion. I checked and there are no dependencies involved. I discovered the problem is calling an old version c:\projects\hellwhich Rscript which Rscript /cygdrive/c/Program Files/R/R-2.12.1/bin/Rscript Mypack is installed under 2.15. Will change my paths and that

Re: [R] Print plot to pdf,

2012-12-21 Thread Tobias Kisch
Dear Duncan Sorry if I’m not ment to contact you with this through this channel... I’m a complete newbie in asking things about r packages... But anyways, just let me know if I’m in the wrong place here! My problem is concerning scatter3d (rgl, Rcmdr... I guess (hope) I’m at least

[R] Difficulty importing data from PARI/GP

2012-12-21 Thread murfs
I'm trying to import a matrix created in PARI/GP into R but am having problems. The data in the text file has entries separated by commas but the rows themselves are separated by semicolons rathen than being on a new line. Is there a way to get R to recognise that ; means start a new row ? --

Re: [R] how to recode an ordered factor

2012-12-21 Thread arun
HI, May be this helps:  dat1-data.frame(var1=factor(rep(1:4,times=3))) dat1-transform(dat1,o.var1=ordered(var1,levels=c(1,2,3,4),labels=c(very satisfied, fairly satisfied,not very satisfied, not at all satisfied))) dat2-transform(dat1,or.var1=factor(o.var1,levels=rev(levels(o.var1

[R] remove from column a group of elements I have in another vector

2012-12-21 Thread Estefanía Gómez Galimberti
Hi,   I have a data frame and I would need to remove from one of the columns a group of elements I have in another vector. How can I do that? I know how to do it with criteria but i would need to do it in a more automatic way In SQL I would use  where not in Thank you, Estefania

Re: [R] Memory filling up while looping

2012-12-21 Thread Milan Bouchet-Valat
Le vendredi 21 décembre 2012 à 18:41 +0100, Peter Meißner a écrit : Yeah, thanks, I know: !DO NOT USE RBIND! ! But it does not help, although using a predefined list to store results as suggested there, it does not help. The problems seems to stem from the XML-package and not from the

Re: [R] remove from column a group of elements I have in another vector

2012-12-21 Thread Sarah Goslee
You can probably do it with not in in R too: for a data frame x where you want to remove rows where values in column A are not in the vector y: x[!(x$A %in% y), ] If you'd provided a reproducible example, I could give code that works in your particular circumstance. Sarah On Fri, Dec 21, 2012

Re: [R] Memory filling up while looping

2012-12-21 Thread Peter Meißner
THANKS a lot! This actually solved the problem even without calling free() explicitly: xmlTreeParse(..., useInternalNodes=TRUE) Best, Peter Am 21.12.2012 19:48, schrieb Milan Bouchet-Valat: Le vendredi 21 décembre 2012 à 18:41 +0100, Peter Meißner a écrit : Yeah, thanks, I know: !DO NOT

Re: [R] comparison of large data set

2012-12-21 Thread Adams, Jean
Irucka, You should cc R-help on all correspondence so that other readers of the list can follow the conversation. (1) You say that you need 0s and 1s rather than TRUE/FALSE. Since a 0/1 matrix and TRUE/FALSE matrix behave exactly the same way in most applications, I'm not sure why it would

Re: [R] Rterm does not load personal library

2012-12-21 Thread Bond, Stephen
I have to apologize to everybody. The thing was failing because my library did not have that particular function in R 2.12. The library actually loads fine, just the function is missing. Merry Christmas to those celebrating. Stephen -Original Message- From: Uwe Ligges

Re: [R] Memory filling up while looping

2012-12-21 Thread jim holtman
I ran your code and did not see any growth: used (Mb) gc trigger (Mb) max used (Mb) Ncells 463828 24.8 818163 43.7 818163 43.7 Vcells 546318 4.21031040 7.9 909905 7.0 1 (1) - eval : 33.6 376.6 376.6 : 48.9MB used (Mb) gc trigger (Mb) max used (Mb) Ncells 471049

Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread jim holtman
One way is to use 'readLines' to read in the file, change the ';' to '\n', write the file out and then read it back in: x - readChar('/temp/test.txt', 1e6) print(x) [1]

Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread William Dunlap
By the way, you can leave out the write-to-file step, as read.table's text= argument does the equivalent. E.g., x - 1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6;1,2,3,4,5,6\r\n p -

Re: [R] Difficulty importing data from PARI/GP

2012-12-21 Thread arun
HI, May be this helps: Lines1-15,30,45;20,45,39;60,49,32;48,59,63 res1-read.table(text=unlist(strsplit(Lines1,split=;)),sep=,) str(res1) #'data.frame':    4 obs. of  3 variables: # $ V1: int  15 20 60 48 # $ V2: int  30 45 49 59 # $ V3: int  45 39 32 63 #or

[R] segfault reading large BLOB from SQL Server

2012-12-21 Thread jeffrey.j.hallman
I am getting segfaults when I try to read a large binary object from a SQL Server database via RODBC. I am using the FreeTDS ODBC driver, and it has been working fine when reading from this same database. I have included relevant parts of the session below. Each row of the v_MAFiles view holds

Re: [R] how can I import op.gz files with read.csv or otherwise

2012-12-21 Thread Rui Barradas
Hello, It can be read using readLines. I've changed url to URL because there's a function of that name. I've also changed dest. URL - ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2012/285880-9-2012.op.gz; dest - weather.op.gz download.file(URL, dest) gz - gzfile(dest, open = rt) x -

[R] Legend symbols

2012-12-21 Thread Diviya Smith
Hi there, I was wondering if there is any R package that one can use for plotting that has more legend symbols - the standard pch has 18 symbols but I need ~30 for my application- and just using different colors is not an option. Thank you in advance, Diviya [[alternative HTML version

Re: [R] Legend symbols

2012-12-21 Thread Greg Snow
Using pch you can use all the symbols in the current font, try: plot(0:15, 0:15, type='n') points( (0:255)%%16, (0:255)%/%16, pch=0:255 ) then do it again with points( (0:255)%%16, (0:255)%/%16, pch=0:255, font=5 ) (font 5 is usually a symbol font, fonts 2, 3, and 4 are bold and italic versions

[R] ggplot2: setting martin

2012-12-21 Thread Frans Marcelissen
Is it possible to set the margin in ggplot2 to a fixed size? I create many plots, and I want them to look the same. Especially I want them to have the same left margin. But P-ggplot()+geom_bar(aes(c(short label1,short label2),runif(2)))+coord_flip() P-creates a plot with another margin as

Re: [R] ggplot2: setting martin

2012-12-21 Thread Ista Zahn
Well, the margin is being set large enough to accommodate the labels. So if you want narrower margins just shorten the labels: library(stringr) P + scale_x_discrete(labels = function(x) str_wrap(x, width=12)) HTH, Ista On Fri, Dec 21, 2012 at 5:35 PM, Frans Marcelissen

[R] texreg error while exporting regression table

2012-12-21 Thread Francesco Sarracino
Dear listers, I am trying to export my regression table to my latex document. Let's say I have two variables: an ordered factor: group - gl(3,5,20, labels=c(Ctl,Trt,prp)) and a continuous variable: weight - runif(20) I want to regress group over weigth, therefore I run: reg2 - polr(group ~

Re: [R] NRI reclassification table improveProb Cox

2012-12-21 Thread Frank Harrell
As describe in the Hmisc package's improveProb function, that function is for binary Y. And it's best to use category-free methods. Frank Petergodsk wrote Hi I'm new to R. Is it possible to use the improveProb function to generate categorybased NRI using a Cox model? I believe I saw

[R] how to control the naming of factors in regression

2012-12-21 Thread Francesco Sarracino
Dear R listers, I am regressing an ordered variable over an ordered independent variable using polr. The output lists every level of the ordered independent variable repeating its name and adding a suffix. In my case my variable is called o.particip and in my regression table I get the

Re: [R] how to control the naming of factors in regression

2012-12-21 Thread William Dunlap
The '.L', ..., '^6' are the column names from the output contr.poly(), the default contrasts function for ordered factors. You can define your own contrasts function that calls contr.poly() and renames the columns to something you like, then set options(contrasts) so your contrasts function is

Re: [R] Parallel code using parLapply

2012-12-21 Thread Gabor Grothendieck
On Fri, Dec 21, 2012 at 10:42 AM, Chris Hergarten cheg...@yahoo.com wrote: Dear R-users I was running into problems with my R code trying to run clh sampling (clhs package) in parallel mode (=on various data sets simultaneously). Here is the code (which I developed with some help:)):