Re: [R] how to smooth timeseries without the lagging?

2009-07-25 Thread Dieter Menne
losemind wrote: If I use a moving average, it will smooth the choppy time series, but it will lead to lagging... The lagging can only be removed if you look into the future, otherwise you run into causality problems. So the easiest way is to center your output data on half the window

Re: [R] CI wiskers

2009-07-24 Thread Dieter Menne
mfreidin wrote: I have a matrix containing means and CIs (lower and upper in two columns, so three columns for every data point) for several points. I have to build a graph of these means accompained by the CIs (as wiskers). No problems with making the graph of means, but I don't know how

Re: [R] Select value according two vectors...

2009-07-21 Thread Dieter Menne
MarcioRibeiro wrote: I have a problem in identifying a value between two vectors... Suppose vector A is... 0. 0.0909 0.0909 0.1818 0.2727 0.3636 0.4545 0.6363 0. 0. 0. 0. And vector B is... 3 5 7 18 43 85 91 98 100 130 230 487 I would like to identify the

Re: [R] Select value according two vectors...

2009-07-21 Thread Dieter Menne
Steve Lianoglou-6 wrote: On Jul 21, 2009, at 11:28 AM, Dieter Menne wrote: Or, more simply: R a - c(0., 0.0909, 0.0909, 0.1818, 0.2727, 0.3636, 0.4545, 0.6363, 0., 0., 0., 0.000) R b - c(3, 5, 7, 18, 43, 85, 91, 98, 100, 130, 230, 487) R b[a .5] [1] 98

Re: [R] RODBC results from stored procedure

2009-07-20 Thread Dieter Menne
tradenet wrote: Thanks Dieter. The date argument isn't a problem. When I invoke the stored proc execution with the date arguments the stored proc runs fine, but RODBC doesn't wait for the stored proc to finish and return results. Don't understand that one. How do you know that is

Re: [R] Fisher's exact test

2009-07-17 Thread Dieter Menne
James Allsopp-2 wrote: Hi, I'm trying to run Fisher's Exact test on the data below, but I'm not Bound Unbound HDL27 9 LDL 8 2 fisher.test(data) At odds of 3 and 4 with one count =2, even the best test won't help. Dieter -- View this message in context:

Re: [R] Solving two nonlinear equations and two knowns

2009-07-17 Thread Dieter Menne
yhsu6 wrote: I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this? BTW, I also try to use grid searching. But I have no

Re: [R] storing lm() results and other objects in a list

2009-07-16 Thread Dieter Menne
Idgarad wrote: ... Very long non-self-contained code removed Suggestions on how to handle the whole linearModel and the child data? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Coplot - How to change the panel order ?

2009-07-16 Thread Dieter Menne
djacinto wrote: I want to change the order of the panels in a Coplot (2x2 panels). Instead of the default order of the panels from bottom left to top right, I would like to display them from top left to bottom right. coplot is a bit a dinosaur from times when there was no lattice in R.

Re: [R] (simple) xml into data.frame and reverse

2009-07-15 Thread Dieter Menne
Duncan Temple Lang wrote: I wrote some relatively general functions, but hastily written functions to read this sort of data. You can find them attached or at http://www.omegahat.org/RSXML/xmlToDataFrame.xml Looks like that's the wrong link. I also did not find it mentioned

Re: [R] Grouping data in dataframe

2009-07-15 Thread Dieter Menne
Timo Schneider wrote: I have a dataframe (obtained from read.table()) which looks like ExpA ExpB ExpC Size 1 12 2333 1 2 12 2429 1 3 10 2234 1 4 25 5060 2 5 24 5362 2 6 21

Re: [R] duplicate data points on a line graph

2009-07-15 Thread Dieter Menne
LARC/J.L.Shipman/jshipman wrote: I am new to R plot. I am trying to increase the data point observation when duplicate data points exist x y 1 10 1 10 2 3 4 5 9 8 in the about example 1, 10 would be displayed larger than the other data points.

Re: [R] RODBC results from stored procedure

2009-07-15 Thread Dieter Menne
tradenet wrote: Short of uploading a SQL server database, I don't think I can make this example reproducible, but I hope it's not so complicated as to require reproducibility I can call a parametrized stored procedure without a problem and the proc does indeed execute successfully.

Re: [R] nls - find good starting values

