Re: [R] Latin Hypercube with condition sum = 1

2008-11-24 Thread Rainer M Krug
On Sun, Nov 23, 2008 at 8:06 PM, Ben Bolker [EMAIL PROTECTED] wrote: In that case won't x2 - (x-min(x))/(max(x)-min(x)) ## establishes criterion 1 That one is not needed, as the range is automatically between 0 and 1: min(ws) [1] 6.925322e-05 max(ws) [1] 0.284 so that is fine. but when I

[R] Check for date variable in a arbitrary dataset

2008-11-24 Thread Harsh
Hello, This is my first time posting to the R-help list and I apologize for the apparent triviality of my query. I am creating an R script to create Univariate Exploratory Analysis of a input dataset (No meta-data to provide extra information about each column) . Providing summary statistics is

Re: [R] count the cumulative for each subject

2008-11-24 Thread bartjoosen
How about: tapply(dat$x1,dat$subject,function(x) cumsum(x)) which gives you a list for each subject. this can be converted to a vector: do.call(c,tapply(dat$x1,dat$subject,function(x) cumsum(x))) So if your data frame is ordered for your subjects:

[R] select a subset

2008-11-24 Thread gallon li
I have the complete data like id time censor 1 10 0 1 20 0 1 30 0 2 10 0 2 20 1 2 30 0 2 40 0 3 10 0 3 20 0 3 30 1 for id 1, i want to select the last row since all censor indicator is 0; for id 2, i want to select the row where censor ==1; for id 3, i also want to select the row where

[R] Timer

2008-11-24 Thread jaey.ahn
Hi, is there any function or package for timer? What I inted to do is to run procedure(/or function) every x seconds. (x 10 seconds) for instance, visual basic provides : application.onTime method. Rather than utilizing loop, I want to know whether R provides superior solution with time

Re: [R] Nested Clade Analysis

2008-11-24 Thread Christoph Heibl
Hi, to my knowledge there is none, but some time ago I wrote some code that prepares the input files for GeoDis and reads the output. Doing a NCA was a matter of seconds! I did not go on developing it, though, because I do not use NCA any more and the current code is very poorly

Re: [R] Timer

2008-11-24 Thread Gerhard Schön
have a look at ?txtProgressBar. cheers, Gerhard Schön Hi, is there any function or package for timer? What I inted to do is to run procedure(/or function) every x seconds. (x 10 seconds) for instance, visual basic provides : application.onTime method. Rather than utilizing loop, I want to

Re: [R] Fitting a model

2008-11-24 Thread Dani Valverde
Sorry, I had no seen your previous e-mail. Just another question. Is there any way to obtain an R2 to have a numeric idea of how good is the fitting? Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barcelona Edifici V, Campus

[R] Rs: How to measure the significant difference between two time series

2008-11-24 Thread Bin Zhao
Dear R experts and statisticians, I have some time series datasets, they are several years vegetation indices (about 50 data points per year) sampled from different station. These indices have similar dynamics with seasonal change. My questions are, 1) How can I compare the difference

Re: [R] Bug in Kendall for n4?

2008-11-24 Thread Martin Maechler
Dear Ian, thanks a lot for your clarifications. AIM == A I McLeod [EMAIL PROTECTED] on Sat, 22 Nov 2008 22:24:11 -0500 (EST) writes: AIM The package Kendall computes the p-value when there are AIM ties in one ranking. This often happens with trend AIM testing with

[R] optimization problem

2008-11-24 Thread Jiang Peng
Dear list, hi ! I am a R beginner and I have a function to optimize . alpha = argmin{ f(x,alpha) } I want alpha to be in [0,1]. Is there any function that can work? I use nlm() but i can't fix the domain of alpha. thanks in advance ___ Jiang Peng, Ph.D.

Re: [R] ggplot2 - facet_grid and facet_wrap

2008-11-24 Thread David Hajage
Thank you Hadley. I've just discovered an another bug (perhaps ?) : qplot(mpg, wt, data=mtcars)# works qplot(mpg, wt, data=mtcars, geom = line) # works qplot(mpg, wt, data=mtcars) + facet_grid(cyl ~ vs) # works qplot(mpg, wt, data=mtcars, geom = line) + facet_grid(cyl ~ vs) Erreur dans

[R] chooseCRANmirror

