Re: [R] unexpected subset select results?

2010-08-24 Thread Gavin Simpson
On Mon, 2010-08-23 at 17:51 -0400, ivo welch wrote: > quizz---what does this produce? Henrique has provided an answer to the question, but... >d=data.frame( a=1:1000, b=2001:3000, z= 5001:6000 ) >attach(d); c <- (a+b)>25; detach(d) ...this is ugly and will potentially catch you out one d

Re: [R] Read data in R

2010-08-24 Thread Prof Brian Ripley
On Tue, 24 Aug 2010, jim holtman wrote: I sounds as if your data is encode as UTF-8. You may need to specify the fileEncoding parameter on the read.table function. Not UTF-8 ... that's a BOM mark in UCS-2. We don't have the sessionInfo() output that we asked for and this is an area where

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread 500600
a <- 1 b <- 2 c <- 3 ls()[-a] # set minus to all the objects you want to retain rm(list = ls()[-a] # will remove all the objects - except a ls() # presto -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p233620

Re: [R] 3D stariway plot

2010-08-24 Thread Stefan Evert
On 24 Aug 2010, at 02:20, Ben Bolker wrote: >> Please, is there an R function /package that allows for 3D stairway plots > like the attached one ? >> In addition, how can I overlay a parametric grid plot?? > > Not exactly, that I know of, but maybe you can adapt > > library(rgl) > demo(hist3d)

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Barry Rowlingson
2010/8/24 500600 : > > a <- 1 > b <- 2 > c <- 3 > > ls()[-a]  # set minus to all the objects you want to retain > > rm(list = ls()[-a]  # will remove all the objects - except a > > ls()  # presto Only because a=1 and a is the first item in the list! Not because you are doing '-a'! If a is 0 then

[R] update and rebuild all?

2010-08-24 Thread Giovanni Azua
Hello, I upgraded my Mac R version to the newest 2.11.1, then I ran the option to update all packages but there was an error related to fetching one of those and the process stopped. I retried updating all packages but nothing happens. Although all my course project scripts work perfectly is th

[R] Time series clustering

2010-08-24 Thread abanero
Hi, I have 1000 monthly time series (just a year) and I want to cluster them. for instance (x): jan 2010 feb 2010 mar 2010 apr 2010 ... ts 1: 12300 12354550 1233 12312 ... ts 2:23423232 2323 232323 ... ... My approach is applying clara

[R] Extract rows from a list object