2009-07-14 Thread Dieter Menne
antje-4 wrote: I have several data sets, I'd like to fit to a gaussian distribution. I've tried to give an estimate of the mean and the sd of this distribution but still, I run into problems if these estimates are not close enough. For example, nls() breaks with this message:

Re: [R] Nonlinear Least Squares nls() programming help

2009-07-13 Thread Dieter Menne
MathZero wrote: Hi, I am trying to use the nls() function to closely approximate a vector of values, colC and I'm running into trouble. I am not sure how if I am asking the program to do what I think its doing, because the same minimization in Excel's Solver does not run into problems.

Re: [R] Problem with groupedData and lme

2009-07-03 Thread Dieter Menne
MUHC-Research wrote: I'm currently having trouble with the implementation of a groupedData object in the lme() function. Executing the following function applyScalingSimp - function(input.population) { ## GA is a time value varInOrder - c(GA,weight,grouping,sex)

Re: [R] symbols duplicated in plot output

2009-06-30 Thread Dieter Menne
baptiste auguie-5 wrote: pdf() plot(1, xlab=expression(mu)) dev.off() If I open this pdf in Illustrator CS4, there are two mu on top of each other, giving it a somewhat bold aspect. Other characters not from the symbol font are just output in one version. I'm guessing this may be

Re: [R] Sweave: multiline Sexpr?

2009-06-30 Thread Dieter Menne
HufferD wrote: Is there any way to have Sexpr span multiple lines? Use an R block to create the output as as string, and Sexpr that one. It's anyway much more readable than to hide complex calculations in the latex part. Dieter -- View this message in context:

Re: [R] Compute correlation matrix for panel data with, specific ordering

2009-06-29 Thread Dieter Menne
Serguei Kaniovski Serguei.Kaniovski at wifo.ac.at writes: Ok I see how to sort the factors, but how do I compute the correlation matrix in a repeated observations dataset (see the first part of my question) Repeated observations? You must be more specific then. Which function are you using

Re: [R] Lattice and high-resolution tiffs

2009-06-29 Thread Dieter Menne
r-help.20.trevva wrote: I am trying to produce high-resolution (600dpi+) TIFF figures for use in a publication. Everything seems to work well when using the normal R-graphics and the relative text size obtained is independent of the output resolution. However, when I try and make lattice

Re: [R] multiple regression w/ no intercept; strange results

2009-06-28 Thread Dieter Menne
I am writing some software to do multiple regression and am using r to benchmark the results. The results are squaring up nicely for the with-intercept case but not for the no-intercept case. I am not sure what R is doing to get the statistics for the 0 intercept case. ... It seems odd to me

Re: [R] Compute correlation matrix for panel data with specific ordering

2009-06-27 Thread Dieter Menne
Serguei Kaniovski Serguei.Kaniovski at wifo.ac.at writes: df - data.frame(cbind(rep(c(AUT,BEL,DEN,GER),4), cbind(rep(c(1999,2000,2001,2002),4)),sample(10,16,replace=T))) names(df) - c(country,year,x) SORT - c(GER,BEL,DEN,AUT) I need to compute the correlation between countries in the

Re: [R] How to automatically placing a legend in empty space

2009-06-27 Thread Dieter Menne
Jason Rupert jasonkrupert at yahoo.com writes: At one point I believe I heard of an R package that would automatically find the most empty space in a plot, and then that answer could then be used to intelligently place a legend. Have a look a some of the plotting function in package Hmisc.

Re: [R] Re gression; how to get t-values for all parameters estimates

2009-06-27 Thread Dieter Menne
gzf200 wrote: Even after a couple of hours looking at old messages I still haven't found a solution for my problem. I'm trying to fit an additive linear regression model with 2 effects, both fixed, to some dataset. The function contrasts(effectA) - contr.sum can gaurantee that the

Re: [R] panel.text and saving to pdf

2009-06-26 Thread Dieter Menne
Willem Vervoort w.vervoort at usyd.edu.au writes: I am not sure what I am doing wrong, but I have some unexplained behaviour when saving a lattice graph including text to a pdf file. The text seems to move around. It must have something to do with the way coordinates are set in devices other

Re: [R] Matching data to a new column

2009-06-26 Thread Dieter Menne
Kubasiewicz, Laura laura.kubasiewicz08 at imperial.ac.uk writes: I have a dataframe with columns for... 'I.D' 'age' 'mothers I.D' 01 5 03 02 6 06 03 16 NA 04 8 06 05 3 NA 06 17 NA I need to create a new column for 'mothers