2008-11-24 Thread Molinari, Luciano
Dear List: I just successfully installed R 2.8.0 (under Windows XP SP2, 1GB RAM) and wanted to run update.packages. When I first called chooseCRANmirror I obtained the following error message: chooseCRANmirror() Warning message: In open.connection(con, r) : kann nicht mit

Re: [R] select a subset

2008-11-24 Thread Stefan Grosse
gallon li schrieb: for id 1, i want to select the last row since all censor indicator is 0; for id 2, i want to select the row where censor ==1; for id 3, i also want to select the row where censor==1. So if there is a 1 for censor, then I want to select such a row, otherwise I want to select

Re: [R] Check for date variable in a arbitrary dataset

2008-11-24 Thread Gabor Grothendieck
The classes of the columns are: sapply(DF, class) On Mon, Nov 24, 2008 at 3:39 AM, Harsh [EMAIL PROTECTED] wrote: Hello, This is my first time posting to the R-help list and I apologize for the apparent triviality of my query. I am creating an R script to create Univariate Exploratory

Re: [R] Discrepancy in the PBC data set

2008-11-24 Thread Terry Therneau
The data set in R is wrong. I've found mistakes on 2 lines in a quick look. I don't know if the data is incorrect in the Appendix of Fleming and Harrington as well (someone seems to have borrowed my copy), which is where the data set appears to have been taken from, given all the -9

Re: [R] ggplot2 - facet_grid and facet_wrap

2008-11-24 Thread hadley wickham
Thanks - I'll add it to my to do list. Hadley On Mon, Nov 24, 2008 at 5:43 AM, David Hajage [EMAIL PROTECTED] wrote: Thank you Hadley. I've just discovered an another bug (perhaps ?) : qplot(mpg, wt, data=mtcars)# works qplot(mpg, wt, data=mtcars, geom = line) # works qplot(mpg, wt,

Re: [R] How is R working in multicore and multiprocessor environment?

2008-11-24 Thread Uwe Ligges
Hesen Peng wrote: My Dear R buddies, I'm feeling ashamed that I've been running my R program on some servers for a while but do not know exactly how R is working. The servers are chained together using Sun Grid Engine. Each node has 8 quad-core CPUs. I wonder how many cores and CPUs are used

Re: [R] optimization problem

2008-11-24 Thread Jagat.K.Sheth
On the help page for nlm (type ?nlm) check out the 'See Also' section. It mentions other functions such as 'optim' and 'nlminb' which can do constrained optimizations. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jiang Peng Sent: Monday, November 24,

Re: [R] optimization problem

2008-11-24 Thread Ravi Varadhan
Is this the actual problem that you are trying to optimize, i.e. optimize a function with respect to a scalar unknown parameter? If so, just use optimize and specify the search interval for the algorithm as [0,1]. Ravi.

Re: [R] Discrepancy in the PBC data set

2008-11-24 Thread Ravi Varadhan
Dear Terry, Thank you very much for taking your time to address this problem! I did check the data in FH. I couldn't detect any differences between the R data set and the one in the Appendix. The preface in FH acknowledges that the data set was obtained from Roland Dickinson. Is the data

[R] 64bit R for Mac

2008-11-24 Thread Blanchette, Marco
Dear R gurus, On the CRAN website, it says that a 64bit version for Mac OS Tiger would be release shortly. Do we know what are the expected dates? Will the packages be also compiled for 64bit? We are running large microarray analysis and we keep hitting the 3Gb memory limit. I saw that there

Re: [R] count the cumulative for each subject

2008-11-24 Thread Peter Dalgaard
bartjoosen wrote: How about: tapply(dat$x1,dat$subject,function(x) cumsum(x)) which gives you a list for each subject. this can be converted to a vector: do.call(c,tapply(dat$x1,dat$subject,function(x) cumsum(x))) So if your data frame is ordered for your subjects:

[R] Problem with Rmpi and snow - makeCluster(type=MPI) not working

2008-11-24 Thread Rainer M Krug
Hi I managed tio install Rmpi and to load it, but I get the following errormessage when I try to create an MPI cluster and R hangs (no response): library(Rmpi) [head001:15781] mca: base: component_find: unable to open osc pt2pt: file not found (ignored) library(snow) cl - makeCluster(2, type =

Re: [R] Problem with Rmpi and snow - makeCluster(type=MPI) not working

2008-11-24 Thread Rainer M Krug
Sorry - posting reposted at R-sig-hpc Rainer On Mon, Nov 24, 2008 at 4:45 PM, Rainer M Krug [EMAIL PROTECTED] wrote: Hi I managed tio install Rmpi and to load it, but I get the following errormessage when I try to create an MPI cluster and R hangs (no response): library(Rmpi)

Re: [R] Is this correct?

2008-11-24 Thread John Kane
You need to do the homework yourself. What is correct depends on what the data says,(and what exactly the prof wants). :) The best idea probably is to decide yourself on what you want to present and write a rationale as to why you chose this analysis. More generally there is a lot of good

