[R] Class noquote to matrix

2011-03-29 Thread Mark Ebbert
Hi, I apologize if the solution is right in front of me, but I can't find anything on how to convert a class of 'noquote' to 'matrix'. I've tried as.matrix and I've tried coercing it by 'class(x)<-matrix', but of course that didn't work. I've been using the function 'symnum' which returns an ob

[R] a for loop to lapply

2011-03-29 Thread Alaios
Dear all, 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) {ShadowMatrix<-i} la

[R] RWeka - adding weights to a dataset

2011-03-29 Thread fjpcaballero
Hello, I was wondering what would be the easiest way to append weights to a dataset in RWeka. Ideally, I'd like to have something like: m <- LogitBoost(Species ~ ., data=iris, weights = myweights) But that, as far as I understand, it is not implemented and I'd need to use a workaround. I kn

Re: [R] Fatal error: unable to restore saved dat in .RData

2011-03-29 Thread Bert Gunter
1) Remove (the probably corrupted) .RData file. and/or 2) Start R with the --no-restore option, which will not try to load a saved .Rdata file on start up. e.g. on Windows (?? you did not tell us your OS as requested): "[path to Rgui.exe]" --no-restore (Note: no spaces in --no-restore) If th

Re: [R] svg malformed on CentOS (epel R)

2011-03-29 Thread Paul Murrell
Hi On 14/03/2011 2:30 p.m., Jeroen Ooms wrote: There is an issue with the default svg device on a centos workstation that I am using. It does not result in an error, but it produces malformed svg images. Exactly the same script works just fine on an ubuntu box. On Ubuntu I am using R binary that

Re: [R] Fatal error: unable to restore saved dat in .RData

2011-03-29 Thread David Wolfskill
On Tue, Mar 29, 2011 at 10:29:52PM -0400, John Sorkin wrote: > Windows 7 > R 2.12.2 > > When I launch R, I get the following error message: > > Fatal error: unable to restore saved dat in .RData > > > after which R closes. > > What does the error message mean, and what can I do to get R to wor

[R] Fatal error: unable to restore saved dat in .RData

2011-03-29 Thread John Sorkin
Windows 7 R 2.12.2 When I launch R, I get the following error message: Fatal error: unable to restore saved dat in .RData after which R closes. What does the error message mean, and what can I do to get R to work? I tried removing the R program, re-downloaded the program, and re-installed th

Re: [R] Integration with variable bounds

2011-03-29 Thread Dmlong21
That works perfectly! Thanks so much. DUSTIN -- View this message in context: http://r.789695.n4.nabble.com/Integration-with-variable-bounds-tp3413606p3416851.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
Try this: require(R2Cuba) ans <- divonne(4,1,int, lower=c(4,4,4,4), upper=c(12,12,12,12), max.eval=1e06, rel.tol=1.e-04) > ans integral: 15663.04 (+-1.6) nregions: 182; number of evaluations: 910834; probability: 1.478672e-09 > I am not sure if this answer is correct. Ravi. __

[R] Connect observed values by a smooth curve, is there any method to get coordinate value of arbitrary point on the curve?

2011-03-29 Thread Zhipeng Wang
Dear all, I have the problem as the title shows. It is time series of measurements. I want to estimate the value at time point when we have no actual measured value (Only in the time range, not for prediction in future time). Hope you could give me some suggestion or hint. Thank you so much. Wa

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
You get 0 because you did not specify lower and upper bounds that define the hyper-rectangle; therefore, the default is used which is (0,1)^4. Specify the proper lower and upper bounds. Ravi. Ravi Varadhan, Ph.D. Assistant

[R] Simple AR(2)

2011-03-29 Thread fabio
Hi there, we are beginners in R and we are trying to fit the following time series using ar(2): > x <- c(1.89, 2.46, 3.23, 3.95, 4.56, 5.07, 5.62, 6.16, 6.26, 6.56, 6.98, > 7.36, 7.53, 7.84, 8.09) The reason of choosing the present time series is that the we have previously calculated analiticall

[R] calculating the mode in R...

