Re: [R] need help with R

2013-04-15 Thread Dieter Menne
Sam tingey wrote: > can i email questions to this address to get help with using R Sarah Goslee replied; Yes, but do read: http://www.R-project.org/posting-guide.html Dieter Menne thought: Catch 42. When you are so good that you can create a reproducible example without using R, you only w

Re: [R] lme: extract result-function

2012-06-13 Thread Dieter Menne
Christof Kluß wrote > > mod <- lme(A ~ -1 + B+C+D+E+F+G, random = ~1 | ...) > ... > f <- function(B,C,D,E,F,G) <- { > return(i + b*B + c*C + d*D + e*E + f*F + g*G) > } > It looks like you are trying to compute contrasts the ugly way. Check estimable in package gmodels or the vignette of the m

Re: [R] lattice/seqplot group colors

2012-02-25 Thread Dieter Menne
Found it. Use level instead of groups. # seqplot bar coloring library(latticeExtra) d = data.frame(acid=letters[1:10],lwr=rnorm(10), essential=rep(c(TRUE,FALSE),each=5)) d$upr = d$lwr+1 # Works as expected barchart(acid~lwr,data=d, groups=essential, par.settings=

[R] lattice/seqplot group colors

2012-02-25 Thread Dieter Menne
I am trying to get segplot honor the groups parameter like barchart does. The below give an incorrect display for segplot. Any help? Dieter # seqplot bar coloring library(latticeExtra) d = data.frame(acid=letters[1:10],lwr=rnorm(10), essential=rep(c(TRUE,FALSE),each=5)) d$upr = d$

Re: [R] nls help