Re: [R] More than doubling performance with snow

2008-11-24 Thread Hesen Peng
-- Forwarded message -- From: Hesen Peng [EMAIL PROTECTED] Date: Mon, Nov 24, 2008 at 9:28 AM Subject: Re: [R] More than doubling performance with snow To: Prof Brian Ripley [EMAIL PROTECTED] I'm sorry but I don't quite understand what not running solve() in this process means. I

[R] Calculating sum of letter values

2008-11-24 Thread Rory.WINSTON
Hi all If I have a string, say ABCDA, and I want to convert this to the sum of the letter values, e.g. A - 1 B - 2 etc, so ABCDA = 1+2+3+4+1 = 11 Is there an elegant way to do this? Trying something like which(LETTERS %in% unlist(strsplit(ABCDA, ))) is not quite correct, as it does not

Re: [R] Calculating sum of letter values

2008-11-24 Thread Marc Schwartz
on 11/24/2008 08:57 AM [EMAIL PROTECTED] wrote: Hi all If I have a string, say ABCDA, and I want to convert this to the sum of the letter values, e.g. A - 1 B - 2 etc, so ABCDA = 1+2+3+4+1 = 11 Is there an elegant way to do this? Trying something like which(LETTERS %in%

Re: [R] More than doubling performance with snow

2008-11-24 Thread Stefan Evert
I'm sorry but I don't quite understand what not running solve() in this process means. I updated the code and it do show that the result from clusterApply() are identical with the result from lapply(). Could you please explain more about this? The point is that a parallel processing framework

Re: [R] Calculating sum of letter values

2008-11-24 Thread Rory.WINSTON
Hi Mark Thanks, that's almost exactly what I need...theres just a slight difference with my requirement, in that I am looking for the actual index value in the alphabetical sequence, so that instead of: as.numeric(factor(unlist(strsplit(XYZ, [1] 1 2 3 I would expect to see [1] 24 25 26

Re: [R] Calculating sum of letter values

2008-11-24 Thread Gabor Grothendieck
Here are a couple of solutions. The first matches each character against LETTERS returning the position number in LETTERS of the match. strsplit returns a list of which we want the first element and then we sum that. The second applies function(x) match(x, LETTERS), which is specified in

Re: [R] Calculating sum of letter values

2008-11-24 Thread Jagat.K.Sheth
You can use Mark's code by giving levels to the factor, e.g. as.numeric(factor(unlist(strsplit(ABCDAXYZ, )), levels=LETTERS)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, November 24, 2008 9:15 AM To: [EMAIL

Re: [R] Calculating sum of letter values

2008-11-24 Thread Richard . Cotton
Thanks, that's almost exactly what I need...theres just a slight difference with my requirement, in that I am looking for the actual index value in the alphabetical sequence, so that instead of: as.numeric(factor(unlist(strsplit(XYZ, [1] 1 2 3 I would expect to see [1] 24 25 26

Re: [R] Calculating sum of letter values

2008-11-24 Thread Marc Schwartz
Yep, my error...it should be: as.numeric(factor(unlist(strsplit(ABCDA, )), levels = LETTERS)) [1] 1 2 3 4 1 as.numeric(factor(unlist(strsplit(XYZ, )), levels = LETTERS)) [1] 24 25 26 The step that I missed was setting the factor levels to the full set of LETTERS. HTH, Marc on 11/24/2008

Re: [R] Calculating sum of letter values

2008-11-24 Thread Stefan Evert
Thanks, that's almost exactly what I need...theres just a slight difference with my requirement, in that I am looking for the actual index value in the alphabetical sequence, so that instead of: as.numeric(factor(unlist(strsplit(XYZ, [1] 1 2 3 I would expect to see [1] 24 25 26

Re: [R] Calculating sum of letter values

2008-11-24 Thread Rory.WINSTON
Thanks a lot for the solutions everyone...really appreciated. Cheers Rory Rory Winston RBS Global Banking Markets Office: +44 20 7085 4476 -Original Message- From: Marc Schwartz [mailto:[EMAIL PROTECTED] Sent: 24 November 2008 15:24 To: WINSTON, Rory, GBM Cc: r-help@r-project.org

Re: [R] Calculating sum of letter values

2008-11-24 Thread Berwin A Turlach
G'day Rory, On Mon, 24 Nov 2008 14:57:57 + [EMAIL PROTECTED] wrote: If I have a string, say ABCDA, and I want to convert this to the sum of the letter values, e.g. A - 1 B - 2 etc, so ABCDA = 1+2+3+4+1 = 11 Is there an elegant way to do this? [...] R

Re: [R] Timer

2008-11-24 Thread Tony Breyal
Hi Jaey, I asked a similar type of question last month, maybe it might be helpful to you: https://stat.ethz.ch/pipermail/r-help/2008-October/176645.html Warm Regards, Tony Breyal On 24 Nov, 08:21, jaey.ahn [EMAIL PROTECTED] wrote: Hi, is there any function or package for timer? What I inted

[R] Manhattan Plots for GWA studies

2008-11-24 Thread Will
Hi! I want to create manhattan plots for genome-wide association studies (-log(p) ~ SNPs). I wonder whether there is a recommended approach avoiding the problems I have with the functions named below Im my data I have only significant SNPs for dozens of similar phenotypes using different

[R] spatial subset of ncdf

2008-11-24 Thread ole_roessler
dear I was lokking for a solution or an example on the internet for quite a time but since haven´t found an answer yet, I'd like to ask a maybe to simple question: I have a large ncdf-file with five dimension. temperature (t2m), the variable against, lat, lon and time. (height is included as

[R] chooseCRANmirror

2008-11-24 Thread Molinari, Luciano
Dear List: I just successfully installed R 2.8.0 (under Windows XP SP2, 1GB RAM) and wanted to run update.packages. When I first called chooseCRANmirror I obtained the following error message: chooseCRANmirror() Warning message: In open.connection(con, r) : kann nicht mit

[R] Help With Permutations

2008-11-24 Thread Mulazzani Fabio (Student Com06)
I have a problem with permutations functions in R I just started using R so maybe it is an easy question I need to obtain all the 9.somthingExp 157 permutations that can be given from the number from 1 to 100 I wrote the following commands: library(gregmisc) options(expressions=1e5)

[R] correlated predictors in lr

2008-11-24 Thread Raynaud, Scott
I have Q3 sales for consecutive years 2002-2007 that I'm using to predict buying (yes/no) in Q3 in 2008. My data are arranged in counting process format where each customer has 6 rows of data, one for each year. However, there is no variability within the strata at the customer level: if someone

Re: [R] Saving color2D.matplot plots to a file

2008-11-24 Thread Garcia Carreras, Bernardo
Hi, I found the solution to the issue of saving plots from color2D.matplot to a file by using savePlot (to save to jpeg or png). Furthermore my previous post was incomplete: the system used is MS Win XP, R v2.8.0. Thanks, Bernardo Garcia Carreras __

[R] matching matrix columns to a vector

2008-11-24 Thread Salas, Andria Kay
I need help with (hopefully) just one more thing. I have been fussing with this for quite some time and have decided just to give up and ask! I want to match a column in a matrix to a vector. I found a which command that I thought would be helpful as it does the following: g=c(1,5,3,2,7)

[R] basehaz error?

2008-11-24 Thread Powers, Daniel A
R-users-- I am wondering if the cumulative hazard is being correctly computed when evaluated using centered=FALSE. In the bazehaz code (from the survival package) (below), I think H - H * exp(-bz0) should be H - H * exp(bz0) function (fit, centered = TRUE) { if (!inherits(fit,

[R] lattice contourplot background covers inward-facing ticks

2008-11-24 Thread Seth W Bigelow
I wish to have inward-pointing ticks on my contourplot graph, but the colored background produced by the region=TRUE statement covers the ticks up, is there any way around this? Sample code below. --Seth library(lattice) model - function(a,b,c,d,e, f, X1,X2) # provide model function

Re: [R] syntax and package for generalized linear mixed models

2008-11-24 Thread Jeff Evans
Thanks Doug, I appreciate your response. I'm not a statistician and didn't realize this limitation of the distribution and model I chose. This may be getting beyond the scope of this help list, but I'll try anyway: If the variance of the response variable (survival) is, in fact, a function of a

Re: [R] Help With Permutations

2008-11-24 Thread Ted Harding
On 24-Nov-08 13:36:31, Mulazzani Fabio (Student Com06) wrote: I have a problem with permutations functions in R I just started using R so maybe it is an easy question I need to obtain all the 9.somthingExp 157 permutations that can be given from the number from 1 to 100 I wrote the

Re: [R] Help With Permutations

2008-11-24 Thread Stefan Grosse
To an adequate approximation there are 10^158 of them. Simply to obtain them all (at a rate of 10^10 per second, which is faster than the CPU frequency of most desktop computers) would take 10^148 seconds, or slightly longer than 3*(10^140) years. Current estimates of the age of the

Re: [R] matching matrix columns to a vector

2008-11-24 Thread Jagat.K.Sheth
How about which(colSums(t-v) == 0) ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Salas, Andria Kay Sent: Monday, November 24, 2008 10:04 AM To: r-help@r-project.org Subject: [R] matching matrix columns to a vector I need help with (hopefully) just

[R] lme4 and false convergence

2008-11-24 Thread Ben Zuckerberg
Dear R-users, I am using the most updated package of lme4 (lme4_0.999375-2). I have a data set consisting of ~900 observations at ~440 independent survey sites. There are an unbalanced number of surveys at each site. I am attempting to develop several models evaluating the presence/absence

[R] how to test for the empty set

2008-11-24 Thread G. Jay Kerns
Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets depending on the vector's mode, namely, numeric(0), character(0), logical(0), etc. This is borne out by y - letters[1:3] z -

Re: [R] More than doubling performance with snow

2008-11-24 Thread Markus Schmidberger
Hi, there is a new mailing list for R and HPC: [EMAIL PROTECTED] This is probably a better list for this question. Do not forget, first of all you have to register: https://stat.ethz.ch/mailman/listinfo/r-sig-hpc In this case the communication overhead is the problem. The data / matrix is to

[R] printing help files directly from R prompt

2008-11-24 Thread Faheem Mitha
Hi, Does anyone know how to print help files from R's prompt? One can read the help text for read.table by doing ?read.table on the R prompt. In a similar fashion, can I print the help read.table without having to resort to a web browser? Please CC me on any reply.

[R] Help reading installed packages in Vista

2008-11-24 Thread Manuel
Hello. After run, installed.packages() the following error arose: Error in gzfile(file, mode) : cannot open the connection In addition: Warning message: In gzfile(file, mode) : cannot open compressed file

Re: [R] Help reading installed packages in Vista

2008-11-24 Thread Gabor Grothendieck
Just a guess but try right clicking the R icon on your desktop, choose Run As Administrator and then in that session issue your install.packages commands. On Mon, Nov 24, 2008 at 12:30 PM, Manuel [EMAIL PROTECTED] wrote: Hello. After run, installed.packages() the following error arose:

[R] ggplot2: positioning legend on top of plot

2008-11-24 Thread Paul Emberson
Hi, With ggplot2 v0.8, how do I position a legend on top of the plot. Things like p + opts(legend.position=top) work ok. But p + opts(legend.position=c(0.5,0.5)) gives Error in as.character(x) : cannot coerce type 'closure' to vector of type 'character' so obviously I should be giving

Re: [R] how to test for the empty set

2008-11-24 Thread G. Jay Kerns
Dear Steven, length(x) Does this cover all your use cases? Yes, and thanks again to everybody else who later replied. I had falsely imagined something so much more complicated...!? Next time, I will wait 8*runif(1) before posting. :-) Best, Jay HTH Steven McKinney Statistician

Re: [R] 64bit R for Mac

2008-11-24 Thread Steven McKinney
(Apologies if this repost is a duplicate, my first submission did not appear to make it through.) -Original Message- From: Steven McKinney Sent: Mon 11/24/2008 4:28 PM To: 'Blanchette, Marco'; R-help Subject: RE: [R] 64bit R for Mac Dear Marco Check out http://r.research.att.com/ and

Re: [R] how to test for the empty set

2008-11-24 Thread Steven McKinney
Dear Jay, length(x) will return zero for all these (vector) examples, and is quite readable in code. (You might have seen code such as if(length(x)) { blah } which uses this idea.) Does this cover all your use cases? x - c() class(x) [1] NULL length(x) [1] 0 y - letters[1:3] z -

[R] unsupervised dimensionality reduction retaining the attributes

2008-11-24 Thread Rainer Tischler
Dear all, I'm looking for an unsupervised dimensionality reduction method for large-scale data sets ( 40.000 attributes) which retains the original attribute vectors (i.e. unsupervised feature selection). Until now I have only found several unsupervised dimensionality reduction methods which

Re: [R] how to test for the empty set

2008-11-24 Thread Charles C. Berry
?length Chuck On Mon, 24 Nov 2008, G. Jay Kerns wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets depending on the vector's mode, namely, numeric(0),

Re: [R] 64bit R for Mac

2008-11-24 Thread Steven McKinney
Dear Marco Check out http://r.research.att.com/ and see if the R 2.8.0 Patched (2008-11-21)tiger R-2.8-branch-n.dmg works for you (n = 47002 at this writing - changes every now and then). I'm no longer running Tiger so haven't tried this directly, but the Leopard version is

Re: [R] how to test for the empty set

2008-11-24 Thread Henrik Bengtsson
length() /Henrik On Mon, Nov 24, 2008 at 9:41 AM, G. Jay Kerns [EMAIL PROTECTED] wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets depending on the vector's mode,

Re: [R] count the cumulative for each subject

2008-11-24 Thread Bart Joosen
Peter, After I made a small modification it worked: with(dat, ave(x1, subject, FUN=cumsum)) But what's the use of with? If I use ave(x1, subject, FUN=cumsum), I get the same result? Bart - Original Message - From: Bart Joosen [EMAIL PROTECTED] To: Peter Dalgaard [EMAIL PROTECTED]

[R] dataframe help

2008-11-24 Thread Rajasekaramya
hi there I have a dataframe abc 123 345 abc 345 456 lmn 567 345 hkl 568 535 lmn 096 456 lmn 768 094 i want the uniques of column 1 and there corresponsing column 2 and 3 output abc 123 345 lmn 567 345 hkl 568 535 cbind(DF1[,1],DF1[which(unique(DF1[,1]),c(2,3)]) but didnt work kindly let

Re: [R] tklistbox - R-Objekt

2008-11-24 Thread Greg Snow
This is safest if the below code is wrapped in another function. At the top level function (or whatever level you will be using your choice information at) first create the variable named choice with a default value (choice - ). In your OnOk function, change choice- to choice-, this will make

Re: [R] how to test for the empty set

2008-11-24 Thread G. Jay Kerns
Dear Everybody, Thanks, length() is the answer. Best, Jay On Mon, Nov 24, 2008 at 1:15 PM, Ted Harding [EMAIL PROTECTED] wrote: On 24-Nov-08 17:41:25, G. Jay Kerns wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation

[R] rgdal and spgrass6

2008-11-24 Thread Thybério Luna Freire
Hi, i'm trying to install the packages rgdal and spgrass6 by install.packages but i receive always this message: ERROR: configuration failed for package 'rgdal' ** Removing '/home/thyberio/R/i486-pc-linux-gnu-library/2.7/rgdal' ** Restoring previous

Re: [R] ggplot2: positioning legend on top of plot

2008-11-24 Thread hadley wickham
Hi Paul, That's a bug - I'll look into it. Regards, Hadley On Mon, Nov 24, 2008 at 10:46 AM, Paul Emberson [EMAIL PROTECTED] wrote: Hi, With ggplot2 v0.8, how do I position a legend on top of the plot. Things like p + opts(legend.position=top) work ok. But p +

Re: [R] how to test for the empty set

2008-11-24 Thread Stefan Evert
all.equal(x, character(0)) # TRUE This would seem to be the solution, but am I missing something? and in particular, is there an elegant way to check in the case that the mode of the vector is not already known? If you do not care about the mode of the vector, wouldn't simply

Re: [R] Calculating sum of letter values

2008-11-24 Thread William Dunlap
Rory Winston wrote: I have got it to work in a fairly non-elegant manner, using the following code: sum ( unlist(lapply(strsplit(TESTING,), function(x) match(x,LETTERS) )) ) And over a list of names, this becomes: lapply(namelist, function(Z) { sum ( unlist(lapply(strsplit(Z,),

Re: [R] count the cumulative for each subject

2008-11-24 Thread Bart Joosen
Peter, I actually took a look at the ave function, but couldn't manage to get it right. But when I try your code, I get Error in as.vector(x, mode) : invalid argument 'mode'. Any ideas? Bart - Original Message - From: Peter Dalgaard [EMAIL PROTECTED] To: bartjoosen [EMAIL

Re: [R] matching matrix columns to a vector

2008-11-24 Thread David Winsemius
Consider: apply(t,2,function(x)identical(x,v)) [1] TRUE FALSE FALSE FALSE apply(t,2,function(x)identical(x,v))+0 [1] 1 0 0 0 and if you wanted to get the position you could use which: which(apply(t,2,function(x)identical(x,v))) [1] 1 t[,4] - v which(apply(t,2,function(x)identical(x,v)))

Re: [R] matching matrix columns to a vector

2008-11-24 Thread Marc Schwartz
on 11/24/2008 10:03 AM Salas, Andria Kay wrote: I need help with (hopefully) just one more thing. I have been fussing with this for quite some time and have decided just to give up and ask! I want to match a column in a matrix to a vector. I found a which command that I thought would be

Re: [R] Help With Permutations

2008-11-24 Thread jim holtman
You can also add to the fortune is that there are approximately 10^24 grains of sands on the earth. If every one could store a permutation, you are still way short of the storage that you would need. On Mon, Nov 24, 2008 at 12:01 PM, Stefan Grosse [EMAIL PROTECTED] wrote: To an adequate

Re: [R] lattice contourplot background covers inward-facing ticks

2008-11-24 Thread baptiste auguie
I believe you can simply modify the panel function to replot the axes on top with panel.axis(), library(lattice) model - function(a,b,c,d,e, f, X1,X2) # provide model function # for contour plot {J - a + (b*X1) + (c*X2) + (d*X1*X2) + e*(X1^2) + f*(X2^2) pp - exp(J)/(1+exp(J))

[R] Data frame help

2008-11-24 Thread Rajasekaramya
hi there I have a dataframe abc 123 234 abc 234 456 def 567 234 elm 123 456 klm 234 678 klm 465 678 I want the unique of first colum along with the values in colum 2 and 3.I By default it will select the first element for the unique so my out put should be abc 123 234 def 567 234 elm 123 456

[R] dataframe

2008-11-24 Thread Rajasekaramya
hi there I have a dataframe abc 123 345 abc 345 456 lmn 567 345 hkl 568 535 lmn 096 456 lmn 768 094 i want the uniques of column 1 and there corresponsing column 2 and 3 output abc 123 345 lmn 567 345 hkl 568 535 cbind(DF1[,1],DF1[which(unique(DF1[,1]),c(2,3)]) but didnt work kindly let

[R] web error message

2008-11-24 Thread Faheem Mitha
Hi, I'm getting an error from http://stat.ethz.ch/R-manual/ linked from http://www.r-project.org/ as follows ** Forbidden You don't have permission to access /R-manual/ on this server. Additionally, a 403 Forbidden

Re: [R] how to test for the empty set

2008-11-24 Thread Ted Harding
On 24-Nov-08 17:41:25, G. Jay Kerns wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets depending on the vector's mode, namely, numeric(0), character(0), logical(0),

Re: [R] matching matrix columns to a vector

2008-11-24 Thread David Winsemius
Since negative values could balance positives, you might need to use: which(colSums(abs(t-v)) == 0) t=matrix(1:12,3,4) v=c(1,2,3) which(colSums(t-v) == 0) [1] 1 t [,1] [,2] [,3] [,4] [1,]147 10 [2,]258 11 [3,]369 12 t[1,2] - -5

Re: [R] how to test for the empty set

2008-11-24 Thread Patrick Burns
You seem to want: length(x) == 0 Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) G. Jay Kerns wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the

[R] weighted ftable

2008-11-24 Thread Andrew Choens
I need to do some fairly deep tables, and ftable() offers most of what I need, except for the weighting. With smaller samples, I've just used replicate to let me have a weighted data set, but with this data set, I'm afraid replicate is going to make my data set too big for R to handle comfortably.

[R] plot Principal Components axes on original data

2008-11-24 Thread Gareth Campbell
Hello I'm writing an example PCA analysis for some students. I've done PCA on a 2-column matrix to show it at the most simple form (a rotation of two axes). I can't, however, figure out how to plot the rotated axes as lines over top of the original data plotted on the x-y. Does anyone know how

Re: [R] how to test for the empty set

2008-11-24 Thread Stavros Macrakis
Doesn't length(x)=0 do the trick? In general, the cardinality of a set represented as a vector or list of elements is length(unique(x)). Unique uses `identical` as its equivalence relation, so length( unique( list( 1L, 1.0, 1+0i, as.logical(NA), as.character(NA), as.numeric(NA), NULL,

[R] Estimating the standard error when you have sampling weights.

2008-11-24 Thread Robert Wilkins
Hi, Where can I find information ( freely available on the Internet , and also books or other sources ) on how having sampling weights changes the calculation of the standard error (of means and proportions)? How good is R for this type of procedure? And SAS? thanks Robert

[R] increasing memory limit in Windows Server 2008 64-bit

2008-11-24 Thread Michael Styer
Hello, I'm working with a very large dataset in R on a computer running 64-bit Windows Server 2008 Standard with 32GB of RAM. According to the R for Windows FAQ, the maximum value allowed for max-mem-size is 4095MB. Is it possible to run R with a higher memory limit on this system? I've tried

Re: [R] count the cumulative for each subject

2008-11-24 Thread Peter Dalgaard
Bart Joosen wrote: Peter, After I made a small modification it worked: with(dat, ave(x1, subject, FUN=cumsum)) Right. I forgot that it doesn't follow the pattern of tapply. (If someone could cook up a more evokative name than ave, we could change this at the same time. grapply() perhaps? or

Re: [R] how to test for the empty set

2008-11-24 Thread Duncan Murdoch
On 24/11/2008 12:41 PM, G. Jay Kerns wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets depending on the vector's mode, namely, numeric(0), character(0), logical(0), etc.

Re: [R] matching matrix columns to a vector

2008-11-24 Thread jim holtman
You can use the arr.ind option of which: t=matrix(1:12,3,4) v=c(1,2,3) t [,1] [,2] [,3] [,4] [1,]147 10 [2,]258 11 [3,]369 12 result - sapply(v, function(x) which(t == x, arr.ind=TRUE)) colnames(result) - v result 1 2 3 # 'v' [1,] 1 2

Re: [R] matching matrix columns to a vector

2008-11-24 Thread Dan Davison
Jagat.K.Sheth wrote: How about which(colSums(t-v) == 0) ? But what about v=c(2,1,3)? It needs to be something like which(colSums((t - v)^2)) == 0 or which(colSums(abs(t - v))) == 0 Dan Jagat.K.Sheth wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] how to test for the empty set

2008-11-24 Thread jim holtman
Try length: x - c() x NULL length(x) [1] 0 On Mon, Nov 24, 2008 at 12:41 PM, G. Jay Kerns [EMAIL PROTECTED] wrote: Dear R-help, I first thought that the empty set (for a vector) would be NULL. x - c() x However, the documentation seems to make clear that there _many_ empty sets

Re: [R] how to test for the empty set

2008-11-24 Thread Daniel Malter
Hi, any empty set has (or should have) length 0. y - letters[1:3] z - letters[4:6] length(intersect(y,z)) Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag

Re: [R] matching matrix columns to a vector

2008-11-24 Thread Dan Davison
Dan Davison wrote: Jagat.K.Sheth wrote: How about which(colSums(t-v) == 0) ? But what about v=c(2,1,3)? It needs to be something like which(colSums((t - v)^2)) == 0 or which(colSums(abs(t - v))) == 0 Sorry, apparently I tried to write a line of R code without using emacs.

Re: [R] matching matrix columns to a vector

2008-11-24 Thread Jagat.K.Sheth
Yes! my oversight ... thank you -Original Message- From: David Winsemius [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2008 11:48 AM To: Sheth, Jagat K Cc: [EMAIL PROTECTED]; r-help@r-project.org Subject: Re: [R] matching matrix columns to a vector Since negative values could

Re: [R] Check for date variable in a arbitrary dataset

2008-11-24 Thread Harsh
Thank you Gabor for your prompt reply. I had tried checking for class, but it returns three types of my dataset, which are numeric, integer and character. The problem with that is, I need to classify some columns as categorical and in doing so I have a cut off of 100 or less unique values in the

[R] Compiling R for 64-bit Windows (was Re: increasing memory limit in Windows Server 2008 64-bit)

2008-11-24 Thread Michael Styer
I did some more research and I think I've answered my own question. So my next question is, does anyone have any thoughts about how significant a project it would be to compile R for 64-bit windows (using, e.g., the Portland Group compiler)? How much of the code would need to be changed to

  1   2   >