Re: [R] Multi-line graph?

2010-10-15 Thread Dieter Menne
barnhillec wrote: I'm trying to graph some simple music psychology data. Columns are musical intervals, rows are the initials of the subjects. Numbers are in beats per minute (this is the value at which they hear the melodic interval split into two streams). So here's my table:

Re: [R] Problem with merging two zoo objects

2010-10-15 Thread Dieter Menne
Megh wrote: Dear all, I have following 2 zoo objects. However when I try to merge those 2 objects into one, nothing is coming as intended. Please see below the objects as well as the merged object: merge(dat11, dat22) V2.dat11 V3.dat11 V4.dat11 V5.dat11

Re: [R] could not find function hmatplot

2010-10-19 Thread Dieter Menne
Grzesiek wrote: I need a picture like this: http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 http://rwiki.sciviews.org/doku.php?id=graph_gallery:graph38 .. follows code from the web site I get an error: Error: could not find function hmatplot What is wrong? Mayby you

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-19 Thread Dieter Menne
Ottorino-Luca Pantani wrote: The areas I would like to have in gray, are confidence bands This link is my starting point http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html Thanks for the code example and for all the work you already put into it! I think this is an oversight

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-20 Thread Dieter Menne
Ottorino-Luca Pantani wrote: Thanks Dieter for your help, but unfortunately your suggestion results only in changing the color of the *lines* and not the color of the *area* of the polygon. The following complete code works for me. Do you have the current version of lattice/R

Re: [R] Accessing table elements and escape characters

2010-10-20 Thread Dieter Menne
sachinthaka.abeywardana wrote: I get the error: A-read.table(P:/temp.csv,header=TRUE, sep=,); Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 11018 did not have 85 elements but when i open it in excel everything is fine. Better open it with

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-20 Thread Dieter Menne
djmuseR wrote: Hi Dieter: I think the OP wanted both lines and shading; from your code I could get the shading but not the lines. This is what it took for me to get the lines (note the type and col.line changes in xyplot() ): xyplot(est ~ x | cond, group = grp, data = data, type =

Re: [R] 3D-scatterplots - high quality rendering?

2010-10-21 Thread Dieter Menne
Jose de las Heras wrote: 3) it would be interesting to produce a simple movie, maybe just a 360-degree rotation. Is there a package geared towards that, or do I just simply create a collection of images that I animate elsewhere? I used that approach, and it works well. Dieter --

Re: [R] Problem in installing and starting Rattle

2010-11-15 Thread Dieter Menne
kgorahava wrote: I am trying to install and run Rattle on my Dell Laptop and I have Windows 7 OS. install.packages(RGtk2) install.packages(rattle) library(rattle) Rattle: Graphical interface for data mining using R. Version 2.5.47 Copyright (c) 2006-2010 Togaware Pty Ltd. Type

Re: [R] Sweave question

2010-11-15 Thread Dieter Menne
Duncan Murdoch-2 wrote: See SweavePDF() in the patchDVI package on R-forge. In case googling patchDVI only show a few Japanese Pages, and search for patchDVI in R-Forge gives nothing: try https://r-forge.r-project.org/projects/sweavesearch/ (or did I miss something obvious, Duncan?)

Re: [R] Help with Hist