2010-08-24 Thread Vladimir Mikryukov
Dear list members, I need to create a table from a huge list object, this list consists of matrices of the same size (but with different content). The resulting n tables should contain the same rows from all matrices. For example: n <- 23 x <- array(1:20, dim=c(n,6)) huge.list <- list() for (i

Re: [R] Extract rows from a list object

2010-08-24 Thread Dimitris Rizopoulos
try something like this: n <- 23 x <- array(1:20, dim = c(n, 6)) huge.list <- rep(list(x), 1000) out <- lapply(1:4, function (i) { t(sapply(huge.list, "[", i = i, j = 1:6)) }) out[[1]] out[[4]] I hope it helps. Best, Dimitris On 8/24/2010 11:29 AM, Vladimir Mikryukov wrote: Dear list

Re: [R] Extract rows from a list object

2010-08-24 Thread peter dalgaard
On Aug 24, 2010, at 11:29 AM, Vladimir Mikryukov wrote: > Dear list members, > > I need to create a table from a huge list object, > this list consists of matrices of the same size (but with different > content). > > The resulting n tables should contain the same rows from all matrices. > > Fo

Re: [R] "easiest" way to write an R dataframe to excel?

2010-08-24 Thread Ivan Calandra
Hi! I personally use the function xlsReadWrite::write.xls(), which doesn't need Perl to be installed. It might have less functionalities than WriteXLS, but it is easier to use. HTH, Ivan Le 8/24/2010 00:50, Erich Neuwirth a écrit : > Search for an older message with the subject line > > [R]

Re: [R] Extract rows from a list object

2010-08-24 Thread Vladimir Mikryukov
Thanks a lot!! It sure helped. and many thanks to all other repliers! On Tue, Aug 24, 2010 at 3:40 PM, Dimitris Rizopoulos < d.rizopou...@erasmusmc.nl> wrote: > try something like this: > > n <- 23 > x <- array(1:20, dim = c(n, 6)) > huge.list <- rep(list(x), 1000) > > out <- lapply(1:4, functio

Re: [R] unexpected subset select results?

2010-08-24 Thread ivo welch
thanks, everyone. I did not even know about transform() and with(), but they look quite useful. actually, what I had intended to state was that Boolean variables in select parts of subset statements, especially when mixed with other variables that are just part of the data frame, leads to unexpec

Re: [R] Rotate x-axis label on log scale

2010-08-24 Thread Jim Lemon
On 08/24/2010 11:44 AM, Tim Elwell-Sutton wrote: Hi I'd appreciate some help with plotting odds ratios. I want to rotate the labels on the x-axis by 45 degrees. The usual way of doing this, using text - e.g. text(1, par('usr')[3]-2.25..) - gives no result when the y-axis is a log scale. I gue

[R] running a program later

2010-08-24 Thread l.mohammadikhankahdani
Hi ALL I want to run a program on my office computer, but for some reason I have to run it later when I am not in the office anymore. Is there a way to do it? Can I run a program now but in the beginning I say that the rest should be run 3 hours later for example? Thanks a lot Leila

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Nikhil Kaza
or use #not checked rm(setdiff(ls(),c("a", "b")) On Aug 24, 2010, at 4:55 AM, Barry Rowlingson wrote: 2010/8/24 500600 : a <- 1 b <- 2 c <- 3 ls()[-a] # set minus to all the objects you want to retain rm(list = ls()[-a] # will remove all the objects - except a ls() # presto Only beca

Re: [R] running a program later

2010-08-24 Thread Dimitris Rizopoulos
have a look at Sys.sleep(), i.e., you probably need Sys.sleep(3*3600) I hope it helps. Best, Dimitris On 8/24/2010 3:01 PM, l.mohammadikhankahdani wrote: Hi ALL I want to run a program on my office computer, but for some reason I have to run it later when I am not in the office anymore. Is

Re: [R] sendmailR-package-valid code needed

2010-08-24 Thread Ben Bolker
veepsirtt gmail.com> writes: > Warning: dependency ‘caTools’ is not available I'm not quite sure why this is complaining when you supposedly just loaded it ... do you really have it installed? > trying URL 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip' > Error in download.f

Re: [R] : Automatic Debugging

2010-08-24 Thread Ben Bolker
ArtemisIrvine hotmail.com> writes: Try options(error=recover) ? __ 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.html and provide commented, mini

[R] tick marks on both sides of axis

2010-08-24 Thread Kay Cichini
hello, all my attempts to get a plot with tick marks on both sides of axis failed - can someone please help me with this? thanks, kay - Kay Cichini Postgraduate student Institute of Botany Univ. of Innsbruck -- View this message in context

[R] percentage sign in expression

2010-08-24 Thread e-letter
Readers, According to the documentation for the function 'plotmath' there is no apparent possibility to add the percent sign (%) to a plot function, e.g. plot(a[,1]~b[,2],ylab=expression(x~%),xlab=expression(z)) How to achieve this please? yours, rh...@conference.jabber.org r251 mandriva2009

Re: [R] sendmailR-package-valid code needed

2010-08-24 Thread Ben Bolker
veepsirtt gmail.com> writes: > > > I could not install Rmail Package . > I got the following errors. > Then how to do.please > > library("caTools") > > install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib";) try install.packages("caTools") install.packages

Re: [R] Memory Issue

2010-08-24 Thread Cuckovic Paik
Thanks for constrctive comments. I was very careful when I wrote the code. I wrote many functions and then wrapped up to get a single function. Originally, I used optim() to get MLE, it was at least 10 times slower than the code based on Newton method. I also vectorized all objects whenever possib

Re: [R] percentage sign in expression

2010-08-24 Thread Henrique Dallazuanna
You've tried: plot(a[,1]~b[,2],ylab=expression(x~'%'),xlab=expression(z)) ? On Tue, Aug 24, 2010 at 10:37 AM, e-letter wrote: > Readers, > > According to the documentation for the function 'plotmath' there is no > apparent possibility to add the percent sign (%) to a plot function, > e.g. > > p

Re: [R] tick marks on both sides of axis

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 9:31 AM, Kay Cichini wrote: hello, all my attempts to get a plot with tick marks on both sides of axis failed - can someone please help me with this? The path I took to getting a glimmmer of the answer was to look at ? axTicks and then notice in the "..." arguments d

Re: [R] running a program later

2010-08-24 Thread Tim Gruene
On linux or unix you could use the command 'at' to start R in case that the entire job can be started from the command line (e.g. 'R --vanilla < my-R-script'). Tim On Tue, Aug 24, 2010 at 03:01:29PM +0200, l.mohammadikhankahdani wrote: > Hi ALL > > I want to run a program on my office computer, b

Re: [R] percentage sign in expression

2010-08-24 Thread e-letter
On 24/08/2010, Henrique Dallazuanna wrote: > You've tried: > > plot(a[,1]~b[,2],ylab=expression(x~'%'),xlab=expression(z)) ? > This is successful for me, thank you. This instruction should be added to the documentation for 'plotmath'. __ R-help@r-projec

Re: [R] percentage sign in expression

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 9:37 AM, e-letter wrote: Readers, According to the documentation for the function 'plotmath' there is no apparent possibility to add the percent sign (%) to a plot function, Where did you see an assertion made??? e.g. plot(a[,1]~b[,2],ylab=expression(x~%),xlab=expressi

[R] chisq.test on samples of different lengths

2010-08-24 Thread Marino Taussig De Bodonia, Agnese
Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no year 2: no yes no yes I wanted to do a chisq.test, but if I enter it this way: c

[R] Comparing/diffing strings

2010-08-24 Thread Hadley Wickham
Hi all, all.equal is generally very useful when you want to find the differences between two objects. It breaks down however, when you have two long strings to compare: > all.equal(a, b) [1] "1 string mismatch" Does any one know of any good text diffing tools implemented in R? Thanks, Hadley

Re: [R] tick marks on both sides of axis

2010-08-24 Thread Kay Cichini
...i'm aware of par("tcl") and par("tck") but i needed tick marks on both sides of the axis - meaning to cross the axis perpendicularly - admittedly i was clumsy not just calling axis twice, like: plot(1) axis(2,labels=T,tcl=0.25) axis(2,labels=F,tcl=-0.25) yours, kay - --

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Joshua Wiley
If you are going to be doing this a lot, you may want to consider making a little function. Here is an example 'do not remove' function. It defaults to the global environment, but you can always change it. Also, if you try to keep a variable name that does not exist, it will throw an error and n

Re: [R] chisq.test on samples of different lengths

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 10:12 AM, Marino Taussig De Bodonia, Agnese wrote: Hello, I am trying to see whether there has been a significant difference in whether people experienced damages from wildlife in two different years. I therefore have two columns: year 1: yes no no no yes yes no year

Re: [R] Comparing/diffing strings

2010-08-24 Thread Ted Harding
On 24-Aug-10 14:16:55, Hadley Wickham wrote: > Hi all, > all.equal is generally very useful when you want to find the > differences between two objects. It breaks down however, > when you have two long strings to compare: > >> all.equal(a, b) > [1] "1 string mismatch" > > Does any one know of an

Re: [R] chisq.test on samples of different lengths

2010-08-24 Thread peter dalgaard
On Aug 24, 2010, at 4:12 PM, Marino Taussig De Bodonia, Agnese wrote: > Hello, > > I am trying to see whether there has been a significant difference in whether > people experienced damages from wildlife in two different years. I therefore > have two columns: > > year 1: > yes > no > no > no

Re: [R] tick marks on both sides of axis

2010-08-24 Thread David Winsemius
Restoring the broken email chain. I can certainly understand why Nabble users are often guilty of doing so at the beginning of their participation, but after they have been around the list for a while, I would think they should "get the message". If not then: # PLEASE do read the pos

[R] drop unused levels in lattice dotplot axis?

2010-08-24 Thread Stephen T.
Hi list, I have a data set - something like this dfr <- data.frame(A=factor(letters[1:25]),B=runif(25), C=sample(LETTERS[1:4],25,replace=TRUE)) and I want to create a dotplot: library(lattice)dotplot(A ~ B | C, data=dfr, scales=list(y=list(relation="free"))) but this puts uneven

[R] Multivariate control charts in R ?

2010-08-24 Thread vikrant
Hi All, I want to know is there any package in R which can plot multivariate control charts ?? Thanks in advance, Vikrant. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-control-charts-in-R-tp2336576p2336576.html Sent from the R help mailing list archive at Nabble.c

[R] multiple assignments ?

2010-08-24 Thread Maas James Dr (MED)
Simple one, have read and googled, still no luck! I want to create several empty vectors all of the same length. I would like multiple empty vectors (vec1, vec2, vec3) and want to create them all in one line. I've tried vec1,vec2,vec3 <- vector(length=5) and c(vec1,vec2,vec3) <- vector(length=

Re: [R] Using Splus Bootstrapping to find a confidence interval with a given corrected correlation value of two bivariate variables

2010-08-24 Thread minh
Good morning, I am trying to find a S-Plus code which shows how to find a confidence interval using a bootstrapping on a corrected correlation value of a two bivariate variables. If you happen to know one, please shows me. I am greatly appreciated your help. Have a wonderful d

Re: [R] Comparing/diffing strings

2010-08-24 Thread Doran, Harold
There is the stringMatch function in the MiscPsycho package. > stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') [1] 8 > stringMatch('Hadley', 'Hadley Wickham', normalize = 'yes') [1] 0.4285714 It uses Levenshtein distance to tell you how much they differ by, either normalized or not. S

Re: [R] multiple assignments ?

2010-08-24 Thread Joshua Wiley
Hi, This is one way (I chose integer but it can be any mode): vec1 <- vec2 <- vec3 <- vector("integer", 5) Best regards, Josh On Tue, Aug 24, 2010 at 4:58 AM, Maas James Dr (MED) wrote: > Simple one, have read and googled, still no luck! > > I want to create several empty vectors all of the s

Re: [R] unexpected subset select results?

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 7:36 AM, ivo welch wrote: thanks, everyone. I did not even know about transform() and with(), but they look quite useful. actually, what I had intended to state was that Boolean variables in select parts of subset statements, especially when mixed with other variables that

Re: [R] tick marks on both sides of axis

2010-08-24 Thread Kay Cichini
thanks a lot. sorry - i don't know what you mean by "restoring broken email chain", could not get an answer by re-reading the posting guide, either. yours, kay - Kay Cichini Postgraduate student Institute of Botany Univ. of Innsbruck -- V

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Cheng Peng
Thanks for all suggestions from Roman (?= 500600[via R]), Barry and Jim. It seems that ls()[-objectname] didn't work even on numeric matrices and user made functions. I will work with Jim's advice on using grep() and gc() to see whether it works. -- View this message in context: http://r.78969

Re: [R] Strange space characters in character strings

2010-08-24 Thread J. R. M. Hosking
On 2010-08-23 11:03, Mark Breman wrote: Hello everyone, I am reading a HTML table from a website with readHTMLTable() from the XML package: library(XML) moose = readHTMLTable("http://www.decisionmoose.com/Moosistory.html";, header=FALSE, skip.rows=c(1,2), trim=TRUE)[[1]] moose

Re: [R] multiple assignments ?

2010-08-24 Thread r.ookie
Do you mean something like this? > n <- 5 > (vec1 <- matrix(rep(1, n))) [,1] [1,]1 [2,]1 [3,]1 [4,]1 [5,]1 > (vec2 <- matrix(rep(2, n))) [,1] [1,]2 [2,]2 [3,]2 [4,]2 [5,]2 > (vec3 <- matrix(rep(3, n))) [,1] [1,]3 [2,]3 [3,]3

Re: [R] forest plot

2010-08-24 Thread Adaikalavan Ramasamy
You can also do meta.summaries() - from rmeta package - followed by a plot() on the resulting object. Or for a much more flexible plot try forestplot() function, also from rmeta package, but this requires a bit of work to set it up. Regards, Adai On 24/08/2010 05:50, C.H. wrote: The correc

[R] how to convert a unix R package to windows installable zip file?

2010-08-24 Thread Jack Luo
Hi, I downloaded a package with .gz extension, which presumably works for Unix, when I installed it directly on windows, it has the error msg: Error in gzfile(file, "r") : cannot open the connection In addition: Warning messages: 1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Karl Brand
Hi Cheng, Check out the keep() function in package:gdata. And to be sure the "removed" objects are really removed from system memory i think you need to run gc(). hth, Karl On 8/23/2010 9:00 PM, Cheng Peng wrote: How to remove all R objects in the RAM except for a few specified ones? rm(l

Re: [R] multiple assignments ?

2010-08-24 Thread Bert Gunter
None of this would work if the list is long. Isn't this an obvious task for a loop, explicit or implicit? e.g. for(i in 1:100)assign(paste("vec",i,sep=""), vector("integer",5)) or probably better because it creates a list structure: ## warning, untested. You may have to fool with the syntax a b

[R] Minus values in Tps

2010-08-24 Thread sam.e
Hello there, I am using the Tps function to fit a spline to my data which is measurements of a sedimentary layer on an xy plane to see how the thickness of the layer changes. I was wondering if it was possible to change the Tps code so that no minus values are calculated by the spline as these a

Re: [R] Comparing/diffing strings

2010-08-24 Thread Martin Morgan
On 08/24/2010 07:27 AM, Doran, Harold wrote: > There is the stringMatch function in the MiscPsycho package. > >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') > [1] 8 >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'yes') > [1] 0.4285714 > > It uses Levenshtein distance to tel

[R] xylab formatting

2010-08-24 Thread Jennifer Hains
Dear r-help, I'm having trouble formatting xy labels for plot in r. I want to make the following y-label "benzene (mug-3)" where mu is greek and -3 is superscript and benzene is held in an array. I tried this, myname = c("benzene", "etc") plot (c(0:10), ylab = bquote(.(myname[1])~~(mu~g ~m^-3)))

[R] How to obtain seed after generating random number?

2010-08-24 Thread Bogaso Christofer
Dear all, I was doing an experiment to disprove some theory therefore performing lot of random simulation. Goal is to show the audience that although something has very rare chance to occur but it doesn't mean that event would be impossible. In this case after getting that rare event I need to

Re: [R] generate random numbers from a multivariate distribution with specified correlation matrix

2010-08-24 Thread rusers.sh
Great. It is more clearer for me. Thanks all. 2010/8/24 Michael Dewey > At 02:40 24/08/2010, rusers.sh wrote: > >> Hi all, >> rmvnorm()can be used to generate the random numbers from a multivariate >> normal distribution with specified means and covariance matrix, but i want >> to specify the c

[R] odd behavior of "summary" function

2010-08-24 Thread Mike Williamson
Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *51990 104000 104000 156000 207900* None of t

[R] SAMR for paired samples

2010-08-24 Thread Haesook Kim
Hi R-help, I am trying to use 'samr' for 10 pre and post paired samples to test whether post is different from pre (i.e., the location shift for the delta of (post-pre)). However, I got an error message saying > samr.obj<-samr(d, resp.type="Two class paired", nperms=100, random.seed=100) pe

Re: [R] graphing plots of plots

2010-08-24 Thread Greg Snow
In addition to the other suggestions you may also want to look at the subplot function in the TeachingDemos package (the version in Hmisc is a copy of a prior version of this one) as well as the my.symbols or panel.my.symbols functions in the same package. -- Gregory (Greg) L. Snow Ph.D. Stati

Re: [R] xylab formatting

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 12:39 PM, Jennifer Hains wrote: Dear r-help, I'm having trouble formatting xy labels for plot in r. I want to make the following y-label "benzene (mug-3)" where mu is greek and -3 is superscript and benzene is held in an array. I tried this, myname = c("benzene", "etc

Re: [R] generate random numbers from a multivariate distribution with specified correlation matrix

2010-08-24 Thread rusers.sh
BTW, can you recommend a book on statistical simulations? I want to know more on how to generate random numbers from distributions, how to generate the theoretical models,... Thanks a lot. 2010/8/24 Michael Dewey > At 02:40 24/08/2010, rusers.sh wrote: > >> Hi all, >> rmvnorm()can be used to ge

Re: [R] odd behavior of "summary" function

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:06 PM, Mike Williamson wrote: Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *51

Re: [R] multiple assignments ?

2010-08-24 Thread Bert Gunter
On Tue, Aug 24, 2010 at 8:45 AM, Maas James Dr (MED) wrote: > Thanks Bert, will have a look.  I'm originally a Fortran programmer so tend > to think in loops ... so yes expect it may be job for loops, just tried to > avoid it because several references say not to use loops in R. -- Yes, an un

[R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Chris Beeley
Hello- A basic question which has nonetheless floored me entirely. I have a dataset which looks like this: Type ID DateValue A 116/09/2020 8 A 1 23/09/2010 9 B 3 18/8/20107 B 1 13/5/20106 There are two Types, whi

[R] Using kfilter in package sspir - dimensions do not agree

2010-08-24 Thread John Dryden
I'm currently running into a little trouble with the kfilter method, and would love some clarification if you are able to offer it. When trying to run kfilter, I've been running into errors that seem to result from having mismatched dimensions. Specifically, the dimension of my observations is 2,

Re: [R] Strange space characters in character strings

2010-08-24 Thread Mark Breman
Hello J.R.M. Hosking, charToRaw() works perfectly, thank you: > charToRaw(as.character(moose[1, "V3"])) [1] 24 38 38 30 2c 33 37 30 c2 a0 gsub("[[:space:]]", "", ...) did not remove them, but now I know what they are (hex: c2 a0) I can remove them with gsub() by: > gsub("[$,\xc2\xa0]", "", as.

Re: [R] odd behavior of "summary" function

2010-08-24 Thread Erik Iverson
summary.default uses the signif function to round for display purposes. In ?summary, we can see the digits argument is used to control the value passed to signif. > lapply(1:6, function(x) summary(c(6, 207936), digits = x)) [[1]] Min. 1st Qu. MedianMean 3rd Qu.Max. 6e+00 5e+04

[R] Constrained non-linear optimisation

2010-08-24 Thread David Beacham
I'm relatively new to R, but I'm attempting to do a non-linear maximum likelihood estimation (mle) in R, with the added problem that I have a non-linear constraint. The basic problem is linear in the parameters (a_i) and has only one non-linear component, b, with the problem being linear when

Re: [R] odd behavior of "summary" function

2010-08-24 Thread Peter Ehlers
On 2010-08-24 11:06, Mike Williamson wrote: Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *5199

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:19 PM, Chris Beeley wrote: Hello- A basic question which has nonetheless floored me entirely. I have a dataset which looks like this: Type ID DateValue A 116/09/2020 8 A 1 23/09/2010 9 B 3 18/8/20107 B

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
An answer to 1) > x = data.frame(Type=c('A','A','B','B'), ID=c(1,1,3,1), Date = c('16/09/2010','23/09/2010','18/8/2010','13/5/2010'), Value=c(8,9,7,6)) > x Type ID Date Value 1A 1 16/09/2010 8 2A 1 23/09/2010 9 3B 3 18/8/2010 7 4B 1 13/5/2010 6 > x$

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
The only problem with this is that Chris's unique individuals are a combination of Type and ID, as I understand it. So Type=A, ID=1 is a different individual from Type=B,ID=1. So we need to create a unique identifier per person, simplistically by uniqueID=paste(Type, ID, sep=''). Then, using th

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:59 PM, Abhijit Dasgupta, PhD wrote: The only problem with this is that Chris's unique individuals are a combination of Type and ID, as I understand it. So Type=A, ID=1 is a different individual from Type=B,ID=1. So we need to create a unique identifier per person, sim

[R] lattice: plot alignment fails

2010-08-24 Thread Marius Hofert
Dear expeRts, I would like to have four plots appearing in one figure. The minimal example shows this. However, the four figures are not properly aligned. Why? If I comment out the scales=... arguments, then it works, but I would like to use this... :-) Cheers, Marius library(lattice) set.

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
The paste-y argument is my usual trick in these situations. I forget that tapply can take multiple ordering arguments :) Abhijit On 08/24/2010 02:17 PM, David Winsemius wrote: On Aug 24, 2010, at 1:59 PM, Abhijit Dasgupta, PhD wrote: The only problem with this is that Chris's unique individu

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread r.ookie
I have wondered this in the past too so thanks for the question. On Aug 24, 2010, at 10:11 AM, Bogaso Christofer wrote: Dear all, I was doing an experiment to disprove some theory therefore performing lot of random simulation. Goal is to show the audience that although something has very rare cha

[R] Finding pairs

2010-08-24 Thread Mike Rhodes
Dear R Helpers, I am a newbie and recently got introduced to R. I have a large database containing the names of bank branch offices along-with other details. I am into Operational Risk as envisaged by BASEL II Accord.  I am trying to express my problem and I am using only an indicative da

[R] Plot bar lines like excel

2010-08-24 Thread abotaha
Hello guys, I would to plot a bar line between to curves like in excel as shown in the following image. but i do not know how I can do that in R. http://r.789695.n4.nabble.com/file/n2337089/excel_Plot.png any help would appreciate. -- View this message in context: http://r.789695.n4.nabble

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread Ben Bolker
> On Aug 24, 2010, at 10:11 AM, Bogaso Christofer wrote: > > Dear all, I was doing an experiment to disprove some theory therefore > performing lot of random simulation. Goal is to show the audience that > although something has very rare chance to occur but it doesn't mean that > event would be

[R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Marie-Hélène Ouellette
Dear all, I'm trying to compile FORTRAN code to be used in R, failing miserably. I got a simple code function to try to figure out what is going wrong. Here is the code (available on the web) : subroutine bar(n, x) integer n double precision x(n) integer i do

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread William Dunlap
The following will attach (as an attribute) the current global value of .Random.seed to the value of the evaluated 'expr' argument. If you supply the initial.Random.seed argument then it will use that when evaluating the expression (and also attach it to the result) so you can repeat the 'unusual'

[R] Applying t-test to matrix without using a loop

2010-08-24 Thread Cedric Laczny
Hi, the actual thread on "multiple assignments ?" made up an interesting point for me. If I have a matrix with g rows and x + y columns where columns 1 - x contain values of group1 and columns x+1 to y contain the values of group2. Now I want to compute a vector of length g that holds the p-valu

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-08-24 Thread Daniel Malter
Hi, has there been a solution to this issue? I am encountering the same problem on a Mac with OSX 10.6.4. The problem persists when I try to install lme4 from the source (see below), and my R version is up to date according to R's update check. Thanks for any help, Daniel -- session

Re: [R] Plot bar lines like excel

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:40 PM, abotaha wrote: Hello guys, I would to plot a bar line between to curves like in excel as shown in the following image. but i do not know how I can do that in R. http://r.789695.n4.nabble.com/file/n2337089/excel_Plot.png any help would appreciate. ?segments

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 3:13 PM, Daniel Malter wrote: Hi, has there been a solution to this issue? I am encountering the same problem on a Mac with OSX 10.6.4. The problem persists when I try to install lme4 from the source (see below), and my R version is up to date according to R's update

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread r.ookie
Thanks for your solution, however, which values would I then provide someone else so that they can produce the same results? On Aug 24, 2010, at 12:06 PM, William Dunlap wrote: The following will attach (as an attribute) the current global value of .Random.seed to the value of the evaluated 'exp

Re: [R] Applying t-test to matrix without using a loop

2010-08-24 Thread Joshua Wiley
You can certainly use apply() #make up some data x <- 10; y <- 10; g <- 5 set.seed(1969) dat <- matrix(rnorm((x + y) * g), ncol = x + y) # apply() the t.test function to each row fo the matrix and extract just the p value results <- apply(dat, 1, function(dat) { t.test(x = dat[1:x], y = d

[R] Time and space considerations in using predict.glm()

2010-08-24 Thread Daniel Yarlett
Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single-row data frames that are generated in real-time from requests arriving at an

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread William Dunlap
> -Original Message- > From: r.ookie [mailto:r.oo...@live.com] > Sent: Tuesday, August 24, 2010 12:25 PM > To: William Dunlap > Cc: r-help@r-project.org > Subject: Re: [R] How to obtain seed after generating random number? > > Thanks for your solution, however, which values would I then

Re: [R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Peter Dalgaard
On 08/24/2010 09:01 PM, Marie-Hélène Ouellette wrote: > Dear all, > > I'm trying to compile FORTRAN code to be used in R, failing miserably. I got > a simple code function to try to figure out what is going wrong. Here is the > code (available on the web) : > > > > subroutine bar(n, x) >

[R] Sweave.sty

2010-08-24 Thread r.ookie
Does anyone know where I can download the latest version of Sweave.sty? I have looked all over the site http://www.stat.umn.edu/~charlie/Sweave/ with no luck. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] Sweave.sty

2010-08-24 Thread Matt Shotwell
Here is one: http://svn.r-project.org/R/trunk/share/texmf/tex/latex/Sweave.sty -Matt On Tue, 2010-08-24 at 15:40 -0400, r.ookie wrote: > Does anyone know where I can download the latest version of Sweave.sty? I > have looked all over the site http://www.stat.umn.edu/~charlie/Sweave/ with > no

Re: [R] Sweave.sty

2010-08-24 Thread Peter Dalgaard
On 08/24/2010 09:40 PM, r.ookie wrote: > Does anyone know where I can download the latest version of > Sweave.sty? I have looked all over the site > http://www.stat.umn.edu/~charlie/Sweave/ with no luck. I don't think there is anything newer than what is inside the latest version of R. Look under

Re: [R] drop unused levels in lattice dotplot axis?

2010-08-24 Thread Dennis Murphy
Hi: This looks to be a step in the right direction, but the resulting panels are all the same size. Perhaps you can build on it... # Solution based on an R-help post by Deepayan Sarkar: # http://tolstoy.newcastle.edu.au/R/e2/help/06/09/1579.html dotplot(A ~ B | C, data=dfr, scales=list(y=list(re

Re: [R] Sweave.sty

2010-08-24 Thread Gavin Simpson
On Tue, 2010-08-24 at 12:40 -0700, r.ookie wrote: > Does anyone know where I can download the latest version of > Sweave.sty? I have looked all over the site > http://www.stat.umn.edu/~charlie/Sweave/ with no luck. It is provided in the R sources as Sweave is an integrated part of R. You can get i

[R] break the long R code lines automatically

2010-08-24 Thread heyi xiao
Dear all, I have written some R source program with many thousands of lines. I didn’t insert line breaks automatically or manually for the long lines. But now I would like to edit the source code in Emacs/ESS to make it more formal as a package. One of the major problems here is how to break

[R] Time and space considerations in using predict.glm.

2010-08-24 Thread Daniel Yarlett
Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single-row data frames that are generated in real-time from requests arriving at an

[R] Fwd: [R-sig-hpc] Holtman's levelplot ?

2010-08-24 Thread Michel Lutz
Hello, As recommended by N. Gunther, I'm writing you because I have some difficulties to create a script to track computer performance, as done in Holtman, 2005 (Visualization techniques for analysing patterns in system performance). I would like to do a leveplot, with the kind of file here enclo

[R] help with summary.lm aliased

2010-08-24 Thread Yasir
Dear R users, I'm building linear models that use poly and has a lot of product terms. My model summaries look messy. I know that the summary could use aliases for the variable names, but I don't know how to get it to do that. Please help Thanks, -- View this message in context: http://r.789695.

[R] Trouble configuring R to use ACML

2010-08-24 Thread szembek
I am trying to get R to use the ACML BLAS, specifically the 'mp' version for multithreading. I have installed acml-4-4-0-gfortran-64bit I added /opt/acml4.4.0/gfortran64_mp/lib to $LD_LIBRARY_PATH. I ran: sudo ./configure --with-blas="-L/opt/acml4.4.0/gfortran64_mp/lib -lacml_mp" At the end

  1   2   >