2011-11-30 Thread Dieter Menne
chuck.01 wrote > > > datum <- structure(list(Y = c(415.5, 3847.8325, 1942.83325, > 1215.223, > 950.142857325, 2399.585, 804.75, 579.5, 841.70825, 494.053571425 > ), X = c(1.081818182, 0.492727273, 0.756363636, 0.896363636, > 1.518181818, 0.49917, 1.354545455, 1.61,

Re: [R] Creating ODS RTF-style output in R XXXX

2011-08-29 Thread Dieter Menne
Dan Abner wrote: > > I have been using the sink() function as follows: > > x<-rnorm(100) > sink("C:\\Users\\dan\\Desktop\\Current Events\\myhw.txt", > append=TRUE,split=TRUE) > m1<-c(Mean=mean(x),SD=sd(x),Min=min(x),Max=max(x)) > m1 > sink() > > === > > Is it possible to create tabular style

Re: [R] Saving a graph

2011-08-29 Thread Dieter Menne
Gang Chen-4 wrote: > > However, my problem is that the file generated > from a graph of fixed size is too large (in the order of 10MB) because of > many data points in multiple scatterplots. Any suggestions? > Generate pdf, open and save it in Adobe Acrobat which does a compression when the set

Re: [R] R - Web - Interfaces

2011-08-29 Thread Dieter Menne
Marie Duarte wrote: > > Is anybody able to recommend packages to provide GUI like behaviour to > interface with R that would facilitate, eg. > * Rotatable surface plots (similar to LiveGraphics3D for mathematica, > http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/examples/color_volumes.html

Re: [R] xlsx error

2011-08-03 Thread Dieter Menne
Andrew Winterman wrote: > > > I'm trying to use the xlsx package to read a series of excel spreadsheets > into R, but my code is failing at the first step. > > I setwd into my the directory with the spreadsheets, and, as a test ask > for > the first one: > >read.xlsx(file = "Argentina Fina

Re: [R] Running R in a sandbox

2011-08-03 Thread Dieter Menne
Antonio Rodriges wrote: > > > The idea is to grant access of remote users to R running on Linux. Users > must have ability to run their > R scripts but avoid corrupting the operating system. > > Check RStudio.org Dieter -- View this message in context: http://r.789695.n4.nabble.com/Runnin

Re: [R] export/import matrix

2011-08-01 Thread Dieter Menne
Rosario Garcia Gil-2 wrote: > > I have a problem on keeping the format when I export a matrix file with > the write.table() function. > > When I import the data volcano from rgl package it looks like this in R: > >> data[1:5,] > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12

Re: [R] Plot frame color and linewidth

2011-08-01 Thread Dieter Menne
marcel wrote: > > I have a figure with a lattice plot and a basic plot. Is there a way to > select the color and line width of the surrounding boxes for each of > these? I could not find any documentation on this. > > Thanks for providing a nice self-contained example. There was nothing wron

Re: [R] Use dump or write? or what?

2011-08-01 Thread Dieter Menne
oaxacamatt wrote: > > I am calculating two t-test values for each of many files then save it > to file calculate another set and append, repeat. > You did not tell use what you want to do with the data in the file. If you just want a copy of the output, bracketing with sink(file) and sink() can

Re: [R] lattice overlay

2011-07-27 Thread Dieter Menne
Ram H. Sharma wrote: > > I want to overlay lattice scatter plot: I do not know why the following > code > is not plotting subscripts ! Sorry if this question is too simple: > > Working example shortened: > > .panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) > > Because they ar

Re: [R] color of error bars in Dotplot (Hmisc)

2011-07-27 Thread Dieter Menne
Irene Prix wrote: > > > In a grouped Dotplot, is there any way to set the color of error bars to > be the same as the corresponding symbols? > ... > require(lattice) > require(Hmisc) > data(barley) > > Dotplot(variety~Cbind(yield, yield+2, yield-2)|year, groups=site, > data=barley) > > Custo

Re: [R] Use a list to 'transport' a collection of data sets and results

2011-07-27 Thread Dieter Menne
christiaan pauw-2 wrote: > > Hi Everybody > > Is it possible to store a collection of variables of different types (like > named integers, matricies, data frames and two lists) all in one list and > save it and then simply load it again later and "unpack" the variables. > > The easy way out i

Re: [R] Variable scope in functions - best practices

2011-07-25 Thread Dieter Menne
Noah Silverman wrote: > > > I have several "global" variables that I want to change with a given > function. (The variable has a different value after the function is > called.) > > Berend Hasselman wrote: > > > Maybe this helps > > ?`<<-` > It helps to get the job done, but the OP aske

Re: [R] [R-pkgs] rdyncall 0.7.3

2011-07-25 Thread Dieter Menne
Daniel Adler wrote: > > Initial Announcement: Package rdyncall released on CRAN. (Version 0.7.3) > > The package was presented at the Use!R 2009 with the title > 'An improved Foreign Function Interface for R' and is now available on > CRAN > and considered stable for a large range of R platfor

Re: [R] Extrat rows from a dataframe based on second data frame

2011-07-25 Thread Dieter Menne
Bansal, Vikas wrote: > > > I have two data frames > > df > > ChrPos CaseA CaseCCaseG CaseT > 10 135349878 0.00 3.428571 0.00 20.571429 > 10 135349880 0.00 21.33 0.00 2.67 > 10 135349883 21.00 0.00 3.00 0.000

Re: [R] Wide confidence intervals or Error message in a mixed effects model (nlme)

2011-07-25 Thread Dieter Menne
Bert Gunter wrote: > > I would also address future questions of this sort to the > R-sig-mixed-models list, as this is not really an r-help kind of question. > > That's a bit confusing, Bert. I always thought that that list was about lme4/lmer development, it still says "notably lmer() relate

Re: [R] Wide confidence intervals or Error message in a mixed effects model (nlme)

2011-07-25 Thread Dieter Menne
Menelaos Stavrinides-2 wrote: > > I am analyzing a dataset on the effects of six pesticides on population > growth rate of a predatory mite. The response variable is the population > growth rate of the mite (ranges from negative to positive) and the > exploratory variable is a categorical variabl

Re: [R] load data

2011-07-25 Thread Dieter Menne
Crock wrote: > > i`m an absolute R-beginner and have a problem loading data from datasets. > For example, giving the command: >load ("Affairs"), i get the message, > that there is an error in readChar and there cannot be made any > connection. > I tried to find out on introduction papers but was

Re: [R] Code is not doing anything

2011-07-24 Thread Dieter Menne
AriGold wrote: > > Hi this is my first post. I am trying to run a simulation for a computer > playing Von Neumann poker and adjusting it's expectation of an opponent's > behavior according to how the opponent plays. > > ... > Debugging length programs is not what this list is supposed to do,

Re: [R] inline/Rcpp: Problem with space in path under Windows

2011-07-24 Thread Dieter Menne
Hi, Dirk, Dirk Eddelbuettel wrote: > > > Thanks for your interest in Rcpp. We generally prefer questions about > Rcpp / RInside / ... on the rcpp-devel list. > I know that list, but I was not sure if Path-questions are part of "devel". Dirk Eddelbuettel wrote: > > ... presumably from instal

Re: [R] Fit elipse to xy scatter

2011-07-24 Thread Dieter Menne
DrCJones wrote: > > hat I would like to do is fit an elipse to two lines of identity (at right > angles to each other), as indicated in the following figure: > http://imageshack.us/photo/my-images/30/poincareplotwip.png/ > > http://r-project.markmail.org/thread/kpg3ea665y2ud6cz or, for a robu

Re: [R] Histogram of a dataframe subset failing

2011-07-24 Thread Dieter Menne
DimmestLemming wrote: > > hist(soloData$deaths) > > I get the error, " invalid number of 'breaks' ". > Try str(soloData$deaths) or head(soloData$deaths) or summary(soloData$Death) There may be something wrong with you data. Dieter -- View this message in context: http://r.789695.n4.

[R] inline/Rcpp: Problem with space in path under Windows

2011-07-24 Thread Dieter Menne
I am trying to run inline/Rcpp under Windows 64. The RTools are installed on a spaceless path D:\rtools. Inlining pure c-code works perfectly. When I try the sample code for cpp in the cxx Documentation, I get: x86_64-w64-mingw32-g++.exe: C:/Program: No such file or directory The path to the com

Re: [R] Use ks.test() or an alternative in C/C++ application

2011-07-23 Thread Dieter Menne
Jochen1980 wrote: > > > I am looking for an opportunity to make a KS-Test in my C/C++-app. > Unfortunately I am not able to find a lib or function in C or C++ which > does the job. For my other numerical stuff Gnu Scientific Library was > recommended to me. What to do now? > > I read that there

Re: [R] R on Android, at least on DOS

2011-07-23 Thread Dieter Menne
zcatav wrote: > > If this isn't, a DOS version may be helpfull to run on Android under > dosbox. > Wow, a mind boggling bummer! Dieter -- View this message in context: http://r.789695.n4.nabble.com/R-on-Android-at-least-on-DOS-tp3688847p3689176.html Sent from the R help mailing list archiv

Re: [R] determining system time for sequence of commands

2011-07-23 Thread Dieter Menne
jannis-2 wrote: > > I am trying to figure out how much CPU time individual commands inside > one of my functions consume. Is it possible to obtain the CPU times of a > whole sequence of commands inside a function? > See the example under proc.time() Dieter -- View this message in context:

Re: [R] inside p value 'e'

2011-07-23 Thread Dieter Menne
xy wrote: > > I have like 5.075e-12 , 3.207e-05, 7.438e-07 and 9.393e-08 *** , i dont > know what number they are http://en.wikipedia.org/wiki/Floating_point -- View this message in context: http://r.789695.n4.nabble.com/inside-p-value-e-tp3688961p3689167.html Sent from the R help mailing l

Re: [R] How to convert 3-digits hours

2011-07-22 Thread Dieter Menne
Wonjae Lee wrote: > >> strptime('20110101 0900',"%Y%m%d %H%M") > [1] "2011-01-01 09:00:00" >> strptime('20110101 900',"%Y%m%d %H%M") > [1] NA > > If I have a 3-digit hour like '900', please show me how to convert it to > 09:00:00. > d = c('20110101 900', '20110101 1900') d1= gsub(" (\\d\\d

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Dieter Menne
DrCJones wrote: > > But how can do 3 so that the bottom spans the width of the upper two: > > [plot1 plot1] > [p l o t 3] > > ?layout for standard graphics (plot..), but that's what you are referring to. For trellis, you must use other methods. Dieter -- View this message in context

Re: [R] grouping data

2011-07-20 Thread Dieter Menne
adolfpf wrote: > > How do I "group" my data in "dolf" the same way the data "Orthodont" are > grouped. > >> show(dolf) >distance age Subjectt Sex > 16.83679 22.01 F1 F > 26.63245 23.04 F1 F > 3 11.58730 39.26 M2 M > > I know that many sample in that exc

Re: [R] Problem with RODBC

2011-07-19 Thread Dieter Menne
David Scott-6 wrote: > > I have been trying to read some data from an Excel workbook without > success. > ... > > faults <- sqlFetch(channel, sqtable = 'Data', > +colnames = FALSE, as.is = TRUE) > > faults > [1] "HY001 -1040 [Microsoft][ODBC Excel Driver] Too many fields de

Re: [R] Plotting NLS profiles

2011-06-10 Thread Dieter Menne
R Help wrote: > > I'm trying to plot nls profiles, but the plot.profile.nls function in > R doesn't seem to accept any plot.default variables. > Package nlstools has a few nice graphical display methods. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Plotting-NLS-pr

Re: [R] Rsquared for anova

2011-04-18 Thread Dieter Menne
Dorien Herremans wrote: > > > Even if I use lm(), I get the following output: > >> summary(fit) > Df Sum Sq Mean Sq F valuePr(>F) > nh11 324.0 323.99 139.13 < 2.2e-16 *** > nh21 723.1 723.12 310.53 < 2.2e-16 *** > nh31 1794.2 1794.2

Re: [R] how to get the plot like this by R?

2011-04-16 Thread Dieter Menne
bellewong wrote: > > The figure is posted at > > http://www.mediafire.com/i/?08b9f4um43vxvw8 > > That type of plot that has descended on us like a beeswarm. Try the package with that name. Dieter -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-the-plot-like-this

Re: [R] Rsquared for anova

2011-04-16 Thread Dieter Menne
dorien wrote: > >> fit <- lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length, > data=expdata)) > Error: unexpected ',' in "fit <- > lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length," > > Peter's point is the important one: too many interactions, and even with + instea

Re: [R] A simple normal-curve question

2011-04-16 Thread Dieter Menne
helin_susam wrote: > > x <- rnorm(100) > y <- rlnorm(100) > model <- lm(y~x) > a <- resid(model) > > How I show the all area under the normal curve? > > First, always try plot(model). It can never hurt. Too bad the plot you want is not among the six contenders (?plot.lm). To do it manually:

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread Dieter Menne
Nilaya Sharma wrote: > > I was trying to fit a mixed model in animal experiment but stuck at simple > point. The following similar example is from SAS mixed model pp 212. > > > genetic_evaluation <- read.table(textConnection(" > sire dam adg > 1 1 2.24 > 1 1 1.85 > ... > 5 2 2.58 > 5 2

Re: [R] Rsquared for anova

2011-04-15 Thread Dieter Menne
dorien wrote: > > I calculate an anova test in the following way: > > ... aov example > > I want to check the fit of the model with Rsquared > Try summary(lm(...)) instead. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Rsquared-for-anova-tp3452399p3452434.html Se

Re: [R] modify particular factor levels

2011-04-15 Thread Dieter Menne
baptiste auguie-5 wrote: > > > I wish to modify programmatically only a few factor levels, according > to a named list. I came up with this function.. > > . > It seems to work, but the original order of the levels is changed. > > The split-and-unite policy you use makes it a bit diff

Re: [R] Layout within levelplot from the lattice package

2011-04-06 Thread Dieter Menne
Ian Renner wrote: > > Hi, > > I'm a novice with levelplot and need some assistance! Basically, I want a > window > which contains 6 levelplots of equal size presented in 3 columns and 2 > rows. > ... > Is there any way to concatenate levelplots from a factor vertically as > opposed > to horiz

Re: [R] replace last 3 characters of string

2011-04-04 Thread Dieter Menne
Bert Jacobs-2 wrote: > > I would like to replace the last tree characters of the values of a > certain > column in a dataframe. > > Besides the mentioned standard method: I found the subset of string operations in Hadley Wickhams stringr package helpful. They have a much more consistent interf

Re: [R] D'Agostino test

2011-04-04 Thread Dieter Menne
Juraj17 wrote: > > Do I have to write my own, or it exists yet? How name has it, or how can I > use it. > Try the R-function search. It return the function you are looking for as the first match. Dieter -- View this message in context: http://r.789695.n4.nabble.com/D-Agostino-test-tp34249

Re: [R] loading R object files on an RWeb server

2011-04-03 Thread Dieter Menne
jose romero-3 wrote: > > For one thing, i am using google docs to host the R object file and google > docs has secure https URL's, which apparently cannot be handled by R's > url(). So my questions are these: > > Try ?getURL in the RCurl package Dieter -- View this message in context: htt

Re: [R] a for loop to lapply

2011-03-30 Thread Dieter Menne
alaios wrote: > > I am trying to learn lapply. > I would like, as a test case, to try the lapply alternative for the > Shadowlist<-array(data=NA,dim=c(dimx,dimy,dimmaps)) > for (i in c(1:dimx)){ > Shadowlist[,,i]<-i > } > ---so I wrote the following--- > returni <-function(i,ShadowMatrix) {S

Re: [R] Comparing non nested models with correlation coefficients (inspired from Lorch and Myers )

2011-03-24 Thread Dieter Menne
Boris New wrote: > > The problem is that the editor wants a formal test. So I guess that the > Vuong test should be ok... > I frequently note that it is the big boss who believes that the editor wants a formal test. Nobody ever got fired for producing a p-value :-( Dieter -- View this mess

[R] Passing tex parameter via texi2dvi

2011-03-23 Thread Dieter Menne
I am trying to pass a additional argument to texi2dvi, for example to use the aux-directory. Looks like this is not possible via options: options(texi2dvi='texi2dvi --tex-option="-aux-directory=auxdir"') texi2dvi(file = "GBPL3.tex", pdf = TRUE) #Error in system(paste(shQuote(texi2dvi), "--version

Re: [R] Looping Problem

2011-03-22 Thread Dieter Menne
armstrwa wrote: > > for(i in 1:length(gagehandles)){ > > dates<-get(paste(gagehandles[i],"_amsd",sep="")) > Error in get(paste(gagehandles[i], "_amsd", sep = "")) : > variable names are limited to 256 bytes > > It didn't have a problem with the variable names before, so I'm not sure > wh

Re: [R] Feature request: rating/review system for R packages

2011-03-20 Thread Dieter Menne
> After pondering all the pros and cons regarding the usefulness of a > rating/review system for R packages, don't you think it would make sense > to implement such a thing? > Or to look what is there, and how little it is filled: http://crantastic.org/ Dieter -- View this message in conte

Re: [R] R² for non-linear model

2011-03-18 Thread Dieter Menne
Bert Gunter wrote: > > You can't. R^2 has no (consistent, sensible) meaning for nonlinear models. > If you don't understand why not, get local help or do some reading. > There is no doubt that you are right, but Anna's question only shows that she is sandwiched between reviewers/supervisors who

Re: [R] Does R have a "const object"?

2011-03-16 Thread Dieter Menne
Michael Friendly wrote: > > This is just the flexibility of R. I've just discovered a new class of > geometries based on > > > pi <- 2.3 > ?Constants > This is a must-fortune. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Does-R-have-a-const-object-tp3356972p3381

Re: [R] color under lm line

2011-03-15 Thread Dieter Menne
Marlin Keith Cox wrote: > > Thank you, but I need only the area under the llm colored. What if there > were two lm lines? > For the well-behaved case you could find the range to be colored with range = which(diff(resid(llm)>0)!=0) Dieter x=seq(0,5,len=100) y=-(x-5)^2 llm<-lm(y~x) range = w

Re: [R] lags for unbalanced panel data

2011-03-08 Thread Dieter Menne
Geoffrey Smith-3 wrote: > > Hello, I was wondering if there was an easy way to calculate the rate of > change in a variable for an unbalanced panel data set. Below is a > detailed > description in R of what I am asking. Thank you. Geoff > > A classic for mixed models, which simply does not

Re: [R] generating factors from the edit function

2011-03-05 Thread Dieter Menne
Erin Hodgess-2 wrote: > > Here is a little function that I put together: > >> fact1 > function(x) { > n <- ncol(x) > for(i in 1:n) { > if(mode(x[,i])=="character")x[,i] <- factor(x[,i]) > } > return(x) > } >> > > See http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg22459.html for a m

Re: [R] lattice: drawing strips for single-panel plots

2011-03-05 Thread Dieter Menne
John G. Bullock-2 wrote: > > The strip argument to panel.xyplot seems to be ignored for single-panel > plots. Here is an example: > >data(Chem97, package = "mlmRev") >myStrip <- function(...) { ltext(.5, .5, 'strip text') } >densityplot(~ gcsescore, data = Chem97, strip=myStrip) >

Re: [R] make an own (different) color legend with spplot()

2011-03-04 Thread Dieter Menne
Marcel J. wrote: > > > Is there a way to manually costumize the color legend in an spplot() - > especially where to draw ticks and labels for the ticks? > spplot calls levelplot, so the documentation there gives some help. In theory, the simplest approach would be to add a colorkey/ticknumber

Re: [R] Coefficient of Determination for nonlinear function

2011-03-04 Thread Dieter Menne
Uwe Wolfram wrote: > > > I did fit an equation of the form 1 = f(x1,x2,x3) using a minimization > scheme. Now I want to compute the coefficient of determination. Normally > I would compute it as > > r_square = 1- sserr/sstot with sserr = sum_i (y_i - f_i) and sstot = > sum_i (y_i - mean(y)) >

Re: [R] Question in Chi-squared test, can I do it with percentage data?

2011-03-04 Thread Dieter Menne
Jeff wrote: > > I know Chi-squared test can be done with the frequency data by R function > "chisq.test()", but I am not sure if it can be applied to the percentage > data ? The example of my data is as follow: > > # > > KSL

Re: [R] retrieve x y coordinates of points in current plot

2011-03-04 Thread Dieter Menne
jannis-2 wrote: > > > is it somehow possible to retrieve the x and y coordinates of points in > a scatterplot after it has been plotted? identify() somehow seems to > manage this, so I was wondering whether it is possible? > locator might be the more basic function you are looking for. Diet

Re: [R] R Square Help (this debate again, i know!)

2011-02-21 Thread Dieter Menne
surreyj wrote: > > Now all the other demand literature reports the %/proportion of variance > accounted for (or R squared) as well as the parameter values and standard > error. > ... > I had a chat to a supervisor and he suggested I post to here and see if > someone can give me a reference/refer

Re: [R] Conditional sum

2011-02-20 Thread Dieter Menne
mathijsdevaan wrote: > > I have a DF like this: > > DF = data.frame(read.table(textConnection("A B C > 1 b1 1999 0.25 > 2 c1 1999 0.25 > .. > For each factor in A I want to sum the values of C for all years(Bn) prior > to the current year(Bi): > > 1 b1 1999 0.25 0 > 2 c1 1999 0

Re: [R] Scaling Lattice Graphics for tikzDevice

2011-02-19 Thread Dieter Menne
Elliot Joel Bernstein wrote: > > I'm trying to use lattice graphics to produce some small plots for > inclusion in a LaTeX file. I want the LaTeX fonts to be used in the plots, > but to be scaled down to match the size of the plot. > > I agree with Deepayan. With tikzdevice, tust try to get

Re: [R] plot3d, color points by group

2011-02-18 Thread Dieter Menne
Kari-4 wrote: > > > I've created a 3d scatterplot, and had no problems labeling the points. > However, I've been really struggling to change the color of the points > based > on a factor (see 'group' below). Is such a thing possible? > > Its always polite to make the example self-running by

Re: [R] Matrix in R

2011-02-18 Thread Dieter Menne
danielepippo wrote: > >I'm building a matrix in R with a cycle for like this: > pp_ris2=matrix(NA,6,6) > for(i in 0:6){ > . > R is not like c, indexing starts with 1. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Matrix-in-R-tp3312748p3312764.html Sent from

Re: [R] help needed for strptime "000000" !

2011-02-16 Thread Dieter Menne
JESSICA wrote: > > > I have a text file stored in notepad: > > DATE TIME Q > 2004-11-01233311 1 > 2004-11-01234227 1 > ... > I run > > x<-read.table("C:/R/Sample.txt",header=T) > then get a table > > ... > I am trying to > > strptime(x$TIME,"%H%M%S"

Re: [R] image() with a vector

2011-02-15 Thread Dieter Menne
Steven Cordwell wrote: > > However, transforming z into a matrix with two rows, where both rows are > the same as z above does seem to be a workaround. > > z <- matrix(c(z,z),2,length(z),byrow=TRUE) > y <- c(0.25,0.75) > image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",ya

Re: [R] How to print and save simulated data?

2011-02-13 Thread Dieter Menne
wanfairos wrote: > > I have one problem to display my simulated data. Basically, I've generated > a set of rnorm (std.norm.mat)and rnbinom (gen.data) data to test on the > performance of FE Poisson model estimates > > ... Long self-contained example shorted > > my.data<-rep(,sim.size) >

Re: [R] How to print and save simulated data?

2011-02-13 Thread Dieter Menne
wanfairos wrote: > > I have one problem to display my simulated data. Basically, I've generated > a set of rnorm (std.norm.mat)and rnbinom (gen.data) data to test on the > performance of FE Poisson model estimates > > ... Long self-contained example shorted > > my.data<-rep(,sim.size) >

Re: [R] How to print and save simulated data?

2011-02-13 Thread Dieter Menne
wanfairos wrote: > > Dear members; > > I have one problem to display my simulated data. Basically, I've generated > a set of rnorm (std.norm.mat)and rnbinom (gen.data) data to test on the > performance of FE Poisson model estimates > > ... Long self-contained example shorted > > my.data<-rep

Re: [R] How to print and save simulated data?

2011-02-13 Thread Dieter Menne
wanfairos wrote: > > Dear members; > > I have one problem to display my simulated data. Basically, I've generated > a set of rnorm (std.norm.mat)and rnbinom (gen.data) data to test on the > performance of FE Poisson model estimates > > ... Long self-contained example shorted > > my.data<-rep

Re: [R] Recoding using the memisc package

2011-02-13 Thread Dieter Menne
Shige Song wrote: > > Dear All, > > I am trying to recode a variable using the functions provided by > "memisc" package. Actually I am following the examples on page 9-10 of > the vignette: > > -- > d.fig <- within(d.fig,{

Re: [R] From numeric vector to string vector

2011-02-13 Thread Dieter Menne
Bogaso wrote: > > Vect <- c(12.234, 234.5675, 1.5) > Now I want a string vector like: > changedVec <- c("012.234", "234.568", "001.500") > sprintf("%06.3f", c(12.234, 234.5675, 1.5)) Dieter -- View this message in context: http://r.789695.n4.nabble.com/From-numeric-vector-to-string-vector

[R] lattice: Synchronizing key and lines; or: why is lty used as lwd in legend?

2011-02-06 Thread Dieter Menne
Dear latticists, Getting legend and graph line types synchronized has been a challenge in lattice; the last example below that works looks ridiculously ugly for such a simple job, I am sure there is a more elegant solution. When trying this out, I found a feature which I found confusing: why are

Re: [R] How can I index multiple linear models? (Without getting a warning.)

2011-01-31 Thread Dieter Menne
BSanders wrote: > > > . > lin[i] = lm(reservesub[,3]~ reservesub[,i+3]) > > For which I'm given 15 warning messages which say : > > "1: In lin[i] = lm(reservesub[, 3] ~ reservesub[, i + 3]) : > number of items to replace is not a multiple of replacement length" > lin = list() for(i

Re: [R] Finding the correlation coefficient of two stocks

2011-01-30 Thread Dieter Menne
veepsirtt wrote: > > corr <- cor(s1,s2) > Error in cor(s1, s2) : incompatible dimensions > > Check lenghts of your series. cor(c(1,2),c(1,2,3)) #Error in cor(c(1, 2), c(1, 2, 3)) : incompatible dimensions Dieter -- View this message in context: http://r.789695.n4.nabble.com/Finding-t

Re: [R] Sweave: \Sexpr{} inside <<>>?

2011-01-25 Thread Dieter Menne
zerfetzen wrote: > > Is it possible in Sweave to put \Sexpr{} inside <<>>? This is a bad > example, but here goes: > > <> > Age <- 5 > @ > > <<>> > x <- \Sexpr{Age} > @ > ... > It's good to have a simplified example, but your's is so much simplified that it is difficult to understand. I kno

Re: [R] lme-post hoc

2011-01-18 Thread Dieter Menne
plsc wrote: > > > I analysed my data with lme and after that I spent a lot of time for > mean separation of treatments (post hoc). But still I couldn’t make > through it. This is my data set and R scripts I tried. > > > > 3 level3 var4361261 > > modela<-lme(height~varie

Re: [R] lme-post hoc

2011-01-18 Thread Dieter Menne
plsc wrote: > > > I analysed my data with lme and after that I spent a lot of time for > mean separation of treatments (post hoc). But still I couldn’t make > through it. This is my data set and R scripts I tried. > > > > 3 level3 var4361261 > > modela<-lme(height~varie

Re: [R] lme-post hoc

2011-01-18 Thread Dieter Menne
-- View this message in context: http://r.789695.n4.nabble.com/lme-post-hoc-tp3224436p3224652.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

Re: [R] Help for R plot

2011-01-17 Thread Dieter Menne
Fabrice Tourre wrote: > > How to plot as the coordinate as in my attachment? I want to trim the > coordinate and one of plot as the figure in attachment. Does any one > have such example? > http://markmail.org/message/3jn2sqoep36ckswb (for a lattice-lookalike) and package plotrix Dieter

Re: [R] How to doulbe all the value on a matrix

2011-01-17 Thread Dieter Menne
ADias wrote: > > Is there an expression to double the values of a matrix - without using a > loop? > > Why so complicated? Dieter > m = matrix(rep(1,20),nrow=4) > m [,1] [,2] [,3] [,4] [,5] [1,]11111 [2,]11111 [3,]11111 [4,]

Re: [R] YourCast Data Format

2011-01-09 Thread Dieter Menne
Thomas Jensen-6 wrote: > > ... data set ... > The data set has in total 27 countries for the years 1999 to 2008, but > with unbalanced panels. > > I want to be able to estimate a model and do forecasting for each > country in the data set. I have been looking into the YourCast package > f

Re: [R] Problems with glht function for lme object

2011-01-08 Thread Dieter Menne
anord wrote: > > I'm trying to make multiple comparisons for an lme-object. > ... > > My final model takes the following form: > feedings ~ treat + year + data^2, random = ~1|site,data=feed.df > > ... > == > feedings sex site treat year date^2 > 1.8877888 M 838 H 2009

Re: [R] anova vs aov commands for anova with repeated measures

2011-01-08 Thread Dieter Menne
Bill.Venables wrote: > > ... > If you want to fit a multistratum model, such as a repeated measures > model, you need to use aov. > > ...Or lme in nlme / lmer in lme4. Dieter -- View this message in context: http://r.789695.n4.nabble.com/anova-vs-aov-commands-for-anova-with-repeated-meas

Re: [R] Accessing data via url

2011-01-07 Thread Dieter Menne
Henrique Dallazuanna wrote: > > With the ssl.verifypeer = FALSE argument it works: > > x = getBinaryURL(dd, ssl.verifypeer = FALSE) > > Thank, good to know. It's only in the examples of ..., but is looks like a parameter important enough to be included in the docs of getBinaryURL. Digging t

Re: [R] Accessing data via url

2011-01-07 Thread Dieter Menne
John Kane-2 wrote: > > # Can anyone suggest why this works > > datafilename <- > "http://personality-project.org/r/datasets/maps.mixx.epi.bfi.data"; > person.data <- read.table(datafilename,header=TRUE) > > # but this does not? > > dd <- > "https://sites.google.com/site/jrkrideau/home/gene

Re: [R] Parsing JSON records to a dataframe

2011-01-07 Thread Dieter Menne
Jeroen Ooms wrote: > > What is the most efficient method of parsing a dataframe-like structure > that has been json encoded in record-based format rather than vector > based. For example a structure like this: > > [ {"name":"joe", "gender":"male", "age":41}, {"name":"anna", > "gender":"female",

Re: [R] Resampling to find Confidence intervals

2011-01-04 Thread Dieter Menne
Axolotl9250 wrote: > > ... > resampled_ecoli = sample(ecoli, 500, replace=T) > coefs = (coef(lm(MIC. ~ 1 + Challenge + Cleaner + Replicate, > data=resampled_ecoli))) > sd(coefs) > > ... > Below a simplified and self-consistent version of your code, and some changes Dieter # resample d = dat

Re: [R] lattice: how to "center" a title?

2011-01-04 Thread Dieter Menne
mhofert wrote: > > trellis.device("pdf", width = 5, height = 5) > print(xyplot(0 ~ 0, main = "This title is not 'centered' for the human's > eye", scales = list(alternating = c(1,1), tck = c(1,0 > dev.off() > > ... the title does not seem to be "centered" for the human's eye [although > i

Re: [R] Should I use T-test or prop.test

2011-01-02 Thread Dieter Menne
Az Ha wrote: > > I have a set of data where two groups of animals walk around in an > environment and I have calculated the percentages of the area covered by > them. Each group covers different area, for example the arithmetic mean is > 35% and 23% with n=40 and 29 respectively. > ... > Should

Re: [R] The Percentile of a User-Defined pdf

2011-01-02 Thread Dieter Menne
Nissim Kaufmann wrote: > > > J=sapply(xc, function(xc) {integrate(function(x) { >sapply(y, function(x) { > integrate(function(y) { >sapply(x, function(y) 1/(1+x^2+y^2)) > }, -c, c)$value >}) > }, -c, xc)$value > }) > > Once you are inside the first "{", R only kn

Re: [R] Help on lme output. what are the estimates in $modelStruct

2010-12-27 Thread Dieter Menne
Lei wrote: > > > I have been playing with lme fitting different kinds of model. I am > puzzled by the estimates associated with $modelStruct and I have no idea > what they are? > > e.g if I fit a random intercept model using the following > > fit.0<-lme(y~time,random=list(subject=pdIdent(~1))

Re: [R] Matching 2 SQL tables

2010-12-22 Thread Dieter Menne
mathijsdevaan wrote: > > I have a postgresql and a mysql database and I would like to combine the > info from two different tables in R. Both databases contain a table with > three columns: project_name, release_id and release_date. So each project > output could be released multiple times (I am

Re: [R] Where is the bioDist package?

2010-12-21 Thread Dieter Menne
venik wrote: > > I am trying in vain to find the bioDist package. > More generally, where can I find a lit of packages and their location? I > thought CRAN will have it, but I had no luck with bioDist. > Google bioDist, second hit (maybe another one, depending on your language settings). D

Re: [R] labels and barchart

2010-12-21 Thread Dieter Menne
Robert Ruser wrote: > > x <- seq(20, 100, by=15) > ety <- rep( "Effect on treatment group", times=length(x)) > barplot(x, names.arg=ety, las=1, horiz=TRUE) > > Labels are not visible. But trial and error method with the second mar > argument I get what I want. > Standard graphics has fallen a

Re: [R] Layout of mulitpage conditioned lattice plots

2010-12-20 Thread Dieter Menne
David Winsemius wrote: > > > Here's my latest guess at what you may want: > > pdf(file="multpage.pdf") > xyplot(val~time|subj + comp, data=dt,type="l", > layout=c(3,5, 3), > skip=rep(c(rep(FALSE,13), TRUE, TRUE), 3) ) > dev.off() > > Not really, but "skip" was the right id

Re: [R] Layout of mulitpage conditioned lattice plots

2010-12-19 Thread Dieter Menne
Here is an example with ggplot2, which can also be used in a similar way with lattice. Again, the last page is the problem: the arrangement is correct here, but the last page (with 1 instead of 5 plots) has a different panel size which makes a comparison difficult. And, since I have much more poi

  1   2   3   4   5   6   7   8   9   10   >