2010-11-15 Thread Dieter Menne
SteveSB wrote: What I have is about 100 of which 80 or so are between a value of 0 and 40 , one or two in the hundreds and an outlier around 2000. Have a look at gap.barplot in package plotrix. Personally, I prefer to use xlim(x(0,100) in this case and add one outlier at t=2000 in the

Re: [R] How to Read a Large CSV into a Database with R

2010-11-15 Thread Dieter Menne
Anthony-107 wrote: Hi, I'm working in R 2.11.1 x64 on Windows x86_64-pc-mingw32. I'm trying to insert a very large CSV file into a SQLite database. Better use an external utility if this is a one-time import for this job: http://sqlitebrowser.sourceforge.net/ Dieter -- View this

Re: [R] a rounding option for \Sexpr{}?

2010-11-19 Thread Dieter Menne
Yihui Xie-2 wrote: Currently Sweave does not format the (especially numeric) value in \Sexpr{}, and I often have to round() the numbers explicitly, otherwise I will get more than 10 digits, which is not necessary for me in most cases. Is there a way to specify the number of digits to be

Re: [R] latex tables with quantreg

2010-11-19 Thread Dieter Menne
Frank Black-2 wrote: I'm using the quantreg package to run some regressions. I'm trying to save the output as latex tables using the helpful latex command, which works fine. However, I've been unable to modify its behavior in some ways I'm insterested in. For instance, I'd like a table

Re: [R] Plotting number of patients at risk below survival curve

2010-11-19 Thread Dieter Menne
Thorsten Raff wrote: does anyone know of a R-package that has implemented the increasingly popular inclusion of the number of patients at risk below Kaplan-Meier curves like in http://bloodjournal.hematologylibrary.org/content/vol116/issue19/images/large/zh89991058760001.jpeg

Re: [R] a rounding option for \Sexpr{}?

2010-11-19 Thread Dieter Menne
Duncan Murdoch-2 wrote: On 19/11/2010 10:12 AM, Yihui Xie wrote: Maybe this should go to R-devel as a wishlist: val- format(eval(parse(text=cmd), envir=.GlobalEnv)) I don't like the current behaviour, but that change could break a lot of existing documents. Not

Re: [R] count - help

2010-07-14 Thread Dieter Menne
barbara horta e costa wrote: I have a data frame with several factors and I want to count the occurrences of an event resulting from an interaction of some factors. I'd only need a table as excel does with pivot table and summarize data as count Only what pivot tables does: Pivot

Re: [R] count - help

2010-07-14 Thread Dieter Menne
-- View this message in context: http://r.789695.n4.nabble.com/count-help-tp2288571p2289156.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] count - help

2010-07-14 Thread Dieter Menne
barbara horta e costa wrote: Sample Season Area Gear Depth 1 W 1 5 1 2 Sp 1 3 1 2 Sp 1 5 1 2 Sp 1 11 1 2

Re: [R] eval-parse and lme in a loop

2010-08-07 Thread Dieter Menne
Connolly, Colm wrote: Hi everybody, I'm having trouble getting an eval-parse combination to work with lme in a for loop. I have not checked in detail, but it looks like another case for what we call Ripley's game: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/16599.html Dieter

Re: [R] Colours on conditional levelplots in package lattice

2010-08-07 Thread Dieter Menne
gordon.morrison wrote: I am having difficulty in getting the colours on a conditional levelplot in the package lattice to work as I want them to - I wonder if someone could help me. I did not understand exactly what you wanted because the example was a bit complext, but the following

[R] How to plot an expression-label with variable text

2010-08-27 Thread Dieter Menne
Disclaimer: I have read plotmath, but maybe it's too late today: How do I get the two labels to be the same: plot.new() lab =expression(paste(Estimated , t[50], from tgv)) text(0.5,0.5,lab) # Should look the same as above. I could not get the substitute right: what = tgv lab

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread Dieter Menne
Thanks to both of you. I noted that my example was over-simplified. Looks like I need to correct the environment when nested in a function, but I have to catch the last bus now. Dieter plotExp = function(what) { plot.new() lab =expression(paste(Estimated , t[50], from tgv))

Re: [R] How to plot an expression-label with variable text (lattice variant)

2010-08-28 Thread Dieter Menne
For the record: lattice behaves slightly differently, it requires an as.expression with bquote. Dieter plotExp - function(what) { plot.new() lab = bquote(Estimated~t[50]~ from ~.(what) ) ; text(0.5,0.2,lab) } plotExp(tgv) library(lattice) plotLattice - function(what) { lab =

Re: [R] Reading multiple text files where some files are empty

2010-09-01 Thread Dieter Menne
Paul wrote: Thanks for the responses. 'Try' seems to be the function that I needed. I had to adapt the code suggested below because vapply wasn't recognised, but this seemed to work: x‑lapply(a,function(x){try(read.table(x,colClasses='character'))}) There is the risk with this

Re: [R] Remove Loading required package message

2010-09-01 Thread Dieter Menne
Sébastien Moretti wrote: I use --vanilla --quiet --slave options on command line but I always get Loading required package: ... R 2.5.1 .. and make sure you update your R installation. We are at 2.11.1 currently. Dieter -- View this message in context:

Re: [R] define colors for groups in lattice xyplot

2010-09-03 Thread Dieter Menne
Geert, thanks for providing a nice example. When use see groups in xyplot, you should switch to the documentation (and use) panel.superpose. Which has a somewhat different philosophy (your looks more like ggplot2 would do it). The docs of panel.superpose say (tersely...) col: graphical

Re: [R] Power analysis

2010-09-03 Thread Dieter Menne
Lewis G. Dean wrote: post-hoc power analysis on a Wilcoxon test. There is a (somewhat dated) list of why-not papers in http://www.childrens-mercy.org/stats/size/posthoc.asp Dieter -- View this message in context: http://r.789695.n4.nabble.com/Power-analysis-tp2524729p2525333.html

Re: [R] 3d graph surface

2010-09-03 Thread Dieter Menne
Luis Felipe Parra wrote: Hello I have and 11 by 2 by 1200 matrix from which I would like to make a surface graph. Check the example in the docs of surface3d or persp3d from the rgl package. Note that attachments cannot be sent to the list (pdf and a few others are the exception) Dieter

Re: [R] Greek symbols (again but more complicated)

2010-09-05 Thread Dieter Menne
John Helly wrote: I'm trying to get 'mu' to show up as a Greek symbol but, despite trying every example I could find, can't get it to work. Try library(ggplot2) qplot(mpg, wt, data=mtcars, xlab = , ylab = bquote(mu~(E ~m^-2~s^-1)), geom=line) (thanks to Baptiste and David in

Re: [R] Warning messages: not meaningful for factors

2010-09-05 Thread Dieter Menne
Dr Shrink wrote: I need to include the repeated structure in our data set object, recall.sums.df, before using gls function. Thus I used groupedData. But I encountered error messages which may mean '*' is not not meaningful factor. I know that when reading Pinheiro/Bates one has the

Re: [R] anova of glm output

2010-09-06 Thread Dieter Menne
francogrex wrote: out - glm(response~Var1+Var2+Var3..,family=binomial,data=mydata) summary(out) stepAIC(out) anova(out, test='Chisq') I understand that stepAIC is used to select the model with the lowest AIC (the best model) but can someone explain what is the purpose of doing the

Re: [R] replacing functions

2010-09-06 Thread Dieter Menne
Karen Sargsyan wrote: Is it possible to replace function with my own? I want to apply pca clustering, but to use some strange correlation function. I'm asking about replacing, say, mean() with new content of mean() and use standard other functions, which might use mean() as part. The

Re: [R] Strange behavior of interval values in optimize()

2010-09-06 Thread Dieter Menne
Michael Bernsteiner wrote: I'm using optimize() to find the minimum of the following function f, and minimize it (without . But, when I choose a larger Interval in the optimization method: The result gets worse (even though the old interval is included in the new one). In

Re: [R] Uncompressing data from read.socket

2010-09-08 Thread Dieter Menne
raje...@cse.iitm.ac.in wrote: Is it possible to uncompress gzipped data coming over a socket? As far I remember a message by Brian Ripley (I could not find it, though), it's not possible directly. You have to save as a file and read from disk; see docs on connection. Dieter -- View

[R] SF-36 questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Dear useRs from the physiology department, Does someone know of an implementation of the SF-36 questionnaire scoring in R? I only found SAS and STATA versions, e.g http://gim.med.ucla.edu/FacultyPages/Hays/util.htm Dieter __ R-help@r-project.org

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Barry Rowlingson wrote: * SAS CODE FOR SCORING 36-ITEM HEALTH SURVEY 1.0 ... Thanks, Barry, but there was a mistake from my side: I am looking for SF-8. Anyone else? Google was not successful for me Dieter -- View this message in context:

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Frank Harrell wrote: I know someone who has R code for SF-36 and perhaps SF-12. Aren't there copyright issues relating to SF-* even if it is reprogrammed? You are right. I was not aware of this, and I could not believe it first that a company holds the right to use an almost trivial

Re: [R] Converting a line by line program into an array to perform summary stats

2010-09-29 Thread Dieter Menne
George Coyle wrote: I am trying to turn several lines of information into a variable. I used the filx function to input my file then the readlines to qualify what I want. Essentially I have data in a file every 10 minutes through a day for several years down a column: date time value

[R] Include externally generated pdf in output (without Sweave)

2010-10-03 Thread Dieter Menne
Dear useRs, I generated a simple image-based report using the sequence: pdf() plot(.) textplot( for short texts, from gplots) dev.off() Is there an easy way to include an single pdf-page from an external file (not R generated). Note: For final reports, I know how to use Sweave, but I

Re: [R] Include externally generated pdf in output (without Sweave)

2010-10-03 Thread Dieter Menne
Tal Galili wrote: You could potentially read an image file (like, for example, tiff) using something like read.picture {SoPhy} Thanks to you and Baptiste Auguie. Looks like the best way would be to import the picture as a pixel graphics with read.picture. It might be possible to read ps

Re: [R] Plotting by Group

2010-10-14 Thread Dieter Menne
Ado wrote: My data: XYSpecies Group 0 0A1 .. A1 .. A1 I want to plot X vs Y for each species onto the same

[R] Condition to factor (easy to remember)

2009-09-30 Thread Dieter Menne
Dear List, creating factors in a given non-default orders is notoriously difficult to explain in a course. Students love the ifelse construct given below most, but I remember some comment from Martin Mächler (?) that ifelse should be banned from courses. Any better idea? Not necessarily short,

Re: [R] Condition to factor (easy to remember)

2009-09-30 Thread Dieter Menne
David Winsemius wrote: # Typical C-Programmer style factor(levs[as.integer(data 10)+1], levels=levs) In your code the as.integer function is superfluous Oops... done too much c# lately, getting invalid cast challenged. Dieter -- View this message in context:

Re: [R] Condition to factor (easy to remember)

2009-10-01 Thread Dieter Menne
Douglas Bates-2 wrote: On Wed, Sep 30, 2009 at 2:42 PM, Douglas Bates ba...@stat.wisc.edu wrote: And besides, Frank Harrell will soon be weighing in to tell you why you shouldn't dichotomize in the first place. Subjects in this study received a 20 ml infusion of Kirsch (40%, Swiss

Re: [R] linear model with coefficient constraints

2009-10-06 Thread Dieter Menne
Rnewb wrote: I would like to perform a regression like the one below: lm(x ~ 0 + a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3, data=data) However, the data has the property that a1+a2+a3 = A, b1+b2+b3 = B, and c1+c2+c3 = C, where A, B, Ravi Varadhan has an example how this could be

Re: [R] Linear mixed effects model ?

2009-10-06 Thread Dieter Menne
Daniel Perkins wrote: Ideally we would do an ANCOVA to test for differences in slope or intercepts for the different streams. However as there were repeated measures and unequal n and unbalanced design, I have used a linear mixed effect model (from nlme package in R) in the form:

Re: [R] help with regexps

2009-10-07 Thread Dieter Menne
Luca Braglia-2 wrote: I'd like to match exactly numbers from 1 to 27. If you feel in masochistic mode, you can do it: b = c(32,3,17,27,28,57,a13) a = c(^([0-9]|[0-1][0-9]|2[0-7])$) grep(a,b,value=TRUE) A much more flexible way would be to isolate the numeric part first, and test for

Re: [R] communication of R Programs

2009-10-07 Thread Dieter Menne
wesley mathew wrote: I have one R program for writing data in XML File. suppose I can execute same program in different R section for writing different XML files but another R program need to read these data after i wrote in XML file. It is a bit unclear for me what you mean with 'R

Re: [R] how do I name data frames and files according to the index of a for loop?

2009-10-08 Thread Dieter Menne
Ken Ervin wrote: for (i in 1:2858) { ... write.table(Data_frame_name,file=~/file/goes/here.csv, append = FALSE, sep = \t,row.names = FALSE, col.names = c(Calc_1, Calc_2, Calc_3),qmethod = double) } use something like filename = paste(~/file/myfile,i,.csv,sep=)

Re: [R] re peat(?) measurement ANOVA or (general? mixed?) linear model?

2009-10-08 Thread Dieter Menne
Wolfgang Waser wrote: I subjected each of about 50 critters (about 10 each in 5 distinct populations) to 4 consecutive treatments (exposure to increasing concentrations), with one measurement per treatment and individual. ... Since I'm dealing with 'paired' data, and also with a

Re: [R] unordered multinomial logistic regression (or logit model) with repeated measures (I think)

2009-10-08 Thread Dieter Menne
drlucyasher wrote: I am attempted to examine the temporal independence of my data set and think I need an unordered multinomial logistic regression (or logit model) with repeated measures to do so. What I have thought of so far is glm(Location~ Pen| Bird*AMPM*Time,

Re: [R] Tabulation

2009-10-10 Thread Dieter Menne
Ashta wrote: I have a data set x1 x2 x3 1 2 1 1 2 3 2 1 2 1 2 1 3 1 1 I want to tabulate in the following way. 1 2 3 x13 2 1 x22 3 0 x33 1 1 It is just like frequency distribution See function table.

Re: [R] help with the use of mtext to create main title over multiple plots

2009-10-12 Thread Dieter Menne
Mark Kimpel wrote: I'm trying to use mtext to create a main title over multiple plots. Below is a simple self-contained example and my sessionInfo (I should note I've also tried this with R-2.8.1 with the same results). When I execute the code ... Thanks for your nice example

Re: [R] Ordinal response model

2009-10-12 Thread Dieter Menne
drlucyasher wrote: The questionnaire has a section which contains a particular issue and then questions which are related to this issue (and potentially to each other): 1) importance of the issue (7 ordinal categories from -3 to +3) 2) impact of the impact (7 ordinal categroies from -3

Re: [R] Speed up and limit memory usage of lm()

2009-10-12 Thread Dieter Menne
gauti wrote: I have been doing series of linear regression models lm(). In this case the execution time and memory usage becomes a huge issue. I have therefore been trying to speed the process and limit the memory usage. Have a look at package biglm. Dieter -- View this message

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread Dieter Menne
Richard Liu wrote: I'm new to R. I'm working with the text mining package tm. I have several plain text documents in a directory, and I would like to read all the files with extension .txt in that directory into a vector, one text document per vector element. That is, v[1] would be the

Re: [R] Lattice barchart-reordered

2009-10-13 Thread Dieter Menne
Veerappa Chetty wrote: Hi,Can I use reorder function with barchart as in dotchart? Here are some codes which do not work for me. .. example remove As your example is not self-contained (it should be), I cannot show it with your data. My preferred way is to reorder outside, because it

Re: [R] Selecting initial numerals

2009-10-13 Thread Dieter Menne
PDXRugger wrote: II just want to create a new object with the first two numerals of the data. Not sure why this isnt working, consider the following: EmpEst$naics=c(238321, 624410, 484121 ,238911, 81, 531110, 621399, 541613, 524210 ,236115 ,811121 ,236115 ,236115 ,621610 ,814110

Re: [R] How to read plain text documents into a vector?

2009-10-14 Thread Dieter Menne
Richard Liu wrote: There are actually two vignettes. Both have examples of a vector of characters being made into a tm corpus, but neither shows how to read documents on the file system into the vectors. I tried the other two suggestions, but paste seemed not to glue the separate lines

Re: [R] attach

2009-10-14 Thread Dieter Menne
Christophe Dutang1 wrote: I would like to know what happens on the memory side when I use attach(inputdata) Is there a second allocation of memory for inputdata? Not, it just guides the syntax. Christophe Dutang1 wrote: Is it better not to use attach function? A qualified

Re: [R] heatmap.2

2009-10-14 Thread Dieter Menne
John Celniker wrote: ... when I try to change the breaks to: br2 [1] 0.000 0.5337751 1.0675502 1.6013253 2.1351003 3.000 3.500 4.000 4.500 [10] 4.8039758 I get the correct heatmap representation but the color key does not update correctly to reflect changes in

Re: [R] update.formula drop interaction terms

2009-10-14 Thread Dieter Menne
Eleni Rapsomaniki-2 wrote: How do I drop multiplication terms from a formula using update? e.g. forml=as.formula(Surv(time, status) ~ x1+x2+A*x3+A*x4+B*x5+strata(sex)) The easiest way is to write the formula again without the A's. Dieter -- View this message in context:

Re: [R] How to read plain text documents into a vector?

2009-10-14 Thread Dieter Menne
kenhorvath wrote: Dieter Menne wrote: library(tm) filenames = list.files(path=.,pattern=\\.txt) docs = for (filename in filenames){ docs = c(docs,paste(readLines(file(filename)),collapse=\n)) } docs ## continue as in example vs = VectorSource(docs) If in any way

Re: [R] Handle lot of variables - Regression

2009-10-14 Thread Dieter Menne
anna0102 wrote: I've got a data set (e.g. named Data) which contains a lot of variables, for example: s1, s2, ..., s50 My first question is: It is possible to do this: Data$s1 But is it also possible to do something like this: Data$s1:s50 (I've tried a lot of versions of those without

Re: [R] negative length vectors are not allowed in wilcox.exact() and perm.test()

2009-10-16 Thread Dieter Menne
David Croll wrote: I want to compare two datasets and I get the message Error in .Call(cpermdist2, ma = as.integer(m), mb = as.integer(col), : negative length vectors are not allowed after specifying the exact test. I'm using the exactRankTests package. Do you suggest me using the

Re: [R] Proper syntax for using varConstPower in nlme

2009-10-16 Thread Dieter Menne
Michael A. Gilchrist wrote: - nlme(Count ~ quad.PBMC.model(aL, aN, T0), + data = tissueData, + weights = varConstPower(form =~ Count), + start = list( fixed = c(rep(1000, 8), -2, -2) ), + fixed = list(T0 ~ TypeTissue-1, aL ~ 1, aN ~

Re: [R] Variant of cloud with sticks from points to surface

2009-10-19 Thread Dieter Menne
PerfectTiling wrote: (1) plot a perspective view of a 3D scatterplot, with a fitted (curved) surface; (2) have a stick from each point vertically to the surface. The latter helps one visualize where a point lies in 3D, relative to the surface. Is there a variant of the cloud

Re: [R] lmer family=binomal p-values

2009-10-19 Thread Dieter Menne
Krystyna Golabek wrote: Using AIC for model selection I find my minimal model is FOLLOW~MOVERSTATUS+DISTANCE however it appears DISTANCE is not significant at 95% confidence, see output quoted below. However, removing DISTANCE gives a higher AIC=433.5, therefore I will keep it in, but

Re: [R] cut2 once, bin twice...

2009-10-23 Thread Dieter Menne
sdanzige wrote: I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to

Re: [R] Exclude rows in xyplot

2009-10-27 Thread Dieter Menne
Joel Fürstenberg-Hägg wrote: Now I'm trying to make xyplots to compare the result from three different categories: # Plot Pro against Glc for each of the three categories xyplot(Pro ~ Glc | Categories_BBCH_ID, data=fieldTrial0809, pch=°, layout=c(1, 3), aspect=1,

Re: [R] need help explain the routine input parameters for seROC and cROC found in the R archive

2009-10-28 Thread Dieter Menne
waverley palo wrote: I found the code in the archive. The author of this script says: The first function (seROC) calculate the standard error of ROC curve, the second function (cROC) compare ROC curves. From: Bernardo Rangel Tura ... The original post has given the definition

Re: [R] how can I convert .csv format to matrix???

2009-11-02 Thread Dieter Menne
bbslover wrote: In my disk C:/ have a a.csv file, I want to read it to R, importantly, when I use x=read.csv(C:/a.csv) ,the x format is data.frame, I want to it to become matrix format, how can I do it ? as.matrix should do the job; if it does not (second example), you probably

Re: [R] save an object by dynamicly created name

2009-11-02 Thread Dieter Menne
jeffc wrote: Hi, I would like to save a few dynamically created objects to disk. The following is the basic flow of the code segment for(i = 1:10) { m = i:5 save(m, file = ...) ## ??? } To distinguish different objects to be saved, I would like to save m as m1, m2, m3 ...,

Re: [R] re ading tokens

2009-11-03 Thread Dieter Menne
j daniel wrote: I am not familiar with processing text in R. Can someone tell me how to read each line of words as separate elements in a list? FE, I would like to turn: word1 word2 word3 word2 word4 into a list of length two with three character elements in the first list and

Re: [R] RMySQL and Stored procedures

2009-11-03 Thread Dieter Menne
Orvalho Augusto wrote: Can someone provide me a good way to circumvent the lack of calling Stored Procedures from RMySQL? I can not rewrite those stored procedures on R because there a lot more folks here that only understands SQL. The stored procedure returns a resultset. Use

Re: [R] Incomplete, unbalanced design, and pseudoreplication?

2009-11-09 Thread Dieter Menne
Jennifer Mollon wrote: The response is a measurement - the amount of DNA extracted during the experiment. There were 2 factors to be tested - one is the condition under which the experiment took place and the other is the type of DNA to be extracted. Each set of factors was

Re: [R] Numeric formatting question

2009-11-10 Thread Dieter Menne
Michael Pearmain-2 wrote: Hi All, I have am using Sweave and the \Sexpr{} to place some numeric variables in my tex document. I want to format the number prior to entry so they read slightly more elegantly. Say i have the following numbers x - 0.00487324 y - 0.00432 z - 0.567

Re: [R] Re moving levels of a factor

2009-11-10 Thread Dieter Menne
Henrik Wahren wrote: How can one or more levels be removed from a factor of a data frame. There was a similar post on how to do this when a factor meets some criterion (e.g. = 2), but I can¹t seem to get that solution to work. Here, I simply want to drop some levels. Simply call

Re: [R] nlsList{nlme} control of min and max parameter bounds?

2010-04-15 Thread Dieter Menne
[via R] [mailto:ml-node+1840738-635202493-63...@n4.nabble.com] Sent: Thursday, April 15, 2010 5:03 AM To: Dieter Menne Subject: Re: nlsList{nlme} control of min and max parameter bounds? Thanks Dieter That solved the issue. I had negative parameters but I customized a selfStart function

Re: [R] Regression using R

2010-04-16 Thread Dieter Menne
Samuel Bravo wrote: I'm working on a very large project in which we do many calculations which include many types of regression such as, Liner, Quadratic, Cubic, Exponential, Sinusoidal, and Logarithmic. Students are often looking at the wrong place. It's not intuitive that quadratic,

Re: [R] comparing attitudes of 2 groups / likert scales?

2010-04-19 Thread Dieter Menne
Mona_m wrote: For my dissertation, which is due way too soon, I am doing a survey, comparing attitudes of 2 independent groups, with 5 scale likert questions. Basically I want to show if they have similar or different attitudes. I am testing 4 hypotheses, and have in total about 20

Re: [R] comparing attitudes of 2 groups / likert scales?

2010-04-19 Thread Dieter Menne
David Winsemius wrote: If you are thinking of using that quote, you might want to check the spelling of his name. My memory is van Belle. Sorry, I thought I had corrected that before mailing. @BOOK{vanBelle2002, title = {Statistical rules of thumb}, publisher = {Wiley series in

Re: [R] User inputs

2010-04-21 Thread Dieter Menne
chrisli1223 wrote: (1) I have written a script which requires user input. I am using the readline() command.However, everytime when I run the script, R does not wait for the user input and proceed to the next line. Is there something like par(ask=T) to solve this problem? Depends on how

Re: [R] Errors when trying to open odfWeave documents

2010-05-02 Thread Dieter Menne
Paul Hurley wrote: Is there a known problem with odfWeave on Windows? I've seen some messages on R-help from a year or two back where people couldn't install the XML package, but XML installed fine on my Windows box (it was more tricky on Kubuntu, but worked in the end). There was

Re: [R] Ordering variables in a parallel coordinates plot

2010-01-03 Thread Dieter Menne
Hi, Tal, Tal Galili wrote: In any case, my question wasn't on how to reorder the columns (that is simple), but on how to choose what order to put them in. So is your question answered? Or what exactly is the problem using the example below? library(lattice) parallel(~iris[1:4] |

Re: [R] R2HTML Report number format, or Better Way?

2010-01-03 Thread Dieter Menne
L.A. wrote: Here I am again with question I'll feel foolish for asking, when I see the answer. I'm trying to produce a report and here's where I get stuck: srtype-cbind(Par,Sal,Median,COD,PRD,LowerCI,UpperCI) srtype Chances are better to get a reply when you supply the data as

Re: [R] R2HTML Report number format, or Better Way?

2010-01-03 Thread Dieter Menne
L.A. wrote: For the second, As a beginner, is this what you mean by supply the data as code? The actual data is 17000 rows and 31 columns. In your case, it is irrelevant if the data are 17000x31 or 2x3, so an example with few columns is sufficient. And if you supply the data in code,

Re: [R] how to draw abline correctly?

2010-01-04 Thread Dieter Menne
aegea wrote: 1, the red line is added on the graph but without any marker on the y-axis. I want to display the number '.1361' on the y-axis. So people can easily tell 'method 2' gets a constant estimate, which is 0.1361. 2, since 'method2' is a constant. I prefer in the legend area, it

Re: [R] Boxplot- change the vertical line from dash to solid

2010-01-04 Thread Dieter Menne
elaine kuo wrote: Now I am learning to draw boxplot using graphics(). I want to change the vertical line penetrating the box from dashed line to solid line Check the documentation on bxp; there is an example mimic S-Plus that shows how to customize boxplot. Dieter -- View this

Re: [R] spectrogram

2010-01-04 Thread Dieter Menne
rajesh j wrote: I need to plot spectrogram of a waveform.What package offers this? Try spectrogram in r-help search. Dieter -- View this message in context: http://n4.nabble.com/spectrogram-tp998119p998146.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Extract vector elements until cumsum = x

2010-01-04 Thread Dieter Menne
Dgnn wrote: I have a vector n, and for each n[i] I want to extract n[i], n[i+1], n[i+2]..., until the cumulative sum of n[i] and subsequent elements exceeds a CheckValue, whereupon I move to the next index and repeat. I am trying to find a Vectorized approach, and have seen similar

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Dieter Menne
AD Hayward wrote: I'm attempting to use a piecewise regression to model the trajectory of reproductive traits with age in a longitudinal data set using a mixed model framework. You might have a look a Alejandro Jara DPpackage which worked quite well for me in a similar case. There

[R] Fast nested List-data.frame

2010-01-04 Thread Dieter Menne
I have very large data sets given in a format similar to d below. Converting these to a data frame is a bottleneck in my application. My fastest version is given below, but it look clumsy to me. Any ideas? Dieter # --- len = 10 d = replicate(len, list(pH = 3,marker =

Re: [R] Fast nested List-data.frame

2010-01-05 Thread Dieter Menne
Greg Hirson wrote: I'd approach this by first making a matrix, then converting to a data frame with appropriate types. Well, I knew that matrixes are faster for numerics, but I also knew that the required conversion to character would be a show-stopper. My second wisdom was bogus. Your

Re: [R] Fast nested List-data.frame

2010-01-05 Thread Dieter Menne
This is better by a factor of 4: len = 10 d = replicate(len, list(pH = 3,marker = TRUE,position = A),FALSE) system.time( { pHAll = data.frame( pH = unlist(lapply(d,[[,1)), pH = unlist(lapply(d,[[,2)), pH = unlist(lapply(d,[[,3))) } ) Dieter -- View this message in

Re: [R] Data replacement

2010-01-05 Thread Dieter Menne
Lisa wrote: I have a dataset that looks like this: data idcode1code2 1 114 2 123 3 244 .. I want to change some numbers in the columns of “code1” and “code2” based on “indx” as below

Re: [R] How do I calculate r^2 of SSasymp non-linear regression model in R?

2010-01-07 Thread Dieter Menne
zia207 wrote: Is it possible to get r^2 value of SSasymp non-linear regression model in R. See Douglas Bates' comments why the lack of r^2 is a feature, not a bug: http://www.ens.gu.edu.au/ROBERTK/R/HELP/00B/0399.HTML Dieter -- View this message in context:

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Dieter Menne
Duncan Murdoch wrote: What's so hard about leaving an R session running, and using bookmarks as Dieter described? It pollutes my space, and I am a Window-closing maniac, so it won't survive the next attack.

Re: [R] Building static HTML help pages in R 2.10.x on Windows

2010-01-08 Thread Dieter Menne
Hi, Duncan, If that works, writing up instructions would be a useful contribution. It was always a bit of a mess, and after 15 minutes this morning I had to go. So I hoped someone else would jump the wagon. Dieter -- View this message in context:

  1   2   3   4   5   6   7   8   9   10   >