2011-03-29 Thread Fernando Marmolejo Ramos
Dear R users I’m aware that the package “modest” is useful to find the mode in an array. However, I’d like to know if someone has translated the “mode” function built-in in MATLAB into R language. This function finds the most frequent value in an array (http://www.mathworks.com/help/techdoc/ref/m

Re: [R] normal distribution and floating point traps (?): unexpected behavior

2011-03-29 Thread Duncan Murdoch
On 29/03/2011 5:33 PM, Patrizio Frederic wrote: dear all, here's a couple of questions that puzzled me in these last hours: # issue 1 qnorm(1-10e-100)!=qnorm(10e-100) qnorm(1-1e-10) == -qnorm(1e-10) # turns on to be FALSE. Ok I'm not a computer scientist but, # but I had a look at the R in

Re: [R] normal distribution and floating point traps (?): unexpected behavior

2011-03-29 Thread Thomas Lumley
On Wed, Mar 30, 2011 at 10:33 AM, Patrizio Frederic wrote: > dear all, > here's a couple of questions that puzzled me in these last hours: > > # issue 1 qnorm(1-10e-100)!=qnorm(10e-100) > > qnorm(1-1e-10) == -qnorm(1e-10) > > # turns on to be FALSE. Ok I'm not a computer scientist but, > # but

[R] Not all rows are being read-in

2011-03-29 Thread Dimitri Liakhovitski
Hello! I have a tab-delimited .txt file (size 800MB) with about 3.4 million rows and 41 columns. About 15 columns contain strings. Tried to read it in in R 2.12.2 on a laptop that has Windows XP: mydata<-read.delim(file="FileName.TXT",sep="\t") R did not complain (!) and I got: dim(mydata) 1692063

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Ravi Varadhan
Hi Greg, Thanks. Here is one approach to speeding up the 1st method that I had suggested: n <- 1 set.seed(123) rtrg <- matrix(NA, n, 3) system.time(for (i in 1:n) rtrg[i,] <- diff(c(0, sort(runif(2)), 1))) set.seed(123) system.time({ tmp <- matrix(runif(n*2), n, 2, byrow=TRUE) rtrg.1 <- cb

Re: [R] producing histogram-like plot

2011-03-29 Thread Dennis Murphy
Hi: Here's one way to do it, using ggplot2 and base graphics. # Simulate a data frame with values between 0 and 1 and a corresponding frequency df <- data.frame(val = round(runif(100), 2), freq = rpois(100, 10)) # findInterval assigns the values between 0 and 1 to intervals with width 0.1; you n

Re: [R] Creating a list of all objects

2011-03-29 Thread Henrik Bengtsson
Return as.list(environment()), e.g. foo <- function(x=1) { a <- 1; b <- 2; as.list(environment()); } > foo() $b [1] 2 $a [1] 1 $x [1] 1 > a <- 2 > foo(x=2) $b [1] 2 $a [1] 1 $x [1] 2 > foo(x=4) $b [1] 2 $a [1] 1 $x [1] 4 See help("environment") for more information. /Henrik On Tue, Mar

[R] Creating a list of all objects

2011-03-29 Thread Sam Brown
Dear all I am trying to create a list of all objects created over the course of a function. To wit: foo <- function(x){ first <- x*(1:8) second <- matrix(x*(1:16), ncol = 4) third <- 1:x list(x=x, first=first, second=second, third=third) } foo(5) No worries there. However,

Re: [R] lme:correlationstructure AR1 and random factor

2011-03-29 Thread Ben Bolker
yvonne fabian gmx.de> writes: > > Dear helpers, > > I tried these models to run in the package nlme, but allways got the same > error message... > > I have a correlation in 5 sessions within a field (n=12) with ten traps in > one field. > > res2a <- lme(response~x+y+z+treatment),correlation =

[R] normal distribution and floating point traps (?): unexpected behavior

2011-03-29 Thread Patrizio Frederic
dear all, here's a couple of questions that puzzled me in these last hours: # issue 1 qnorm(1-10e-100)!=qnorm(10e-100) qnorm(1-1e-10) == -qnorm(1e-10) # turns on to be FALSE. Ok I'm not a computer scientist but, # but I had a look at the R inferno so I write: all.equal(qnorm(1-1e-10) , -qno

Re: [R] Intercept and slope of GLS model

2011-03-29 Thread Ben Bolker
John Haart me.com> writes: > With this truncated output from a GLS model the > intercept is 0.004634487 but where is the slope? > > Coefficients: >Value Std.Error > t-valuep-value > (Intercept) 0.004634487 0.000677339

Re: [R] Select subset of data

2011-03-29 Thread Lisa
Thank you for your kind help. Your R code works very well. -- View this message in context: http://r.789695.n4.nabble.com/Select-subset-of-data-tp3416012p3416307.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

[R] Dirichlet surface

2011-03-29 Thread Kehl Dániel
Dear list members, I want to draw surfaces of Dirichlet distributions with different parameter settings. My code is the following: # a1 <- a2 <- a3 <- 2 #a2 <- .5 #a3 <- .5 x1 <- x2 <- seq(0.01, .99, by=.01) f <- function(x1, x2){ term1 <- gamma(a1+a2+a3)/(gamma(a1)*gamma(a2)*gamma(a3))

[R] Hnadling missing data In R

2011-03-29 Thread jouba
Dear all, I have data that contain more than 30 variables and 600 observations, it’s a longitudinal data,data contains a lot of non normal data (despite trying to do some transformation i hav still nonnormal variables ) i have a lot of missing data, i want to impute these missing data ,

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-29 Thread jouba
Dear all I have an error mesage « error message : the MLM estimator can not be used when data are incomplete » When i use the function sem(package lavaan) and when i fill the paramters estimator and missing estimator="MLM", missing="ml" i understand by this that i am not allowed to

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-29 Thread jouba
Ok thanka lot you for your response Antra EL MOUSSELLY Date: Tue, 29 Mar 2011 13:31:32 -0700 From: ml-node+3416220-556418632-225...@n4.nabble.com To: antr...@hotmail.com Subject: Re: Structural equation modeling in R(lavaan,sem) sem (the package) documentation is not intended to teach y

[R] Intercept and slope of GLS model

2011-03-29 Thread John Haart
Dear list - A simple question, i hope! With this truncated output from a GLS model the intercept is 0.004634487 but where is the slope? Coefficients: Value Std.Error t-valuep-value (Intercept) 0.004634487 0.0006773

[R] lme:correlationstructure AR1 and random factor

2011-03-29 Thread yvonne fabian
Dear helpers, I tried these models to run in the package nlme, but allways got the same error message... I have a correlation in 5 sessions within a field (n=12) with ten traps in one field. res2a <- lme(response~x+y+z+treatment),correlation = corARMA(form = ~ session|trapfield, p = 1, q = 0), r

Re: [R] Select subset of data

2011-03-29 Thread David Winsemius
On Mar 29, 2011, at 3:40 PM, Lisa wrote: Dear All, I have a dataset that looks like this: group subject result v4 v5 1 1 1 0 1 0 2 1 2 1 0 0 3 1 3 0 0 0 4 1 4 1 0 0 5 2 1 0 1 1 6 2 2 0

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-29 Thread Jeremy Miles
sem (the package) documentation is not intended to teach you how to do SEM (the technique) (there's very little R documentation that is intended to teach you how to do a particular statistical technique). There are several good books out there, but here's a free access journal article, which will

Re: [R] Select subset of data

2011-03-29 Thread Phil Spector
Lisa - Suppose your data frame is called "somedat". Then do.call(rbind,spl[sapply(spl,function(z)z$result[1] == 0 & z$result[2] == 0 & sum(z$result) == 1)]) should give you what you want. - Phil Spector Sta

[R] Select subset of data

2011-03-29 Thread Lisa
Dear All, I have a dataset that looks like this: group subject result v4 v5 1 1 1 0 1 0 2 1 2 1 0 0 3 1 3 0 0 0 4 1 4 1 0 0 5 2 1 0 1 1 6 2 2 0 0 1 7 2 3 0 1 1

Re: [R] Structural equation modeling in R(lavaan,sem)

2011-03-29 Thread jouba
Dear all, There is some where documentation to understand all indices in the output of the function sem(package lavaan ) ?? for example Chi-square test baseline model, Full model versus baseline model, Loglikelihood and Information Criteria, Root Mean Square Error of Approximation, Standardized R

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread jjap
Many thanks to all, the first 3 solutions worked nicely but I did not get around to tweaking properly the others. It's really nice to get thing going in a "one liner" or about... Again greatly appreciated. Cheers! -- View this message in context: http://r.789695.n4.nabble.com/Simple-but-elusive-e

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Christopher Desjardins
Thanks several of these do exactly what I want. Chris On Tue, Mar 29, 2011 at 2:42 PM, Greg Snow wrote: > Or we could expand a bit more: > > require(TeachingDemos) > require(gtools) > > n <- 1000 > rtrg <- matrix(NA, n, 3) > for (i in 1:n) rtrg[i,] <- diff(c(0, sort(runif(2)), 1)) > > rtrg2 <- m

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Greg Snow
Or we could expand a bit more: require(TeachingDemos) require(gtools) n <- 1000 rtrg <- matrix(NA, n, 3) for (i in 1:n) rtrg[i,] <- diff(c(0, sort(runif(2)), 1)) rtrg2 <- matrix(NA, n, 3) for (i in 1:n) { tmp <- runif(3) rtrg2[i, ] <- tmp/sum(tmp) } rtrg3 <- matrix( rexp(n*3), ncol=3 ) rtrg3 <-

Re: [R] Degree symbol

2011-03-29 Thread stephen's mailinglist account
>> Thank you >> I will experiment with source (looks to be source(file, >> encoding=getOption("latin1" or "UTF-8")). > > No, getOption("encoding") is the literal default, not some sort of general > form.  You want > > encoding="latin1" > > (assuming the whole file uses that encoding). > > Duncan Mu

Re: [R] create string with " using paste.

2011-03-29 Thread Henrique Dallazuanna
Try this: cat("Double quotes: \"\n") On Tue, Mar 29, 2011 at 4:18 PM, Praveen Surendran wrote: > Hi, > > I am trying to create a string -      Double quotes : " > using paste. > > a command something like paste('Double','quotes : \"',sep=" ") prints > "Double quotes : \"" where backslash is also

Re: [R] ggplot2: scale_y_log10() with geom_histogram

2011-03-29 Thread Joshua Wiley
Hi Markus, In some ways, this is not the most elegant solution ever, as you have to manually pick some limits, but it is fairly straightforward: qplot(exp(rnorm(1000))) + geom_histogram(colour = "cornsilk", fill ="darkblue") + scale_x_sqrt() + scale_y_log10() + coord_cartesian(ylim = c(10

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread Henrique Dallazuanna
Try this: transform(tmp[rep(seq(nrow(tmp)), as.numeric(tmp$V4)),], V4 = 1) On Tue, Mar 29, 2011 at 3:15 PM, jjap wrote: > Dear R-users, > > This should be simple but still eludes me: > > Given the following > tmp<-as.data.frame(matrix(c(44, 10, "abc", 1, 44, 10, "def", 1, 44, 12, > "abc", 2), 3,

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread Peter Alspach
Tena koe Try something like: tmp[rep(1:nrow(tmp), each=tmp[,4]),] # untested HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of jjap > Sent: Wednesday, 30 March 2011 7:16 a.m. > To: r-help@r-project.org

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread Petr Savicky
On Tue, Mar 29, 2011 at 11:15:33AM -0700, jjap wrote: > Dear R-users, > > This should be simple but still eludes me: > > Given the following > tmp<-as.data.frame(matrix(c(44, 10, "abc", 1, 44, 10, "def", 1, 44, 12, > "abc", 2), 3, 4, byrow=T)) > > I want to expand the data to the following form

Re: [R] Degree symbol

2011-03-29 Thread Duncan Murdoch
On 29/03/2011 3:11 PM, stephen's mailinglist account wrote: On 29 March 2011 19:48, Duncan Murdoch wrote: > On 29/03/2011 2:40 PM, stephen's mailinglist account wrote: >> >> I have been using both Windows and Linux versions of R>> Now I have found that the following expression seems to work

[R] create string with " using paste.

2011-03-29 Thread Praveen Surendran
Hi, I am trying to create a string - Double quotes : " using paste. a command something like paste('Double','quotes : \"',sep=" ") prints "Double quotes : \"" where backslash is also printed. Is there a way to print just "? Regards, Praveen. [[alternative HTML version deleted]]

Re: [R] Simple but elusive - expand back from counts

2011-03-29 Thread Joshua Wiley
Hi, You can use rep() to repeat the appropriate rows as in V4. For example: tmp[rep(rownames(tmp), tmp$V4), ] V1 V2 V3 V4 1 44 10 abc 1 2 44 10 def 1 3 44 12 abc 2 3.1 44 12 abc 2 if you wanted, you could then reset the row names to NULL to get 1, 2, 3, 4 rather than 3, 3.1 row

[R] ggplot2: scale_y_log10() with geom_histogram

2011-03-29 Thread Markus Loecher
Dear ggplot2 users, is there an easy/elegant way to suppress zero count bars in histograms with logarithmic y axis ? One (made up) example would be qplot(exp(rnorm(1000))) + geom_histogram(colour = "cornsilk", fill = "darkblue") + scale_x_sqrt() + scale_y_log10() Thanks! Markus [[alte

Re: [R] Degree symbol

2011-03-29 Thread stephen's mailinglist account
On 29 March 2011 19:48, Duncan Murdoch wrote: > On 29/03/2011 2:40 PM, stephen's mailinglist account wrote: >> >> I have been using both Windows and Linux versions of R >> Now I have found >> that the following expression seems to work on both systems >> >> xlab = expression(paste("Temperature ["

Re: [R] Integration with variable bounds

2011-03-29 Thread Dmlong21
Thanks for the tip but all I get is 0 for the integral. Any other suggestions? int <- function(y){ u2 = y[1] z2 = y[2] u1 =y[3] z1 = y[4] reg.nonzero <- (u2 > z1 & u2 < z2) & (z2 > z1 & z2 < 12) & (u1 > 4 & u1 < z1) & (z1 > 4 & z1 < 12) ff <- ifelse (reg.nonzero, u1*(z1-u1)*u2*(z2-u2)*exp(-0.0

[R] Simple but elusive - expand back from counts

2011-03-29 Thread jjap
Dear R-users, This should be simple but still eludes me: Given the following tmp<-as.data.frame(matrix(c(44, 10, "abc", 1, 44, 10, "def", 1, 44, 12, "abc", 2), 3, 4, byrow=T)) I want to expand the data to the following form: V1 V2 V3 V4 1 44 10 abc 1 2 44 10 def 1 3 44 12 abc 1 4 44 12 a

Re: [R] R Help Question on cor() function

2011-03-29 Thread Peter Ehlers
On 2011-03-29 07:45, Courtney McCracken wrote: Hi, Does anyone know if the cor() function under the stats package adjusts for ties? Specifically, with method="spearman" does R compute the ties adjusted version of Sperman's rank correlation coefficient or the uncorrected version? If not, does any

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter > Sent: Tuesday, March 29, 2011 10:07 AM > To: Petr Savicky; cddesjard...@gmail.com > Cc: r-help@r-project.org > Subject: Re: [R] Creating 3 vectors that sum to 1 > >

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Ravi Varadhan
Here is an exploration of two different 3-tuple generators (that sum to 1) based on Greg's triplot function: require(TeachingDemos) n <- 1000 rtrg <- matrix(NA, n, 3) for (i in 1:n) rtrg[i,] <- diff(c(0, sort(runif(2)), 1)) rtrg2 <- matrix(NA, n, 3) for (i in 1:n) { tmp <- runif(3) rtrg2[i, ]

Re: [R] Degree symbol

2011-03-29 Thread Duncan Murdoch
On 29/03/2011 2:40 PM, stephen's mailinglist account wrote: I have been using both Windows and Linux versions of R so when I have opened files created in Windows I have found some issues in Linux. One was that my windows setup allowed me to enter a degree symbol from the keyboard for labelling ax

[R] Degree symbol

2011-03-29 Thread stephen's mailinglist account
I have been using both Windows and Linux versions of R so when I have opened files created in Windows I have found some issues in Linux. One was that my windows setup allowed me to enter a degree symbol from the keyboard for labelling axes. Now I have found that the following expression seems to wo

Re: [R] Pictures/ Graphics in rd-files

2011-03-29 Thread baptiste auguie
Hi, The following read might be useful, http://romainfrancois.blog.free.fr/index.php?post/2010/04/03/embed-images-in-Rd-documents baptiste On 29 March 2011 22:33, Etienne Stockhausen wrote: > Hey R-user, > > > > I’ve searched the archives about the following questions and didn’t find > anythin

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Ravi Varadhan
The following one-liner generates uniformly distributed 3-tuples that sum to 1: diff(c(0, sort(runif(2)), 1)) More, generally you can generate n-tuples that sum to unity as: diff(c(0, sort(runif(n-1)), 1)) Ravi. Ravi Varad

Re: [R] passing arguments via "..."

2011-03-29 Thread Bert Gunter
Passing arguments can be tricky ( take a look at plot.default !!). There may be a better approach then what you have considered. hist is (S3) generic. So make a method for an S3 class that will handle data structures like your x. Something like: class(x ) <- c("zebra",class(x)) hist.zebra <- func

Re: [R] xlsx problem

2011-03-29 Thread Steven McKinney
Hi Cristoph, Glad to hear it worked - replying to r-help in case others face this issue. Cheers Steven McKinney From: Martin Knapp [mkna...@aucklanduni.ac.nz] Sent: March 28, 2011 7:28 PM To: Steven McKinney Subject: Re: [R] xlsx problem Thanks that wo

Re: [R] Probing a function

2011-03-29 Thread Peter Ehlers
Dennis, I see that Henrik has given you a clear explanation of how to see the code 'on the fly'. But he's probably too modest to point out that it would be even better to inspect the source code which you can obtain by downloading and unzipping the relevant .tar.gz file from CRAN. Here you will f

Re: [R] How to regress data into coefficients for a gamma function

2011-03-29 Thread Peter Ehlers
On 2011-03-29 06:57, Walter Anderson wrote: Hello, I need to regress data like the example below. The data points represent friction factors derived from observed trip length data. The function used to describe this data is a gamma function of the form, f(t) = a * t^b * e^(c*t) and I need

Re: [R] passing arguments via "..."

2011-03-29 Thread Henrik Bengtsson
It's easier that you think; Fancyhist <- function(x, break=NULL, ...) { # first, process x into xprocess somehow, then ...  if (is.null(breaks)) { # define the histogram breaks somehow, then call hist:  }   hist(xprocess, break=breaks, ...) } /H On Tue, Mar 29, 2011 at 10:47 AM, Cable,

Re: [R] passing arguments via "..."

2011-03-29 Thread Jonathan P Daily
It is not clear to me exactly what you are looking to do, but if you are trying to check whether an argument has been passed via ..., I have used this convention before. fun <- function(arg, ...) { opts <- list(...) if('opt' %in% names(opts)) # Do something... } Does that help?

Re: [R] Using graphics straight from R into published articles

2011-03-29 Thread Philipp Pagel
On Tue, Mar 29, 2011 at 09:31:18AM -0700, blanco wrote: > I was just wondering if people use graphics from R straight into articles or > are they always edited in some way; fonts, headers, axis, color etc? Using > photoshop or some other programs? > > I would like to think it is possible, better

[R] passing arguments via "..."

2011-03-29 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
I would like to do something like the following: Fancyhist<-function(x,...) { # first, process x into xprocess somehow, then ... if (is.null(breaks)) { # yes, I know this is wrong # define the histogram breaks somehow, then call hist: hist(xprocess,breaks=breaks,...) } else { # use br

Re: [R] plotting several ROC curves on the same graph

2011-03-29 Thread meytar
Thank you very much I'll try this Meytar From: Brian Diggs [via R] [mailto:ml-node+3415433-1829104127-202...@n4.nabble.com] Sent: Tuesday, March 29, 2011 6:46 PM To: meytar Subject: Re: plotting several ROC curves on the same graph On 3/29/2011 2:48 AM, meytar wrote: > Hello > I am

Re: [R] Using graphics straight from R into published articles

2011-03-29 Thread Jonathan P Daily
I think you should google search Sweave, as well as check out the ?Sweave page. Not to mention the graphics devices that embed quite nicely into documents, like ?postscript. HTH, Jon -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown

Re: [R] producing histogram-like plot

2011-03-29 Thread Greg Snow
Look at the cut, tapply, and barplot functions. There is probably also a nice way to do this using ggplot2 package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.o

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Bert Gunter
So you want to generate random multinomials ? ... Just generate random uniforms and divide by their sum! z <- runif(3); z/sum(z) ## This can easily be modified to generate lots of random multinomial 3 vectors, e.g. z <- matrix( runif(3*100), ncol=3) z/rowSums(z) ## each row is a random multino

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Peter Ehlers
On 2011-03-29 09:20, Christopher Desjardins wrote: I have 3 vectors: p1, p2, and p3. I would like each vector to be any possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these and I've thought about using scatterplot3d(). Here's what I have so far. library(scatterplot3d) p1<-

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Greg Snow
Do a search for Dirichlet, that may give you the tools you need. Also for plotting 3 vectors that sum to 1, instead of a 3d scatter plot you should look into a triangle or trilinear plot, see ?triplot in the TeachingDemos package (the see also for that help page lists several other implementati

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Richard M. Heiberger
Please look at the triplot function in the klaR package. The keyword is RSiteSearch("barycentric") Rich On Tue, Mar 29, 2011 at 12:20 PM, Christopher Desjardins < cddesjard...@gmail.com> wrote: > I have 3 vectors: p1, p2, and p3. I would like each vector to be any > possible value between 0 an

Re: [R] Help with multidimensional array

2011-03-29 Thread Bert Gunter
Folks: 1. Well, should have known better... I was wrong about what I said in my earlier post below. 2. Here's yet another way to skin the cat using matrix multiplication that is, maybe, a bit faster than using reduce. First, the three methods (left as a homework exercise to see how/why they work

Re: [R] plotting several ROC curves on the same graph

2011-03-29 Thread Brian Diggs
On 3/29/2011 2:48 AM, meytar wrote: Hello I am trying to make a graph of 10 different lines built each from 4 different segments and to add a darker line that will represent the average of all graphs - all in the same plot.Actually each line is a ROC plot The code I'm using for plotting one line

[R] Using graphics straight from R into published articles

2011-03-29 Thread blanco
Hi, I have been working with R for the past couple of years; analyzing data and producing some graphics. I was just wondering if people use graphics from R straight into articles or are they always edited in some way; fonts, headers, axis, color etc? Using photoshop or some other programs? I wo

Re: [R] Creating 3 vectors that sum to 1

2011-03-29 Thread Petr Savicky
On Tue, Mar 29, 2011 at 11:20:13AM -0500, Christopher Desjardins wrote: > I have 3 vectors: p1, p2, and p3. I would like each vector to be any > possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these > and I've thought about using scatterplot3d(). Here's what I have so far. > >

[R] Creating 3 vectors that sum to 1

2011-03-29 Thread Christopher Desjardins
I have 3 vectors: p1, p2, and p3. I would like each vector to be any possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these and I've thought about using scatterplot3d(). Here's what I have so far. library(scatterplot3d) p1 <- c(1,0,0,.5,.5,0,.5,.25,.25,.34,.33,.33,.8,.1,.1,.9,.

Re: [R] new syntax: bash-like pipe operator

2011-03-29 Thread Gabor Grothendieck
On Tue, Mar 29, 2011 at 9:56 AM, Robert Sugar wrote: > Dear R Community, > > One thing that always bugged me about R is the abundance of multi-level > nested statements, like: > > cumsum(ifelse(c(1,diff(v)),1,0)) > > because: > > a) you have to read them inside out as opposed to left-to-right > b

Re: [R] Scrap java scripts and styles from an html document

2011-03-29 Thread Duncan Temple Lang
On 3/28/11 11:38 PM, antujsrv wrote: > Hi, > > I am working on developing a web crawler in R and I needed some help with > regard to removal of javascripts and style sheets from the html document of > a web page. > > i tried using the xml package, hence the function xpathApply > library(XML) >

[R] 'RQuantLib for 2.12 version

2011-03-29 Thread Mauricio Romero
Dear R users, I have been trying to use RQuantLib in the 2.12.2 R version. I downloaded the .zip file from http://sourceforge.net/projects/quantlib/files/QuantLib/ which didn't work, so I I downloaded the package source from

[R] Fwd: comparing heatmaps

2011-03-29 Thread Benton, Paul
Thanks Tom. heatmap.2(mat, Rowv=NA, Colv=NA, col=redgreen, breaks=seq(-1,1,by=0.01), symm=TRUE, trace="none", dendrogram="none") that did the trick :) Begin forwarded message: From: "Leja, Thomas" Date: 29 March 2011 03:47:59 GMT+01:00 To: "Benton, Paul" Subject: Re: [R] comparing heatmaps

[R] How to regress data into coefficients for a gamma function

2011-03-29 Thread Walter Anderson
Hello, I need to regress data like the example below. The data points represent friction factors derived from observed trip length data. The function used to describe this data is a gamma function of the form, f(t) = a * t^b * e^(c*t) and I need to regress the data to obtain the a,b, and

[R] new syntax: bash-like pipe operator

2011-03-29 Thread Robert Sugar
Dear R Community, One thing that always bugged me about R is the abundance of multi-level nested statements, like: cumsum(ifelse(c(1,diff(v)),1,0)) because: a) you have to read them inside out as opposed to left-to-right b) in the console you always have to go back and type the parenthesis if

[R] R Help Question on cor() function

2011-03-29 Thread Courtney McCracken
Hi, Does anyone know if the cor() function under the stats package adjusts for ties? Specifically, with method="spearman" does R compute the ties adjusted version of Sperman's rank correlation coefficient or the uncorrected version? If not, does anyone know of a function/package that will do this?

[R] Plotting 95% Confidence Intervals around RMA slope

2011-03-29 Thread Charlotte Brassey
Hi, I'm regressing various body dimensions upon body mass using the 'lmodel2' function, as I'm keen to obtain both OLS and RMA slope values. I also wish to create a plot of the regressions, with the 95% confidence interval of both the slope and intercept. I know how to plot 95% ci bands of the

Re: [R] (no subject)

2011-03-29 Thread Uwe Ligges
On 29.03.2011 11:31, Meytar Sorek-Hamer wrote: Hellp I posted a message but didn't get any reply How can I send it again please? > Thank you Meytar __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Installing a Package tar.gz in windows

2011-03-29 Thread Duncan Murdoch
On 29/03/2011 8:21 AM, Luis Felipe Parra wrote: Brian and Duncan. Thank you for your help. What I actually am trying to install is fPortfolioSolver, and symphony is the only package I am missing in order to be able to complete the installation. Do you know by any chance what could I do about this

Re: [R] Installing a Package tar.gz in windows

2011-03-29 Thread Uwe Ligges
On 29.03.2011 14:21, Luis Felipe Parra wrote: Brian and Duncan. Thank you for your help. What I actually am trying to install is fPortfolioSolver, and symphony is the only package I am missing in order to be able to complete the installation. Do you know by any chance what could I do about this

[R] Problems installing fPortfolioSolver

2011-03-29 Thread Luis Felipe Parra
Hello. I have been a couple of days trying to install fPortfolioSolver and have been able to do it. I am getting the following error: * installing to library 'R:/lib/R/CRAN/2.12' ERROR: dependency 'Rsymphony' is not available for package 'fPortfolioSolver' * removing 'R:/lib/R/CRAN/2.12/fPortfolio

Re: [R] Developing a web crawler

2011-03-29 Thread antujsrv
Hi Stefan, Thanks for the links you shared in the post, but i am unable to access the scripts and output. It requires a password. If you can let me know the password for the .rar file of the "scripts_other 5", it would be really helpful. thanks in advance. -- View this message in context: htt

Re: [R] Urgent query about R!

2011-03-29 Thread Rachel Chu
Thank you everyone for all your help!! I have done and sent my coursework now. Hopefully it is alright! R is an interesting programming language but I am happy to leave it for now ;) Have a wonderful easter break! Best wishes, Rachel 2011/3/23 Jorge Ivan Velez > Hi Rachel, > > You might also tr

Re: [R] Integration with variable bounds

2011-03-29 Thread Ravi Varadhan
One useful trick is to use the indicator function in your integrand to define regions where the integrand is non-zero. int <- function(y){ u2 = y[1] z2 = y[2] u1 =y[3] z1 = y[4] reg.nonzero <- (u2 > z1 & u2 <= 12) & (z2 > z1 & z2 <= 12) & (u1 > 4 & u1 <= z2) & (u2 > 4 & u2 <= z2) ff <- ifelse

Re: [R] Installing a Package tar.gz in windows

2011-03-29 Thread Luis Felipe Parra
Brian and Duncan. Thank you for your help. What I actually am trying to install is fPortfolioSolver, and symphony is the only package I am missing in order to be able to complete the installation. Do you know by any chance what could I do about this? Thank you Felipe Parra On Tue, Mar 29, 2011 at

Re: [R] Installing a Package tar.gz in windows

2011-03-29 Thread Prof Brian Ripley
On Tue, 29 Mar 2011, Duncan Murdoch wrote: On 11-03-28 6:41 PM, Luis Felipe Parra wrote: Duncan I have been trying to work out the solution you gave me but I haven't really got to sort it out. I tried first the option with install packages and got this: > filename <- file.choose() > filename

Re: [R] rtree() distances between tips as n by n matrix?

2011-03-29 Thread Brian Pellerin
Thanks, Simon. This is very useful. Brian On Mon, Mar 28, 2011 at 11:39 PM, Simon Blomberg wrote: > ?cophenetic > > Cheers, > > Simon. > > On 29/03/11 10:27, Ben Bolker wrote: > >> Brian Pellerin gmail.com> writes: >> >> >> >> >>> If I generate a random tree with n=10 tips as rtree(n=10) say,

Re: [R] Installing a Package tar.gz in windows

2011-03-29 Thread Duncan Murdoch
On 11-03-28 6:41 PM, Luis Felipe Parra wrote: Duncan I have been trying to work out the solution you gave me but I haven't really got to sort it out. I tried first the option with install packages and got this: > filename <- file.choose() > filename [1] "C:\\Users\\Hp\\Documents\\R\\win-librar

[R] plotting several ROC curves on the same graph

2011-03-29 Thread meytar
Hello I am trying to make a graph of 10 different lines built each from 4 different segments and to add a darker line that will represent the average of all graphs - all in the same plot.Actually each line is a ROC plot The code I'm using for plotting one line is as follows: logit.roc.plot <-

Re: [R] (no subject)

2011-03-29 Thread Meytar Sorek-Hamer
Hellp I posted a message but didn't get any reply How can I send it again please? Thank you Meytar __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.h

[R] Pictures/ Graphics in rd-files

2011-03-29 Thread Etienne Stockhausen
Hey R-user, I’ve searched the archives about the following questions and didn’t find anything useful. The last entries are more than 2 years old. Is there now any possibility to insert a picture or a graphic in a rd-help-file? I’m looking forward for any suggestions or hints. Much thanks

  1   2   >