[R] [Plea to the R Gods] Theoretical and Empirical CDFs

2011-06-01 Thread teriri
http://r.789695.n4.nabble.com/file/n3567636/ecdfs.jpg ecdfs.jpg http://r.789695.n4.nabble.com/file/n3567636/ecdf_curve.gif ecdf_curve.gif Hello, I have generated a plot of two empirical CDFs (attachment 1). As a result, they are stepwise when plotted. The following code was used: > plot(ecdf(mu

[R] need help for R Installation in AIX 5.3

2011-06-01 Thread Harvir Singh
Dear Sir/ Madam, I am trying to install R in my AIX-5.3 machine but its giving some error during configuration as given below: checking how to hardcode library paths into programs... immediate checking for cos in -lm... yes checking for sin in -lm... yes checking for dlopen in -ldl... yes checki

[R] Fw: Value of 'pi'

2011-06-01 Thread Iasonas Lamprianou
Indeed, Indiana had a go at "pi". Have a look here http://en.wikipedia.org/wiki/Indiana_Pi_Bill Dr. Iasonas Lamprianou Department of Social and Political Sciences University of Cyprus [[alternative HTML version deleted]] __ R-help@r-project.

Re: [R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread Jin.Li
Hi All, Thanks for the clarification. Now, perhaps I should use kappa instead. Since my predictions are in 1 and 2, there are no numeric predictions. To my surprise, when I applied kappa and auc to the data, their values are highly correlated, with only an exception when there are perfect predict

Re: [R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 10:41 PM, Max Kuhn wrote: David, The ROC curve should really be computed with some sort of numeric data (as opposed to classes). It varies the cutoff to get a continuum of sensitivity and specificity values. Using the classes as 1's and 2's implies that the second class is

Re: [R] newbie: fourier series for time series data

2011-06-01 Thread eddie smith
Hi Spencer and Mike, Thank you very much! I never expect to get 3 replies in one day. You all are really helpful. While I am struggling reading all the documents suggested, here is the data. Maybe this will help to clear up what I am intending to do. Thank in advance guys. Eddie On Tue, May 31,

[R] ylab spacing in resizePanels in latticeExtra

2011-06-01 Thread Richard M. Heiberger
I would like the ylab in the second, resized graph to be centered on the actual positions of the panels of the second graph, not on the positions appropriate for the first graph. How can that be specified. Toggle the two graphs to see that the ylab is identically spaced in both, even though the pan

Re: [R] Run R script automatically each morning and email results?

2011-06-01 Thread Andy Zhu
Use cron job scheduler to start r session on your script. Andy From: Sarah Henderson To: R List Sent: Wednesday, June 1, 2011 7:50 PM Subject: [R] Run R script automatically each morning and email results? Greetings to all -- I am hoping that someone can off

Re: [R] error in model specification for cfa with lavaan-package

2011-06-01 Thread Mike Cheung
Dear Alain, You may speed up the analysis by using the sample covariance matrix based on a listwise deletion: cov.cfa <- cov(your.raw.data, use="complete.obs") Since you have 36671 cases, the results should be similar to those based on the raw data unless you have lots of missing data and/or the

Re: [R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread Max Kuhn
David, The ROC curve should really be computed with some sort of numeric data (as opposed to classes). It varies the cutoff to get a continuum of sensitivity and specificity values.  Using the classes as 1's and 2's implies that the second class is twice the value of the first, which doesn't reall

Re: [R] mixed model question and using lmer

2011-06-01 Thread Ben Bolker
Wiggin gmail.com> writes: > > i am analyzing some data and have a question i hope someone can > answer. > > i want to use this sort of model: > [quoting snipped to fool gmane into letting me post a short answer] lmer( y ~ x + (1 | ID ), family=binomial, weight=w) so i want to explore the r

Re: [R] aucRoc in caret package

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 9:24 PM, wrote: Please note that predicted1 and predicted2 are two sets of predictions instead of predictors. As you can see the predictions with only two levels, 1 is for hard and 2 for soft. Yes, I (very clearly I think) saw that. I need to assess which one is more

Re: [R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread Jin.Li
Please note that predicted1 and predicted2 are two sets of predictions instead of predictors. As you can see the predictions with only two levels, 1 is for hard and 2 for soft. I need to assess which one is more accurate. Hope this is clear now. Thanks. Jin -Original Message- From: Davi

[R] mixed model question and using lmer

2011-06-01 Thread Wiggin
i am analyzing some data and have a question i hope someone can answer. i want to use this sort of model: lmer( y ~ x + (1 | ID ), family=binomial, weight=w) so i want to explore the relationship between y and x, with a random effect for each patient. my question is this. is this a sensible mo

Re: [R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread David Winsemius
Using AUC for discrete predictor variables with inly two levels doesn't seem very sensible. What are you planning to to with this measure? -- David. On Jun 1, 2011, at 8:47 PM, wrote: Hi all, I used the following code and data to get auc values for two sets of predictions:

[R] aucRoc in caret package [SEC=UNCLASSIFIED]

2011-06-01 Thread Jin.Li
Hi all, I used the following code and data to get auc values for two sets of predictions: library(caret) > table(predicted1, trainy) trainy hard soft 1 270 2 11 99 > aucRoc(roc(predicted1, trainy)) [1] 0.5 > table(predicted2, trainy) trainy hard soft 1

Re: [R] Recode numbers

2011-06-01 Thread Dennis Murphy
Hi: Here's another option: rep(b, rle(a)$lengths) > identical(a1, rep(b, rle(a)$lengths)) [1] TRUE rle(a)$lengths computes a table of the number of consecutive repeats of a number (or run lengths). It will have the same length as b in this case. Using rep() with the table of lengths as repetiti

Re: [R] subsetting with condition

2011-06-01 Thread Bert Gunter
Kristina: You posed your question nicely, but it would help R HelperRs if you used dput() to post your data for us to more easily copy and paste into R in future. Anyway, there are probably about a million ways to do this (see especially the ddply package for organizing data), but one basic appro

Re: [R] subsetting with condition

2011-06-01 Thread Henrique Dallazuanna
Try this: subset(x, ave(x$ID, x$Pol., FUN = length) >= 3) On Wed, Jun 1, 2011 at 8:00 PM, kristina p wrote: > Dear R Team, > > I am a new R user and I am currently trying to subset my data under a > special condition. I have went through several pages of the subsetting > section here on the foru

Re: [R] subsetting with condition

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 7:00 PM, kristina p wrote: Dear R Team, I am a new R user and I am currently trying to subset my data under a special condition. I have went through several pages of the subsetting section here on the forum, but I was not able to find an answer. My data is as follows: ID

Re: [R] lattice panel fine control

2011-06-01 Thread Dennis Murphy
Hi: See inline. On Wed, Jun 1, 2011 at 10:00 AM, maxbre wrote: > Hello R experts, > > what follows is my reproducible example: > > mydata<-structure(list(ped.avg = c(335.9, 110.8, 645.7, 638.9, 1468.1, > 126.4, 4811.1, 88.5, 868.5, 656.6, 723.6, 654, 2.8, 15, 14.2, > 17.5, 15.4, 112.1, 424.7, 18

[R] Run R script automatically each morning and email results?

2011-06-01 Thread Sarah Henderson
Greetings to all -- I am hoping that someone can offer some insight into an area where I have very little experience. I have written some R code that generates a 90-day plot of temperature vs. mortality. On whatever day the code is run it will grab up-to-date vital statistics data from our serve

Re: [R] Building package with vignette

2011-06-01 Thread Richard Davis
Hi Richard, I am having the same error you encountered as described in: https://stat.ethz.ch/pipermail/r-help/2009-August/207010.html Do you happen to know the solution to this problem? I'm stuck on the same issue. Thanks, Richard Davis Analyst | Taylor Fry Consulting Actuaries

[R] subsetting with condition

2011-06-01 Thread kristina p
Dear R Team, I am a new R user and I am currently trying to subset my data under a special condition. I have went through several pages of the subsetting section here on the forum, but I was not able to find an answer. My data is as follows: ID NAME MS Pol. Party

Re: [R] Contributed Packages - Hmisc & survey

2011-06-01 Thread Thomas Lumley
On Thu, Jun 2, 2011 at 9:13 AM, Nordlund, Dan (DSHS/RDA) wrote: >> > install.packages ("Hmisc", dependencies=TRUE) >> --- Please select a CRAN mirror for use in this session --- >> Warning: unable to access index for repository >> http://watson.nci.nih.gov/cran_mirror/bin/windows/contrib/2.13 >>

Re: [R] How to write random effect in MCMCglmm

2011-06-01 Thread Ben Bolker
Belle gmail.com> writes: > > Hi All, > > The data set that I have is a cluster data, and I want to run a HLM mixed > model with multi-level response. Here is my data set: > response: [snip] > library(MCMCglmm) > y <- MCMCglmm(factor(Level) ~ Type+factor(yr>=2006)+Male+Ethnicity+ELL+ > avgTra

Re: [R] Plotting from functions

2011-06-01 Thread David Scott
On 02/06/11 10:13, Duncan Murdoch wrote: On 01/06/2011 4:06 PM, Yang Zhang wrote: On Wed, Jun 1, 2011 at 1:04 PM, Yang Zhang wrote: I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for som

[R] How to write random effect in MCMCglmm

2011-06-01 Thread Belle
Hi All, The data set that I have is a cluster data, and I want to run a HLM mixed model with multi-level response. Here is my data set: response: - Level (num: 1, 2, 3, 4, 5 - 5 levels) Covariates: - Type (Factor: A, B, C - 3 levels) - yr (num: 2006, 2007, ...) - Male (num: 0=not Male

Re: [R] Replacing variables in one dataset with those from another

2011-06-01 Thread Dennis Murphy
Hi: Letting d1 and d2 be your two data frames, > merge(d1, d2, by.x = 'x1', by.y = 'num', all.x = TRUE)[, c(2, 4, 3)] grpnum uniqueid x2 1 D 276 2 B 898 3 A GHU82RK02HD7D6 334 4 C GHU82RK02IXPC7 4077 If you want x1 to be the variable name fo

Re: [R] Plotting from functions

2011-06-01 Thread Duncan Murdoch
On 01/06/2011 4:06 PM, Yang Zhang wrote: On Wed, Jun 1, 2011 at 1:04 PM, Yang Zhang wrote: I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for some reason it's not working when that's in a

Re: [R] Create Matrix with Float32 values

2011-06-01 Thread Duncan Murdoch
On 01/06/2011 12:16 PM, Chris English wrote: Dear R_Help: The following gives me a matrix with integer values. z= matrix(rep(10:1, each= 10), ncol= 10, byrow=TRUE)> str(z) int [1:10, 1:10] 10 9 8 7 6 5 4 3 2 1 ... How do I specify that I want Float32 values instead. You can't. R doesn't sup

Re: [R] Problems Dating....

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 5:14 PM, Struckmeier, Nathanael wrote: I'll give this a try and mess with what format to convert it to. Thanks again! You need to decide whether to use "%d/%m/%Y" or "%m/%d/%" , since the information you provided so far leaves that undetermined. -- David. Hi Nat, I

Re: [R] Create Matrix with Float32 values

2011-06-01 Thread Peter Ehlers
On 2011-06-01 09:16, Chris English wrote: Dear R_Help: The following gives me a matrix with integer values. z= matrix(rep(10:1, each= 10), ncol= 10, byrow=TRUE)> str(z) int [1:10, 1:10] 10 9 8 7 6 5 4 3 2 1 ... How do I specify that I want Float32 values instead. Thanks,Chris Have you tried

Re: [R] finding numbers in a range

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 5:07 PM, Salih Tuna wrote: Hi, Is there a quick way of finding if numbers in a vector falls in between a range defined in another matrix. As an example let x y 0 1 3 2 6 9 2515 18 I want to check one by one whether 0,2 and 25 falls in any of the ran

Re: [R] Missing completely at random

2011-06-01 Thread Steven Kennedy
This works, but there might be a better way: misscols<-lapply(howmanyMiss, function(x) sample(1:n, x)) for (i in 1:nMiss){ for (j in misscols[[i]]){ X[idMiss[i],j]<-NA } } __ R-help@r-project.org mailing list https://sta

Re: [R] Plotting from functions

2011-06-01 Thread Joshua Wiley
Hi, Within functions, you often do need to wrap the plotting calls in print() (you would see this if you read the FAQ). Cheers, Josh On Wed, Jun 1, 2011 at 1:06 PM, Yang Zhang wrote: > On Wed, Jun 1, 2011 at 1:04 PM, Yang Zhang wrote: >> I can plot to png's fine when i run this directly from

Re: [R] RES: Recode numbers

2011-06-01 Thread Lisa
Thank you very much, Bill. Your script works very well. -- View this message in context: http://r.789695.n4.nabble.com/Recode-numbers-tp3566395p3566847.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

Re: [R] Plotting from functions

2011-06-01 Thread Yang Zhang
On Wed, Jun 1, 2011 at 1:04 PM, Yang Zhang wrote: > I can plot to png's fine when i run this directly from the top-level > script/console: > > png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() > > But for some reason it's not working when that's in a function: > > (function(){png('dia

Re: [R] RES: Recode numbers

2011-06-01 Thread Lisa
Thank you so much, Filipe. Your R script is what I am looking for. -- View this message in context: http://r.789695.n4.nabble.com/Recode-numbers-tp3566395p3566818.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org ma

[R] Plotting from functions

2011-06-01 Thread Yang Zhang
I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for some reason it's not working when that's in a function: (function(){png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()})() I su

Re: [R] Problems Dating....

2011-06-01 Thread Struckmeier, Nathanael
I'll give this a try and mess with what format to convert it to. Thanks again! -Original Message- From: Stephan Kolassa [mailto:stephan.kola...@gmx.de] Sent: Wednesday, June 01, 2011 2:10 PM To: Struckmeier, Nathanael Cc: R-help@r-project.org Subject: Re: [R] Problems Dating Hi Na

Re: [R] Contributed Packages - Hmisc & survey

2011-06-01 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Muhuri, Pradip (SAMHSA/CBHSQ) > Sent: Wednesday, June 01, 2011 1:01 PM > To: 'r-help-requ...@r-project.org'; 'R-help@r-project.org' > Subject: [R] Contributed Packages - Hmisc & s

Re: [R] Problems Dating....

2011-06-01 Thread Marc Schwartz
On Jun 1, 2011, at 3:59 PM, Struckmeier, Nathanael wrote: > I'm trying to convert a column in a data frame with dates from a > "Factor" type to a "Date Object" but I am encountering and error. (I am > having trouble plotting an x,y scatter and I suspect it's something with > my data format). I hav

Re: [R] Problems Dating....

2011-06-01 Thread Stephan Kolassa
Hi Nat, I guess something like as.Date(as.character("3/4/2007"),format="%d/%m/%Y") should work - as.character() coerces the factors to characters, which the as.Date() function can work with, given the right format argument. HTH Stephan Am 01.06.2011 22:59, schrieb Struckmeier, Nathanael: I'

Re: [R] weird error from MASS::eqcsplot with postscript driver

2011-06-01 Thread Rolf Turner
The problem is the ``paper="special" '' specification in your eps() function. This makes par("pin"), which eqcsplot() uses in its calculations, undefined. The ``value'' thus produced is: [1] NaN NaN Which makes perfect sense if you think about it. If you're going to use paper=special, you n

[R] finding numbers in a range

2011-06-01 Thread Salih Tuna
Hi, Is there a quick way of finding if numbers in a vector falls in between a range defined in another matrix. As an example let x y 0 1 3 2 6 9 2515 18 I want to check one by one whether 0,2 and 25 falls in any of the ranges in y. I am using 2 for loops but it is taking a hug

Re: [R] re-write plot function for ggplot

2011-06-01 Thread John Ramey
A useful way to get a feel for ggplot2 is to check out http://yeroon.net/ggplot2/ This site allows for a point-and-click ggplot2 graphs. You will not have all of the options from ggplot2 (e.g. themes), but it's a good place to get started. Also, there are some wonderful video tutorials in the hel

[R] Problems Dating....

2011-06-01 Thread Struckmeier, Nathanael
I'm trying to convert a column in a data frame with dates from a "Factor" type to a "Date Object" but I am encountering and error. (I am having trouble plotting an x,y scatter and I suspect it's something with my data format). I have a table with two columns and 8,000 rows. > dsort=read.delim("C:

Re: [R] Force the for loop to stop

2011-06-01 Thread Salih Tuna
That is great Stephan, thanks a lot for your help. best, salih On Wed, Jun 1, 2011 at 9:18 PM, Stephan Kolassa wrote: > Hi Salih, > > here you go: > > > dummy <- FALSE > for ( ii in 1:5 ) { > for ( jj in 3:6 ) { >cat("ii=",ii,"; jj=",jj,"\n",sep="

Re: [R] Function to save plots

2011-06-01 Thread Joshua Wiley
Hi Merik, I believe this does what you want (and maybe a little more): ## define the function, a1 and a2 correspond to your arguments ## d is the directory to save the file in (by default the working directory) ## ... are additional arguments that can be passed to png() to control things like qua

Re: [R] Recode numbers

2011-06-01 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Lisa > Sent: Wednesday, June 01, 2011 12:28 PM > To: r-help@r-project.org > Subject: Re: [R] Recode numbers > > Thank

Re: [R] Force the for loop to stop

2011-06-01 Thread Stephan Kolassa
Hi Salih, here you go: dummy <- FALSE for ( ii in 1:5 ) { for ( jj in 3:6 ) { cat("ii=",ii,"; jj=",jj,"\n",sep="") if ( ii == jj ) { dummy <- TRUE break } } if ( dummy ) break } ###

Re: [R] Force the for loop to stop

2011-06-01 Thread Salih Tuna
Hi Stephan, Thanks a lot. But i am not very good at R yet so i dont know how to set the dummy variable to FALSE. Can you please help me with that as well? On Wed, Jun 1, 2011 at 8:34 PM, Stephan Kolassa wrote: > Hi, > > you could set a dummy variable to FALSE outside the outermost loop. If the >

[R] Function to save plots

2011-06-01 Thread Merik Nanish
Hello, I'm using ROCR to plot ROC Curves and I want to automate the saving of plots into PNG files using a custom function. My data frames are named like test1, test2, test3. Each data frame has three variables: method1, method2, goldstandard. Right now, for each plot I have to run: png('test1_

[R] RES: Recode numbers

2011-06-01 Thread Filipe Leme Botelho
--- Begin Message --- I think this is proper. a <- c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, 3, 4) b <- c(1, 5, 8, 9, 14, 20, 3, 10, 12, 6, 16, 7, 11, 13, 17, 18, 2, 4, 15, 19) ref <- 1 for (i in 2:length(a)) { if (a[i]!=a[i-1]) ref <- c(ref, ref[length(ref)]+1) if

[R] problems with copula

2011-06-01 Thread ANGELA86
Hi, I'd like to know why using the program "R" I can't add a number of margins> 3, I have a problem with the graphics. Post here my script: > myCop.norm <- ellipCopula(family = "normal", dim = 3, param = 0.4) > myMvd <- mvdc(copula = myCop.norm, margins = c("norm", "norm","norm"), > paramMargins

Re: [R] Recode numbers

2011-06-01 Thread Lisa
Thank you, Duncan, Here “a” has the length of 24, and “b” has the length of 20 with numbers from 1 to 20 uniquely. I just want encode “a” from 1 to 20 based on “a” current order using “b”. So, a1[1] = b[1] = 1 a1[2] = b[2] = 5 a1[3] = a1[4] = b[3] = 8 (since third and fourth numbers are the same i

[R] Contributed Packages - Hmisc & survey

2011-06-01 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello List, Could someone tell why I can't install the Himsc and survey packages for R version 2.13.0 (2011-04-13)? What am I doing wrong here? Thanks, Pradip > install.packages ("Hmisc", dependencies=TRUE) --- Please select a CRAN mirror for use in this session --- Warning: unable to access

Re: [R] as.character limits length of result for formula

2011-06-01 Thread William Dunlap
as.character() doesn't give a faithful character representation of its input for lots of language- related inputs. E.g., > f <- reformulate(paste(sep="","X",1:500), quote(log(Y))) > cat(strwrap(as.character(f), 60), sep="\n") ~ log(Y) X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X10 + X1

Re: [R] Force the for loop to stop

2011-06-01 Thread Stephan Kolassa
Hi, you could set a dummy variable to FALSE outside the outermost loop. If the break condition is met in the inner loop, set the dummy variable to TRUE before breaking and test its truth status in the outer loop. HTH Stephan Am 01.06.2011 21:25, schrieb Salih Tuna: Hi, I am looking for a c

[R] Force the for loop to stop

2011-06-01 Thread Salih Tuna
Hi, I am looking for a command in R that would force the for loop to stop after it finds what it is looking for. As an example for(i in 1:5){ for(j in 3:6){ if(i==j) # do something... break; } } And i don't want the loop to execute once i = 3 and stop. Is there a way to do

[R] as.character limits length of result for formula

2011-06-01 Thread Terrence Ireland
If you want a character representation of a long formula (or a formula with long names), you can use: as.character(my.formula) However restriction on length of an as.character result returns only the beginning of a long formula, and without comment. In most cases, the following expres

[R] weird error from MASS::eqcsplot with postscript driver

2011-06-01 Thread Michael Friendly
[Env: R 2.12.2, Win XP] I'm creating figures using MASS::eqcsplot to provide equal scaling of the axes. My figures work OK when I plot to the screen, but when I try to do the same plot as a postscript file, I get an unexplicable error, > figframe() Error in if (yuin > xuin * ratio) yuin <- x

Re: [R] Qs on "vector of lists", etc.

2011-06-01 Thread Uwe Ligges
On 01.06.2011 18:59, Roy Shimizu wrote: I'm pretty new to R, so please forgive the cluelessness of these questions. Is it true that it is not possible to have a "vector or lists" in R? Is a "list of lists" the closest one can get to a "vector of lists"? Actually a list is a vector of mode "

[R] BiodiversityR GUI on macosx

2011-06-01 Thread János Korponai
Dear List! I installed R and quite a few packages I use. When I try to start BiodiversityR the library loads without any problems but GUI do not start. Rcmdr loads without any problems. I am using R 2.13.0 64 bit. Downgrade to R 2.12.2 works. Thanks, Janos __

Re: [R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
Marc, Thank you very much. You gave exactly what I wanted. Bests. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departamento de Estatística - Universidade Federa

Re: [R] Recode numbers

2011-06-01 Thread Duncan Murdoch
(The attributions are a little messed up here:) I have two sets of numbers that look like a<- c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, 3, 4) b<- c(1, 5, 8, 9, 14, 20, 3, 10, 12, 6, 16, 7, 11, 13, 17, 18, 2, 4, 15, 19) I just want to use “b” to encode “a” so that “a”

Re: [R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Marc Schwartz
On Jun 1, 2011, at 1:33 PM, Walmes Zeviani wrote: > Hello list, > > I'm doing a table with scores and I want include colors to represent status > of an individual. I'm using sweave <>= and xtable but I can't > get a result I want. My attemps are > > #-

Re: [R] lattice panel fine control

2011-06-01 Thread Bert Gunter
It is perhaps not entirely clear from ?update, but update replaces your original lattice call with your new call and re-drawsthe plot. This means that the panel function used for the update() plot is the one in update(), which only draws the line. That's why you see no points. Obviously, then, you

[R] Replacing variables in one dataset with those from another

2011-06-01 Thread mcginnis21
Hoping someone out there can help me...this seems like an easy task but I can't figure it out... I want to replace variables in one dataset (Dataset1) with a variable from another dataset (Dataset2). All the values for variables x1 and x2 in Dataset1 have a unique match to the variable uniquenum

Re: [R] Recode numbers

2011-06-01 Thread Lisa
Thank you for your help, Pete. I tried b[a], but it is not a1. -- View this message in context: http://r.789695.n4.nabble.com/Recode-numbers-tp3566395p3566534.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

[R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
Hello list, I'm doing a table with scores and I want include colors to represent status of an individual. I'm using sweave <>= and xtable but I can't get a result I want. My attemps are #- # code R da <- data.frame(id=le

[R] Qs on "vector of lists", etc.

2011-06-01 Thread Roy Shimizu
I'm pretty new to R, so please forgive the cluelessness of these questions. Is it true that it is not possible to have a "vector or lists" in R? Is a "list of lists" the closest one can get to a "vector of lists"? Is it possible to have a "matrix of lists" in R? Or an "array of lists"? Thanks!

[R] lattice panel fine control

2011-06-01 Thread maxbre
Hello R experts, what follows is my reproducible example: mydata<-structure(list(ped.avg = c(335.9, 110.8, 645.7, 638.9, 1468.1, 126.4, 4811.1, 88.5, 868.5, 656.6, 723.6, 654, 2.8, 15, 14.2, 17.5, 15.4, 112.1, 424.7, 18.3, 19.9, 28.6, 25.6, 23.5, 15.4, 27, 62.1, 15.6, 74.6), ped.erst = c(96, 5

[R] Recode numbers

2011-06-01 Thread Lisa
Dear all, I have two sets of numbers that look like a <- c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, 3, 4) b <- c(1, 5, 8, 9, 14, 20, 3, 10, 12, 6, 16, 7, 11, 13, 17, 18, 2, 4, 15, 19) I just want to use “b” to encode “a” so that “a” looks like a1<- c(1, 5, 8, 8, 9, 9,

Re: [R] Recode numbers

2011-06-01 Thread Pete Brecknock
Lisa wrote: > > Dear all, > > I have two sets of numbers that look like > > a <- c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, > 3, 4) > > b <- c(1, 5, 8, 9, 14, 20, 3, 10, 12, 6, 16, 7, 11, 13, 17, 18, 2, 4, 15, > 19) > > I just want to use “b” to encode “a” so that “a”

Re: [R] MAP datafile

2011-06-01 Thread Jim Silverton
Hi, I have a MAP datafile with SNP data and would like to open it and run say fisher's exact test and save the p-values. Anyone has any idea how this can be done? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org ma

[R] Memory management

2011-06-01 Thread Michael Conklin
I am trying to run a very large Bradley-Terry model using the BradleyTerry2 package. (There are 288 "players" in the BT model). My problem is that I ran the model below successfully. WLMat is a win-loss matrix that is 288 by 288 WLdf<-countsToBinomial(WLMat) mod1<-BTm(cbind(win1,win2),player1,

Re: [R] interpolation and extremum location of a surface‏

2011-06-01 Thread David Winsemius
On Jun 1, 2011, at 9:24 AM, Clement LAUZIN wrote: Hello, I have a x,y,z file.Z is not corresponding to a simple analytical function of x and y (see below). I am trying to find the minimum location of this surface and the z value corresponding to this location by a spline interpolation or

[R] Anyone have experience with kinship pedigree plot?

2011-06-01 Thread Ben Bimber
Hello, I am using the Kinship package to draw a pedigree plot. I am trying to control the spacing between individuals in the pedigree. Currently, it is drawing a pedigree with too little space, so the text is overlapping. I'd like to increase the distance between individuals. According to the d

Re: [R] interpolation and extremum location of a surface‏

2011-06-01 Thread Hans W Borchers
Clement LAUZIN hotmail.com> writes: > Hello, > > Hello, > > I have a x,y,z file.Z is not corresponding to a simple analytical function > of x and y (see below). I am trying to find the minimum location of this > surface and the z value corresponding to this location by a spline > interpolation

Re: [R] Identifying sequences

2011-06-01 Thread Mike Marchywka
> Date: Wed, 1 Jun 2011 17:12:29 +0200 > From: cjp...@gmail.com > To: r-help@r-project.org > Subject: Re: [R] Identifying sequences > > Thanks to David, Thierry and Jonathan for your help. > I have been able to put this function together > > a=1:10 > b

[R] Plot a network with edges of specified length

2011-06-01 Thread PhDGuy
Hello, I would like to plot a network with given edge lengths by using the plot function of the network package. Assume my network has the following adjacency matrix: a b c a 0 0 0 b 1 0 0 c 1 0 0 so that b and c are linked to a. I would like to specify that the length of the edge from b to a

[R] re-write plot function for ggplot

2011-06-01 Thread rmje
Hi, I have the following function that i use to plot graphs. plot_mi_time = function(mdata, miname) { mdata2 = mdata[row.names(mir_test3) == miname, ] # print(mdata2) xcoords <- c(1,1,2,2,3,3) plot(xcoords, mdata2, xaxt="n", ylab="Expression", xlab="Time(h)", , main=miname)

Re: [R] re-write plot function for ggplot

2011-06-01 Thread Lamke
You should post it on the ggplot2 mailing list. For the long run I would suggest getting the book as it's extremely helpful. -- View this message in context: http://r.789695.n4.nabble.com/re-write-plot-function-for-ggplot-tp3565868p3565950.html Sent from the R help mailing list archive at Nabbl

[R] Overlaying two matrices to create a heatmap

2011-06-01 Thread Mark Aquino
Hi, I'm trying to construct a heatmap using two matrices rather than one (Is this possible?) For example, matrix1: (color range black---> blue) acr DPA1-0103 DPA1-0104 DPA1-0201 DPA1-0202 DPA1-0301 DPA1-0103 17 0 2 1 0 DPA1-0104

[R] RES: conversion of matrix into list

2011-06-01 Thread Filipe Leme Botelho
--- Begin Message --- Hi Martin, I believe this can do the trick. Let me know otherwise. Cheers testing <- matrix(rnorm(10),50,2) testing_list <- lapply(1:nrow(testing), function(j) testing[j,]) -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r

[R] Create Matrix with Float32 values

2011-06-01 Thread Chris English
Dear R_Help: The following gives me a matrix with integer values. z= matrix(rep(10:1, each= 10), ncol= 10, byrow=TRUE)> str(z) int [1:10, 1:10] 10 9 8 7 6 5 4 3 2 1 ... How do I specify that I want Float32 values instead. Thanks,Chris

Re: [R] Identifying sequences

2011-06-01 Thread christiaan pauw
Thanks to David, Thierry and Jonathan for your help. I have been able to put this function together a=1:10 b=20:30 c=40:50 x=c(a,b,c) seq.matrix <- function(x){ lower<- x[which(diff(x) != 1)] upper <- x[which(diff(x) != 1)+1] extremities <- c(1,lower, upper,x[length(x)]) m <- data.frame(matrix(e

Re: [R] In a formula, what is the interaction of the intercept and a factor?

2011-06-01 Thread Kevin Wright
Perhaps of interest...in S-Plus 7.0 > model.matrix(y ~ (1+x)*group, data = dat) (Intercept) x group x:group 1 1 1 1 1 2 1 2 1 2 ... > model.matrix(y ~ (1)*group, data = dat) (Intercept) group 1 1 1 2 1 1 ... Kevin

Re: [R] In a formula, what is the interaction of the intercept and a factor?

2011-06-01 Thread Kevin Wright
On Wed, Jun 1, 2011 at 1:19 AM, Prof Brian Ripley wrote: [text deleted] > Note that you usually want to do '*' when you say 'interact with': > >> model.matrix(y ~ (1+x)*group, data = dat) >> > (Intercept) x groupB x:groupB > 11 1 11 > ... Thanks for that suggestion

Re: [R] Force Sweave to add figure filename extension

2011-06-01 Thread Renaud Gaujoux
Hi, thank you Duncan for your prompt response. I was about to post another solution that worked fine for me (and the journal's system). Add in the preamble the command: \DeclareGraphicsExtensions{.pdf} Bests, Renaud On 01/06/2011 16:18, Duncan Murdoch wrote: On 01/06/2011 10:13 AM, Renaud G

Re: [R] Force Sweave to add figure filename extension

2011-06-01 Thread Duncan Murdoch
On 01/06/2011 10:13 AM, Renaud Gaujoux wrote: Hi, is there a way to force Sweave to add the extension (say .pdf) to the image names included by \includegraphics. I understand that the objective of not putting the extension is to allow the compilation with both latex or pdflatex. However, when op

[R] Force Sweave to add figure filename extension

2011-06-01 Thread Renaud Gaujoux
Hi, is there a way to force Sweave to add the extension (say .pdf) to the image names included by \includegraphics. I understand that the objective of not putting the extension is to allow the compilation with both latex or pdflatex. However, when option eps=false, the extension could optionall

[R] interpolation and extremum location of a surface‏

2011-06-01 Thread Clement LAUZIN
Hello, I have a x,y,z file.Z is not corresponding to a simple analytical function of x and y (see below). I am trying to find the minimum location of this surface and the z value corresponding to this location by a spline interpolation or from a polynomial fit. I tried with the akima package

Re: [R] error in model specification for cfa with lavaan-package

2011-06-01 Thread yrosseel
Dear Alain, As for the first error ("sample covariance can not be inverted"): Mike is right: with only 10 observations and 16 variables, the ML estimation of the sample cov produces a covariance matrix that is not positive definite, and hence the inversion (deliberately) fails. The lesson fo

[R] Simulating SVAR Data

2011-06-01 Thread Downey, Patrick
Hello, I'd like to simulate data according to an SVAR model in order to demonstrate how other techniques (such as arima) yield biased estimates. I am interested in a 2 variable SVAR with 2 lags (in the notation of the vars vignette, K = 2, P = 2, where B = I_K). I'm using the {vars} package outlin

Re: [R] graphical output - customization of x axis

2011-06-01 Thread David Winsemius
Take out the pos=0 argument in your call to axis. -- David. On Jun 1, 2011, at 8:56 AM, Christine SINOQUET wrote: Hello, I do not understand why the following source does not success in customizing the x axis. The wished customization just consists in labelling the x ticks with "0kb",

Re: [R] Problem with as.POSIXct()

2011-06-01 Thread Stefan Peterson
circe hotmail.com> writes: > > Hi, when I type in these words: > > > a=c("2011-06-01 17:21:24.83", "2011-06-01 17:21:24.283") > > as.POSIXct(a) > > the real output is: >[1] "2011-06-01 17:21:24.830 CST" "2011-06-01 17:21:24.283 CST" > > rather than the expected one: >[1] "2011-06-01 1

[R] graphical output - customization of x axis

2011-06-01 Thread Christine SINOQUET
Hello, I do not understand why the following source does not success in customizing the x axis. The wished customization just consists in labelling the x ticks with "0kb","1kb","5kb","10kb","20kb","50kb","100kb","inf". pathFileName <- "test1.png" stats4H <- c(0.8623, 0.7142, 0.7211, 0.6753

  1   2   >