Re: [R] List subsetting

2009-06-25 Thread Dieter Menne
Ivo Shterev wrote: I have a question about list indexing. Lets say we have a list of 3 lists, each containing 3 different type elements: (Details of your nice example code removed) a=replicate(3, list(list(c(1,1,1), diag(3), c(2,2,2 str(a) # I prefer this to print(a) because

Re: [R] change the height or scale of the y axis

2009-06-25 Thread Dieter Menne
legen wrote: I have a question about changing the height or scale of the y axis. When I use following two R codes, I can get two plots. Please look at the y axes, the number of indices (x1, x2, …) on the y axis in the first plot is smaller than that in the second plot, and hence the

Re: [R] Lose of decimal when using write.table to text file

2009-06-25 Thread Dieter Menne
Bob Ly robertly at vfemail.net writes: I have the following: Date-c(08/05/08,08/06/08,08/07/08) Weight-c(209.4,211.8,210.0) planned.meal-cbind(Date,Weight) planned.meal DateWeight 1 08/05/08, 209.4 2 08/06/08, 211.8 3 08/07/08, 210.0 This is strange. When I run your

Re: [R] what happened to the xlsReadWrite package

2009-06-25 Thread Dieter Menne
Andrew Yee yee at post.harvard.edu writes: A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Are there any plans for it be available again? Presumable removed because it

Re: [R] Help LSD multiple comparison test

2009-06-24 Thread Dieter Menne
Chunhao Tu wrote: I know this is a old question but I did not see any clear answer. Is there any way or package to perform LSD test in R such as H0: A=B. H0, A=C and H0 B=C. Package agricolae. Dieter -- View this message in context:

Re: [R] nls vs nlme: parameter constraints

2009-06-23 Thread Dieter Menne
Manuel Morales wrote: I'm trying to fit a model like beta[trt]/(1+alpha*x) where the data include some grouping factor. The problem is that the estimate for alpha is undefined for some of the treatments - any value greater than 20 is equally good and a step function would suffice.

Re: [R] What has happened to the R-Help Google Groups Archive? Alternative?

2009-06-23 Thread Dieter Menne
Tony Breyal wrote: Is there an alternative website which uses a similar structure to google groups? I had a quick browse on the R Wiki (http://wiki.r-project.org/rwiki/doku.php?id=links:links) but didn't see a page with this sort of info. For reading and searching, nothing beats

Re: [R] SAS-like method of recoding variables?

2009-06-23 Thread Dieter Menne
P.Dalgaard wrote: IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2); vehicles - ifelse(TYPE=='TRUCK' count=12, TRUCK+((CAR+BIKE)/2.2), NA) Read both versions to an audience, and you will have to admit that this is one of the cases where SAS is superior. Dieter

Re: [R] SAS-like method of recoding variables?

2009-06-23 Thread Dieter Menne
Simon Blomberg-4 wrote: I'm not sure we should measure superiority by how well a statement parses into English. If this were true, we would all be programming in COBOL. P.Dalgaard wrote: IF TYPE='TRUCK' and count=12 THEN VEHICLES=TRUCK+((CAR+BIKE)/2.2); vehicles -

Re: [R] SAS-like method of recoding variables?

2009-06-23 Thread Dieter Menne
David Hajage-2 wrote: You can also use if (cond) then {something} if you don't like ifelse() function. See ?Control. The minor difference that if() is not vectorized is a source of FAQs. Dieter -- View this message in context:

Re: [R] How to exclude insignificant intercepts using step function

2009-06-23 Thread Dieter Menne
David Winsemius wrote: On Jun 23, 2009, at 3:08 AM, Chris Friedl wrote: The point is that in very few applications can one legitimately exclude an intercept. In this situation (stepwise regression) I am able to think of a way to make the intercept just another covariate, but I

Re: [R] SAS-like method of recoding variables?

2009-06-23 Thread Dieter Menne
Frank E Harrell Jr wrote: Here's a case where SAS is clearly not superior: IF type='TRUCK' AND count12 THEN vehicles=truck+(car+bike)/2.2; If count is missing, the statement is considered TRUE and the THEN is executed. This is because SAS considers a missing as less than any

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Dieter Menne
Paulo Cardoso wrote: How can I convert from 8-bit RGB color to [0-1] interval (sRGB) and vice-versa? If you have the R/G/B values separately, divide by 255, and use function rgb in grDevices. If you have the hex values, paste these into a string, and use something like col2rgb(#2C312C)

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Dieter Menne
Barry Rowlingson wrote: 8-bit color graphics often refers to a situation where each pixel is 8 bits, and the colour comes from a 256-colour palette lookup table. If you really have a 8 bit palettized colour lookup, as Barry assumes, you better use one of the build-in conversions, for

Re: [R] Using a variable for mysql/database Query

2009-06-23 Thread Dieter Menne
jorgusch hackl.schorsch at web.de writes: Collecting data I need to check in a mysql server. As the data are dependent on each other I have to filter first. However, I have now the problem that I find a value and would like to insert it into a data query for the real select command.

Re: [R] Error when using step

2009-06-22 Thread Dieter Menne
Chris Friedl cfriedalek at gmail.com writes: I have two questions about the built-in function step. Ultimately I want to apply a lm fitting and subsequent step procedure to thousands of data sets groups by a factor defined as a unique ID. Q1. The code below creates a data.frame comprising

Re: [R] xyplot: subscripts, groups and subset

2009-06-22 Thread Dieter Menne
Auty, Dave dave.auty at forestry.gsi.gov.uk writes: I'm running the following code to produce lattice plots of microfibril angle versus ring number in Scots pine. There are 12 trees and 5 sample positions (Position) in each tree: xyplot(MFA ~ RN | Tree, data = MFA.data, groups

Re: [R] How to make try to catch warnings in logistic glm

2009-06-22 Thread Dieter Menne
Fredrik Nilsson-5 wrote: From an earlier post I got the impression that one could promote warnings from a glm to errors (presumably by putting options(warn=1)?), then try() would flag them as errors. I’ve spent half the day trying to do this, but no luck. Do you have an explicit solution?

Re: [R] last.warning and Sweave?

2009-06-09 Thread Dieter Menne
Ben Bolker bolker at ufl.edu writes: Sweave does something clever with warnings, which I have so far been ... I thought I could get around this with last.warning , but apparently that doesn't work -- this file doesn't produce the desired output of reproducing the last warning ...

Re: [R] RODBC package: how to check whether connection is open

2009-05-29 Thread Dieter Menne
Stavros Macrakis-2 wrote: What is the recommended way of checking whether an RODBC connection is open? Since odbcValidChannel is not exported from namespace RODBC, I suppose I shouldn't be using it. This is the best I could come up with, but it seems a bit 'dirty' to be using a

Re: [R] labels in rgl.sphere

2009-05-29 Thread Dieter Menne
Naoki Irie-3 wrote: I am using rgl.sphere to visualize scatter plot data in three dimensional space. However, as I can not see the labels of each data point directly in RGL window, I usually look for the values of x, y, z axis to find out the label (or line number of the data point).

Re: [R] Problem loading rJava

2009-05-29 Thread Dieter Menne
Josef.Kardos at phila.gov writes: I finally realized I didn't have Java installed on my computer, so I downloaded Java and tested that it works. I then attempted to reinstall rJava and load the package, but got this; utils:::menuInstallLocal() package 'rJava' successfully unpacked

Re: [R] Interaction plots as lines or bars?

2009-05-28 Thread Dieter Menne
Michael Kubovy wrote: An editor has suggested that I use bar plots to capture an interaction of two 2-level factors and an interaction of a 2 by 3 factorial experiment. (It would seem that there's a fear that someone might try to interpolate between, e.g., 'male' and 'female'.) In

Re: [R] alternative to built-in data editor

2009-05-28 Thread Dieter Menne
urlwolf wrote: I often have to peek at large data. While head and tail are convenient, at times I'd like some more comprehensive. I guess I debug better in a more visual way? I was wondering if there's a way to override the default data editor. I have never seen the data editor. The

Re: [R] Re ad name multiple excel sheets using RODBC

2009-05-28 Thread Dieter Menne
simeon duckworth wrote: I'd like to be able to read multiple sheets from an excel workbook and use the sheet name to name the resulting dataframe using RODBC. In Microsoft theory, something like the below should be ok (note the $), but never managed to get this to work. The same method

Re: [R] Still can't find missing data

2009-05-28 Thread Dieter Menne
Farley, Robert wrote: I can't get the syntax that will allow me to show NA values (rows) in the xtabs. lengthy non-reproducible example removed If you want a reproducible answer, prepare a reproducible result. And check that the syntax is na.action=na.pass Dieter -- View this

Re: [R] Re ad name multiple excel sheets using RODBC

2009-05-28 Thread Dieter Menne
Hans-Peter Suter wrote: If you only have the sheet names, you should use package xlsReadWrite which is rather fast, but has some limitations in the non-commercial version. what limitations, i.e. features do you miss? Reading of named ranges. Dieter -- View this message in

Re: [R] boxplot

2009-05-28 Thread Dieter Menne
amor Gandhi wrote: Hi gues, This should read: Hi, guess what I want   amor Gandhi wrote: Is there any function in R for boxplot with different time points? t1 - c(rep(1,20),rep(2,20)) t2 - c(rep(1,10),rep(2,10),rep(1,10),rep(2,10)) x - rnorm(40,5,1) dat - data.frame(t1,t2,x)

Re: [R] Harmonic Analysis

2009-05-27 Thread Dieter Menne
mauede at alice.it writes: I am looking for a package to perform harmonic analysis with the goal of estimating the period of the dominant high frequency component in some mono-channel signals. You should widen your scope by looking a time series instead of harmonic analysis. There is a

Re: [R] using lsoda() and nls() together

2009-05-27 Thread Dieter Menne
bbouling wrote: Thanks to Dieter Menne and Spencer Graves I started to get my way through lsoda() Now I need to use it in with nls() to assess parameters I have a go with a basic example dy/dt = K1*conc I try to assess the value of K1 from a simulated data set with a K1 close

Re: [R] Using package exams and xtable

2009-05-27 Thread Dieter Menne
M Berg wrote: str(rx) num [1:16] 21 9 8 18 4 12 17 2 9 7 ... I want to print out the entire vector as part of the problem. When I use \Sexpr(rx) only the first value (in this case 21) is printed out. rx = 1:10 rxs = paste(rx,collapse=, ) So \Sexpr{paste(rx,collapse=, )} should

Re: [R] Still can't find missing data

2009-05-27 Thread Dieter Menne
Farley, Robert FarleyR at metro.net writes: What is wrong? I've looked into the na commands and the ?xtabs entry, but I haven't found anything that works. I never understood the logic that exclude=NULL needs na.action in addition. test - c(1,2,3,1,2,3,NA,NA,1,2,3)

Re: [R] How to exclude a column by name?

2009-05-27 Thread Dieter Menne
Peter Dalgaard P.Dalgaard at biostat.ku.dk writes: Or, BTW, you can use within() aq - within(airquality, rm(Day)) Please add this as an example to the docs of within. Dieter __ R-help@r-project.org mailing list

Re: [R] How to google for R stuff?

2009-05-20 Thread Dieter Menne
spencerg spencer.graves at prodsyse.com writes: de - RSiteSearch.function(differential equation) des - RSiteSearch.function(differential equations) # With de and des, each finds things missed by the other. de. - de | des # combine into one sumDE - packageSum2(de.) # add details on installed

Re: [R] Coord_equal in ggplot2

2009-05-19 Thread Dieter Menne
ONKELINX, Thierry Thierry.ONKELINX at inbo.be writes: I'm plotting some points on a graph where both axes need to have the same scale. See the example below. Coord_equal does that trick but in this case it wastes a lot of space on the y-axis. Setting the limits of the y-axis myself was no

Re: [R] Using while statements to insert rows in a dataframe

2009-05-19 Thread Dieter Menne
Eric McKibben wrote: Within column 6 (Question) the numbers 1:33 repeat down the entire column. Occasionally, however, another value (-32767) appears. I need to locate this value everytime it appears and in its place insert 33 rows that are numbered 1:33 in column Question.

Re: [R] Measures

2009-05-18 Thread Dieter Menne
Rafael Marconi Ramos rafaelmr at gmail.com writes: 1) (Goodman Kruskal) lambda 2) (Thiel's) uncertainty coefficient Dear Rafael, have you tried to search for Goodman Kruskal (solution be J Baron) and Thiel (comments by Marc Schwartz and Frank Harrell)? Dieter

Re: [R] One Sample Nonparametric

2009-05-18 Thread Dieter Menne
Charles Van deZande cvandy26 at gmail.com writes: I'm doing one and two sample nonparametric tests for the median using wilcox test. For a one-sample test I use: wilcox.test(x, mu =50 (or whatever), y=NULL,correct=TRUE) For two-sample test I use: wilcox.test(x,y,correct=TRUE) The

Re: [R] How do you save in R?

2009-05-18 Thread Dieter Menne
prixel snickersoof at yahoo.com writes: I know it sounds like a silly question but whenever i click on save to file it doesn't save. Assuming it is Windows GUI and not your grandmother's knitting needles, save to file writes the selected part of the GUI to a file and is not that useful as a

Re: [R] How do you save in R?

2009-05-18 Thread Dieter Menne
Patrick Burns pburns at pburns.seanet.com writes: I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether you want the objects in the file to remain separate ('attach') or mixed into the global environment ('load'). Technically a good point, but

Re: [R] Newton's method for finding roots

2009-05-17 Thread Dieter Menne
Kon Knafelman konk2001 at hotmail.com writes I need to use netwon's method to find the root of a polynomial, .. It't time to get your homework date May 12 submitted. http://markmail.org/message/x5vdbync3gxfs5hp Dieter __ R-help@r-project.org

Re: [R] Using column length in plot gives error

2009-05-17 Thread Dieter Menne
MikSmith mike at hsm.org.uk writes: I'm trying to write a generic script for processing some data which finishes off with some plots. Given Im never sure how many columns will be in my dataframe I wanted to using the following plot(spectra.wavelength, cormat, type = l, ylim=c(-1,1),

Re: [R] Graphical output format

2009-05-15 Thread Dieter Menne
Stats Wolf stats.wolf at gmail.com writes: Postscript, however, does not have to be what I need for two reasons. First, it does not accept some special characters from foreign languages (exactly like PDF). You should given an example for that in pdf. I always had the impression that pdf is

Re: [R] Graphical output format

2009-05-14 Thread Dieter Menne
Stats Wolf stats.wolf at gmail.com writes: Saving a plot with pdf gives a very nice result: pdf(myplot.pdf) par(font=1,family='serif') plot(pressure) dev.off() Doing the very same with other formats (png, jpeg, tiff) gives far worse results. Is there anything to do to make a plot in

Re: [R] matching period with perl regular expression

2009-05-14 Thread Dieter Menne
Gabor Grothendieck ggrothendieck at gmail.com writes: R interprets backslash to give special meaning to the next character, i.e. it strips off the backslash and send the following character to gsub possibly reinterpreting it specially (for example \n is newline). Thus a backslash will

Re: [R] latex.table used with mixed string and numbers

2009-05-14 Thread Dieter Menne
lehe wrote: I am using latex.table to write my results into a latex table. If my results is like a matrix except that some column has strings and others have numbers. Is it possible to feed my results into latex.table? Such a matrix-like structure is called a dataframe. See latex in

Re: [R] Data extraction problem after importation using RODBC

2009-05-14 Thread Dieter Menne
Axel Leroix wrote: Then I perform an lm regression using the following code: reg1 -lm(data$prod~data$pri+data$cli) summary(reg1) Use reg1 -lm(prod~pri+cli, data=data) instead. It is not necessary to call the data frame you read your stuff into data, any more useful name, such as

Re: [R] creating a postscript file with two xyplots

2009-05-13 Thread Dieter Menne
Liati liats80 at hotmail.com writes: I would like to create one postscript file with two different xyplots (which library(lattice) postscript(myps.ps) xyplot(1~1,main=Plot 1) xyplot(2~3,main=Plot 2) dev.off() Dieter __ R-help@r-project.org mailing

Re: [R] import HTML tables

2009-05-13 Thread Dieter Menne
Dimitri Szerman-2 wrote: Hello, I was wondering if there is a function in R that imports tables directly from a HTML document. The XML package can do this: http://markmail.org/message/cyicoa3htme4gei2 Duncan Temple Lang: The htmlParse() and htmlTreeParse() functions in the XML package

Re: [R] ode first step

2009-05-13 Thread Dieter Menne
Benoit Boulinguiez benoit.boulinguiez at ensc-rennes.fr writes: I try to assess the parameters (K1,K2) of a model that describes the adsorption of a molecule onto on adsorbent. equation: dq/dt = K1*C*(qm-q)-K2*q I know the value of 'qm' and I experimentally measure the variables 'q',

Re: [R] decimal troubles ?

2009-05-12 Thread Dieter Menne
Patrick Giraudoux wrote: I have some trouble with the number of decimals in R (currently R 2.9.0). For instance: options()$digits [1] 3 let me hope that I will get three digits where useful when a number is printed. BUT: 44.25+31.1+50 [1] 125 No way to get the right

Re: [R] How to display data content on a only row?

2009-05-12 Thread Dieter Menne
Thom_249 wrote: I have data like this: [1] 16.800 6.533 5.067 3.933 2.200 1.667 [7] 1.200 1.067 0.733 0.667 And I want that all these data, printed on a 4 rows instead of 8, and it's be great without the [x] First look would be

Re: [R] (no subject)

2009-05-12 Thread Dieter Menne
Kon Knafelman wrote: if i have the following function, f - function(x) x^3-2*x^2+3*x-5 i need a simple function for the derivative of this with respect to 'x', so that i can then sub in values to the the derivative function, and use Newtons method of finding a root for this.

Re: [R] decimal troubles ?

2009-05-12 Thread Dieter Menne
Dieter Menne wrote: It says digits, not decimals: (44.25+31.1+50)/100 [1] 1.25 Dieter (44.25+31.1+50)*10 [1] 1254 Strictly speaking, this should print as 1250 (no flames, please, I can live with it) Dieter -- View this message in context: http://www.nabble.com/decimal

Re: [R] How to display data content on a only row?

2009-05-12 Thread Dieter Menne
Thom_249 wrote: I got them from a Matrix on with I use the applyfunction tu compute the mean columns by columns print(apply(matSD,2,mean)) matSD = matrix(round(rnorm(20),2),nrow=4) cat(matSD) print(matSD) dput(matSD) # How to send this matrix to r-help newMat = apply(matSD,2,mean)

Re: [R] R Error, very odd....

2009-05-11 Thread Dieter Menne
Katie2009 wrote: I'm trying to analyse some excel data in R. The problem is that when i input the data with the first column as absolute values, everything works fine, can analyse as normal. When I leave the first column unchanged to import negative numbers as well I get: Error in

Re: [R] R Error, very odd....

2009-05-11 Thread Dieter Menne
Katie2009 wrote: hi dieter, the method i'm using is in excel, copying the data, then in r w-read.delim(clipboard) w-as.data.frame(w) i've been doing a bit more fiddling, and have identified the 'class' of the column that i'm having trouble with, is classified as 'factor' whilst

[R] Rcompression on Omegahat

2009-05-11 Thread Dieter Menne
I tried to install Rcompression (for reading Matlab files) options(CRAN = c(getOption(CRAN), http://www.omegahat.org/R;)) install.packages(Rcompression) Warning: unable to access index for repository http://www.omegahat.org/R/bin/windows/contrib/2.9 Warning message: In getDependencies(pkgs,

Re: [R] Sweave \Sexpr{} advice please

2009-05-10 Thread Dieter Menne
Kyle Matoba kmmatoba at ucdavis.edu writes: A question in my work I use \Sexpr{} statements scalar values and the xtable package for all manner of tables. What I'd like to do is to use a vector inline, rather than a whole separate table. Something like: % Sweave block: = covmat -

Re: [R] What does it mean by skip=2 and skip=7?

2009-05-10 Thread Dieter Menne
Tung86 wyutung at gmail.com writes: Can anyone tell me what is skip=2, skip =7 and %in% mean here? fromcsv=read.csv ('2_2005_top200_postdoc.csv',header=FALSE,skip=7,stringsAsFactors=FALSE) Did you check the docs? skipinteger: the number of lines of the data file to skip before

Re: [R] sqlSave()

2009-05-10 Thread Dieter Menne
Felipe Carrillo mazatlanmexico at yahoo.com writes: I have created a MS Access table named 'PredictedValues' through the statement below: myDB - odbcConnectAccess(C:/Documents and Settings/Owner/Desktop/Rpond Farming.mdb,uid=admin,pwd=) sqlSave(myDB,PredictedValues,rownames=FALSE)

Re: [R] PGF Device

2009-05-07 Thread Dieter Menne
Lasse Bombien lasse at phonetik.uni-muenchen.de writes: Am Mittwoch, den 06.05.2009, 16:08 +0200 schrieb baptiste auguie: I think the pgfSweave project on R-forge is working on this (as far as i know it currently relies on eps2pgf) Right, but eps2pgf fails me on more complex / stacked

Re: [R] Step and stepAIC

2009-05-07 Thread Dieter Menne
Peter-Heinz Fox peterheinzfox at yahoo.de writes: I’m using step and stepAIC for stepwise regression. After each step, I would like to make an additional calculation based on the independent variables that have been selected until this step and their corresponding weights. Where do I have

Re: [R] Step and stepAIC

2009-05-07 Thread Dieter Menne
Jun Shen jun.shen.ut at gmail.com writes: I also wonder if stepAIC can work with an lme model. I tried. it doesn't for now. Appreciate any comment. It can, and it displays a nice error message telling you exactly why it did not work if you try out of the box. Check parameter method in your

Re: [R] Step and stepAIC

2009-05-07 Thread Dieter Menne
Jun Shen jun.shen.ut at gmail.com writes: I also wonder if stepAIC can work with an lme model. I tried. it doesn't for now. Appreciate any comment. It can do it, and it displays a nice error message, as I remember, why it won't do it in the default setting. Check parameter method of your

[R] lasso based selection for mixed model

2009-05-07 Thread Dieter Menne
Dear useRs (called Frank Harrell, most likely), after having preached for years to my medical colleagues to be cautious with stepwise selection procedures, they chanted back asking for an alternative when using mixed models. There is a half dozen laXXX packages around for all types of linear

Re: [R] Step and stepAIC

2009-05-07 Thread Dieter Menne
Jun Shen jun.shen.ut at gmail.com writes: I changed the method to ML for my lme call. Now I get a different error when running the stepAIC Error in terms.formula(formula, data = data) : 'data' argument is of the wrong type What does that mean? The same dataset was used for an lm call

Re: [R] Step and stepAIC

2009-05-07 Thread Dieter Menne
Jun Shen jun.shen.ut at gmail.com writes: lme(biomarker~Cmax+AGE,data=cov,method='ML',random=~1+AGE|ID,keep.data=T) Warning message: In lme.formula(biomarker ~ Cmax + AGE, data = cov, method = ML, : Fewer observations than random effects in all level 1 groups That's why the posting guide

Re: [R] PGF Device

2009-05-06 Thread Dieter Menne
Lasse Bombien lasse at phonetik.uni-muenchen.de writes: I saw a thread from 2007 about the possible implementation of a PGF (http://sourceforge.net/projects/pgf/) graphics device. Does anyone know if something came of it? I am always using pgf to make drawings together with Sweave. See

Re: [R] Summary help

2009-05-06 Thread Dieter Menne
mathallan mathanmath at gmail.com writes: Hi, I have fittet a gamma model, and is wondering if I can read the shape and the scale direct from the summary Estimate Std. Errort valuePr(|t|) (Intercept) 1.612e+00 4.735e-02 34.052

Re: [R] General Question about Graphics

2009-05-06 Thread Dieter Menne
Steve_Friedman at nps.gov writes: Basically, I found that including error bars with barplots is not desirable and hence there appears that there is no function to do this. Can someone offer suggestions on how to do this simple procedure http://markmail.org/message/3f6jaztq2cpezrkl or

Re: [R] Randomized-complete blocks design and R

2009-05-05 Thread Dieter Menne
alis villiyam aalisiyan at gmail.com writes: I am new in R.I am trying to analysis of variance for Randomized-complete blocks design. I have 4 treatments and 3 replication, Without intraction.then .I is going to use LSD test or Duncan test for comparison between average values of

Re: [R] noisy quantisation

2009-05-05 Thread Dieter Menne
William Simpson william.a.simpson at gmail.com writes: p-amp*cos(2*pi*freq*(1:n)/n ) + 0.5 I was wondering if anyone can suggest a way to create a version where I get 0s, 1s, and 2s something like a noisy version of this: 2 oo 1

Re: [R] Heatmap without levelplot

2009-05-05 Thread Dieter Menne
Antje niederlein-rstat at yahoo.de writes: as I'm not sure to understand the coloring levelplot uses, I'm looking for another easy way to create a heatmap like this: library(lattice) mat - matrix(seq(1,5, length.out = 12), nrow = 3) mat[1,2] - 3.5 my.at - seq(0.5,5.5, length.out = 6)

<    1   2   3   4   5   6   7   8   9   10   >