[R] Singly ordered contingency tables with lbl_test (coin)

2009-01-18 Thread LE PAPE Gilles
Hi all, is it possible to perform a linear-by-linear association test (lbl_test, package coin) for a SINGLY ordered table ? And, if yes, how to manage the scores ? Thanks in advance Gilles - France [[alternative HTML version deleted]] __

[R] How to get Communication matrix ?

2009-01-18 Thread RON70
A communication matrix K is such that : K * VEC(A) = VEC(transpose of A). Is there any readily available R function to find that Communication matrix? Thanks -- View this message in context: http://www.nabble.com/How-to-get-%22Communication-matrix%22---tp21525220p21525220.html Sent from the R

Re: [R] distance between plot-region and main-title / saving plot as pdf

2009-01-18 Thread Prof Brian Ripley
On Sun, 18 Jan 2009, Jörg Groß wrote: Hi, is there a way to increase the distance beween the plot (or plot-region) and the main-title? I haven't found anything via ?par(). Well then, you need to look again: you want a bigger margin, so look for mar and mai. Once you have increaed teh

[R] using virtual memory in R

2009-01-18 Thread Vishwa Goudar
Hi, Im using R-2.8.1 on windows vista and have 4GB RAM. Im trying to run LDA from the MASS package on a fairly large dataset and keep running out of memory (Cannot allocate vector of size ...) Ive tried freeing up as much memory as possible with gc(). I tried using the ff package but that would

[R] System with manual options

2009-01-18 Thread Hadassa Brunschwig
Hi I was wondering if there was a way to run system when there is e.g. a C program which is not totally command-line driven. That is, I have a C program which requires manual input of options into the shell during the run. I would like to run this program from R and as far as I have seen system()

Re: [R] select observations from longitudinal data set

2009-01-18 Thread Dimitris Rizopoulos
one way is the following: dat - read.table(textConnection(id time y 1 1 10 1 2 12 1 3 15 1 6 18 2 1 8 2 3 9 2 4 11 2 5 12 3 1 8 3 4 16 4 1 9 4 5 13 5 1 7 5 2 9 5 6 11), header = TRUE) closeAllConnections() val - 4 dat. - data.frame(id = unique(dat$id), time = val) out - merge(dat, dat., all =

Re: [R] Sweave documents have corrupted double quotes

2009-01-18 Thread Duncan Murdoch
On 17/01/2009 10:34 PM, Paul Johnson wrote: On Sat, Jan 17, 2009 at 4:00 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 17/01/2009 4:29 PM, Ben Bolker wrote: Duncan Murdoch murdoch at stats.uwo.ca writes: R is open source, so this is no mystery: if you use [noae] then Sweave won't use

Re: [R] using virtual memory in R

2009-01-18 Thread Prof Brian Ripley
Please RTFM, specifically the rw-FAQ and ?Memory-limits. The short answer is that your OS is your problem, and using a decent 64-bit OS will solve this (so why should the very limited resources of the R developers be spent working on this?) People who must use Windows may like to be aware

Re: [R] System with manual options

2009-01-18 Thread Prof Brian Ripley
See ?pipe. You can pipe input to a program you run that way. On Sun, 18 Jan 2009, Hadassa Brunschwig wrote: Hi I was wondering if there was a way to run system when there is e.g. a C program which is not totally command-line driven. That is, I have a C program which requires manual input of

[R] Minimization Problem

2009-01-18 Thread glenn
Dear All, Could someone give me some pointers (just a guide as to what functions I need to look at would be fine) as to how I go about this simple problem please; The problem looks like this; Choose x1 to x4 such that you minimize the MAXIMUM ABSOLUTE value returned in the vector result of this

Re: [R] select observations from longitudinal data set

2009-01-18 Thread Gabor Grothendieck
Try this. 'by' splits up the data frame into one data frame per id and then f acts separately on each such sub-dataframe returning a ts series with NAs for the missings. cbind'ing those all together gives us this series with one column per id: tt Time Series: Start = 1 End = 6 Frequency = 1

Re: [R] Minimization Problem

2009-01-18 Thread David Winsemius
I'm not sure that it comes across as a matrix problem in the sense of involving matrix algebra, but it's also possible that I don't understand what you are saying. Seems that an appropriate application of: ?abs ?max ?sapply ?which.min ... ought to do the trick. If you were hoping for

[R] read a xls file

2009-01-18 Thread Michele Santacatterina
Hello, i have a xls file. I will read it in r, what library-command i use for this?? any ideas?? Thanks Michele [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Minimization Problem

2009-01-18 Thread Stephan Kolassa
Hi Glenn, perhaps I'm misunderstanding your problem, but it seems to me that the zero vector (yielding a zero vector after the multiplication) will happily minimize everything you want. Apart from that, you may want to look at the Optimization Task View on CRAN. Good luck, Stephan glenn

Re: [R] read a xls file

2009-01-18 Thread Gabor Grothendieck
See the R Import/Export manual. Also RSiteSearch(import excel) gives many hits. It seems as if this question is asked almost daily. On Sun, Jan 18, 2009 at 9:15 AM, Michele Santacatterina miksa...@gmail.com wrote: Hello, i have a xls file. I will read it in r, what library-command i use for

Re: [R] read a xls file

2009-01-18 Thread David Winsemius
One idea would be to use search facilities. At a guess this has already been asked and answered 100-200 times. I know for a fact that it was asked and answered twice in the last week. The four search engine links on the mailing list page are here replicated:

[R] Deleting columns based on the number of non-blank observations

2009-01-18 Thread Josh B
Hello, I have a dataset (named x) with many (966) columns. What I would like to do is delete any columns that do not have at least 375 non-blank observations (i.e., the cells have some value in them besides NA). How can I do this? I have come up with the following code to _count_ the

[R] about power.law.fit

2009-01-18 Thread Weijia You
Dear all, I'm using igraph for some analysis about the network I have. I have a question about the function power.law.fit. I wonder if there is any test for checking whether the power.law.fit is good for the input, i.e., under which situation, could we use this function to get a reliable

Re: [R] Deleting columns based on the number of non-blank observations

2009-01-18 Thread jim holtman
Something like this should work: num - apply(yourData, 2, function(x) sum(is.na(x)) 375) yourData - youData[, num] On Sun, Jan 18, 2009 at 9:55 AM, Josh B josh...@yahoo.com wrote: Hello, I have a dataset (named x) with many (966) columns. What I would like to do is delete any columns

Re: [R] Deleting columns based on the number of non-blank observations

2009-01-18 Thread David Winsemius
colSums(is,na(x) ) can replace your function and negative indexing can eliminate the unwanted columns: x[-(colSums(is.na(x)) 375)] or equivalently: x[(colSums(is.na(x)) = 375)] You could (destructively) assign the result to x if you are brave. -- David Winsemius On Jan 18, 2009, at 9:55

[R] RES: read a xls file

2009-01-18 Thread Rodrigo Aluizio
Hi Michele, there are at least two good alternatives. xlsReadWrite (read only xls) RODBC (the one I prefer, read xls and xlsx), odbcConnectExcel (read xls) and odbcConnectExcel2007 (read xlsx). The libraries help files bring to you better details. Here are some examples of file importing (the

Re: [R] don't print object attributes on screen

2009-01-18 Thread jim holtman
Is this what you want: y - scale(x) str(x) int [1:10] 1 2 3 4 5 6 7 8 9 10 str(y) num [1:10, 1] -1.486 -1.156 -0.826 -0.495 -0.165 ... - attr(*, scaled:center)= num 5.5 - attr(*, scaled:scale)= num 3.03 y [,1] [1,] -1.4863011 [2,] -1.1560120 [3,] -0.8257228 [4,] -0.4954337

Re: [R] using virtual memory in R

2009-01-18 Thread Vishwa Goudar
Hi Brian, Thanks for the answer. I guess ill move to a 64-bit linux. I did RTFM, but didnt find it as informative as your reply, or amusing ;) Maybe the FAQ can be modified a bit for clarity. Thanks. Best, Vishwa On Sun, Jan 18, 2009 at 3:55 AM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote:

[R] data management

2009-01-18 Thread oscar linares
Dear Rxperts, I have a varaibles data file that looks like this p(1) 10 p(1) 3 p(1) 4 p(2) 20 p(2) 30 p(2) 40 p(3) 4 p(3) 1 p(1) 2 I cannot process these data with R because it does not like the parentheses. How can I get these to look like: p1 10 p1 3 p1 4 p2 20 p2 30 p2 40 p3 4 p3 1 p3 2

Re: [R] read a xls file

2009-01-18 Thread oscar linares
use install.package(RODBC) library(RODBC) cnct - odbcConnectExcel(filename.xls) hope this helps On Sun, Jan 18, 2009 at 9:15 AM, Michele Santacatterina miksa...@gmail.comwrote: Hello, i have a xls file. I will read it in r, what library-command i use for this?? any ideas?? Thanks

[R] Extracting random rows from a dataset

2009-01-18 Thread S.Putoto
Hello dear R Users, I am working on a dataset of 928 Enterprises, of which are observed 12 different characters. I need to randomly sample, without repetition, 70% of the entreprises, to create a testing set, and let the other 30% of the enterprises be a validating set (holdout validation, I

[R] Multiplication of dataframes

2009-01-18 Thread glenn
If I have 2 data frames; df1:dim(df1) = (1,10) df2:dim(df2) = (2000,10) Both with column header names, how do I multiply them together please. I.e create a dateframe dim() = (2000,1) Many Thanks in advance Glenn [[alternative HTML version deleted]]

Re: [R] Smooth periodic splines

2009-01-18 Thread Simon Wood
The cc and cp bases in package `mgcv' provide periodic splines, [e.g. gam(y~s(x,bs=cc))], but this may not be exactly the functionality you want. best, Simon On Friday 16 January 2009 08:42, cmr.p...@gmail.com wrote: Hello group! Is there a package that allows to fit smooth *periodic*

Re: [R] Multiplication of dataframes

2009-01-18 Thread Dimitris Rizopoulos
you should first transform them to matrices using data.matrix() and then do a matrix multiplication using %*%. This will create a matrix, which you can then convert to a data frame, if you want, using as.data.frame(). For instance, check the following: d1 - data.frame(x = rnorm(10), y =

Re: [R] Smooth periodic splines

2009-01-18 Thread Spencer Graves
Two other possibilities: The 'DierckxSpline' package includes a function 'percur' for fitting periodic splines. Unfortunately, it has a known bug that kills R with a segmentation fault, though it not affect your application. The 'fda' package supports the use of finite Fourier

[R] regex - negate a word

2009-01-18 Thread Rau, Roland
Dear all, let's assume I have a vector of character strings: x - c(abcdef, defabc, qwerty) What I would like to find is the following: all elements where the word 'abc' does not appear (i.e. 3 in this case of 'x'). Since I am not really experienced with regular expressions, I started slowly

Re: [R] Predictions with GAM

2009-01-18 Thread Simon Wood
Robbert, On Friday 16 January 2009 14:30, Robbert Langenberg wrote: Thanks for the swift reply, I might have been a bit sloppy with describing my datasets and problem. I showed the first model as an example of the type of GAM that I had been able to use the predict function on. What I am

Re: [R] regex - negate a word

2009-01-18 Thread jim holtman
Just remove those elements that match: x - c(abcdef, defabc, qwerty) x[-grep('abc',x)] [1] qwerty On Sun, Jan 18, 2009 at 1:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Dear all, let's assume I have a vector of character strings: x - c(abcdef, defabc, qwerty) What I would like to find

[R] Formatting the axis of plot() to shown our own values.

2009-01-18 Thread saurabh_koparkar
Part 1: I want to plot the CO2 concentration vs. year, but extending the x-axis using the xlim parameter to include the year 2006 (x axis range of values are from -41210 to 0), and adjusting the ylim parameter to go up to 400 when the range of y axis values are from 150 to 300. How do I do this?

Re: [R] Extracting random rows from a dataset

2009-01-18 Thread jim holtman
Here is one way to do it: x - matrix(1:100,10) x [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]1 11 21 31 41 51 61 71 8191 [2,]2 12 22 32 42 52 62 72 8292 [3,]3 13 23 33 43 53 63 73 8393 [4,]4 14

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Rau, Roland wrote: Dear all, let's assume I have a vector of character strings: x - c(abcdef, defabc, qwerty) What I would like to find is the following: all elements where the word 'abc' does not appear (i.e. 3 in this case of 'x'). a quick shot is: x[-grep(abc, x)] which

Re: [R] data management

2009-01-18 Thread jim holtman
Does this give you what you want: x - read.table(textConnection(p(1) 10 + p(1) 3 + p(1) 4 + p(2) 20 + p(2) 30 + p(2) 40 + p(3) 4 + p(3) 1 + p(1) 2), as.is=TRUE) # remove parenthesis x$V1 - gsub([()], , x$V1) x V1 V2 1 p1 10 2 p1 3 3 p1 4 4 p2 20 5 p2 30 6 p2 40 7 p3 4 8 p3 1 9 p1 2

Re: [R] data management

2009-01-18 Thread David Winsemius
? gsub gsub(\\(|\\), , var) You can then read.table on a textConnection. read.table(textConnection(gsub(\\(|\\), , var) )) V1 V2 1 p1 10 2 p1 3 3 p1 4 4 p2 20 5 p2 30 6 p2 40 7 p3 4 8 p3 1 9 p1 2 On Jan 18, 2009, at 12:13 PM, oscar linares wrote: Dear Rxperts, I have a varaibles

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
Try this: # indexes setdiff(seq_along(x), grep(abc, x)) # values setdiff(x, grep(abc, x, value = TRUE)) Another possibility is: z - abc x0 - c(x, z) # to handle no match case x0[- grep(z, x0)] # values On Sun, Jan 18, 2009 at 1:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Dear all,

Re: [R] Formatting the axis of plot() to shown our own values.

2009-01-18 Thread Stephan Kolassa
Hi Saurabh saurabh_koparkar schrieb: Part 1: I want to plot the CO2 concentration vs. year, but extending the x-axis using the xlim parameter to include the year 2006 (x axis range of values are from -41210 to 0), and adjusting the ylim parameter to go up to 400 when the range of y axis values

Re: [R] regex - negate a word

2009-01-18 Thread Eric Archer
Roland, I think you were almost there with your first example. Howabout using: x - c(abcdef, defabc, qwerty) y - grep(pattern=abc, x=x) z.char - x[-y] z.index - (1:length(x))[-y] z.char [1] qwerty z.index [1] 3 Cheers, eric Rau, Roland wrote: Dear all, let's assume I have a vector

Re: [R] Extracting random rows from a dataset

2009-01-18 Thread David Winsemius
read.table(textConnection(gsub(\\(|\\), , var) )) #from prior posting V1 V2 1 p1 10 2 p1 3 3 p1 4 4 p2 20 5 p2 30 6 p2 40 7 p3 4 8 p3 1 9 p1 2 ridxs - sample(1:nrow(df),floor(0.7*nrow(df)) ) # the 70% sample row IDs df[ridxs,] V1 V2 5 p2 30 6 p2 40 2 p1 3 7 p3 4 4 p2 20 8

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Jorge Ivan Velez wrote: Hi Wacek, I think you wanted to say strings instead x in your last line : ) of course, thanks. the correct version is: if(length(matching - grep(pattern, strings))) strings[-matching] else strings btw., and in relation to a recent post complaining about

Re: [R] regex - negate a word

2009-01-18 Thread Rau, Roland
Thank you very much to all of you for your fast and excellent help. Since the -grep(...) solution seems to be favored by most of the answers, I just wonder if there is really no regular expression which does the job?!? Thanks again, Roland -Original Message- From: Gabor Grothendieck

Re: [R] Formatting the axis of plot() to shown our own values.

2009-01-18 Thread Rau, Roland
Hi -Original Message- From: r-help-boun...@r-project.org on behalf of saurabh_koparkar Sent: Sun 1/18/2009 5:12 PM To: r-help@r-project.org Subject: [R] Formatting the axis of plot() to shown our own values. Part 1: I want to plot the CO2 concentration vs. year, but extending the

Re: [R] don't print object attributes on screen

2009-01-18 Thread Rolf Turner
On 18/01/2009, at 7:55 PM, Pedro Mardones wrote: Dear all; I have a function written in R that returns as a list of values as output that has associated some user defined attributes to it. How can hide these attributes when printing the output on screen? I'm using R-2.8.1 on WinXPit's like

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
Try this: grep(^([^a]|a[^b]|ab[^c])*.{0,2}$, x, perl = TRUE) On Sun, Jan 18, 2009 at 2:37 PM, Rau, Roland r...@demogr.mpg.de wrote: Thank you very much to all of you for your fast and excellent help. Since the -grep(...) solution seems to be favored by most of the answers, I just wonder if

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: Try this: # values setdiff(x, grep(abc, x, value = TRUE)) Another possibility is: z - abc x0 - c(x, z) # to handle no match case x0[- grep(z, x0)] # values on quick testing, these two and the if-based version have comparable runtime, with a minor win for

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
In that case just add fixed = TRUE On Sun, Jan 18, 2009 at 2:58 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Gabor Grothendieck wrote: Try this: # values setdiff(x, grep(abc, x, value = TRUE)) Another possibility is: z - abc x0 - c(x, z) # to handle no match case

[R] Error installing ggobi in R, Ubuntu Intrepid Ibex

2009-01-18 Thread Dirty D
Hi, I'm newish to R and Ubuntu, and I've getting this error when I'm trying to install ggobi in R. Any suggestions? DD *R version 2.7.1 (2008-06-23) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: In that case just add fixed = TRUE in general, if you want a complex pattern, you don't use 'fixed', and then again you risk incorrect (well, correct for r, but not for the problem) result in case no input string matches the pattern. vQ

Re: [R] Error installing ggobi in R, Ubuntu Intrepid Ibex

2009-01-18 Thread Dirty D
Dirk, Thanks for the quick response. I've installed that package - once I have it installed, how do I use rggobi inside R? DD Dirk Eddelbuettel wrote: On 18 January 2009 at 15:19, Dirty D wrote: | I'm newish to R and Ubuntu, and I've getting this error when I'm trying | to install ggobi

[R] auto.arima forecasting issue

2009-01-18 Thread diego Diego
Hello everybody! I'm having this problem with the auto.arima function that i've not been able to solve. I use this function on time series that contains NA values, but every time that the resulting model contains drift I can't perform a forecasting (using forecast.Arima function). The printed

[R] Pseudo-F-Statistics Clustering

2009-01-18 Thread mauede
Is there any R package which implements Pseudo-F-Statistics Clustering ? Vogel and Wong derived a formula to evaluate the best clusters number through such a method. Silhouette metod only provides an average evaluation. Thank you very much. Maura tutti i telefonini TIM!

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: Try this: grep(^([^a]|a[^b]|ab[^c])*.{0,2}$, x, perl = TRUE) ... and see how cumbersome it becomes for a pattern as trivial as 'abc'. in perl, you typically don't invent such negative patterns, but rather don't match positive patterns: instead of the match

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: On Sun, Jan 18, 2009 at 2:37 PM, Rau, Roland r...@demogr.mpg.de wrote: Thank you very much to all of you for your fast and excellent help. Since the -grep(...) solution seems to be favored by most of the answers, I just wonder if there is really no regular

[R] ?grep

2009-01-18 Thread oscar linares
Dear Rxperts, I have the following data: Study Study.Name C Category TC Time QC QO SD FSD Theta 1 NONE 0P(22) 0 0.00 7.5596 0 0 8.0361e-03 0 1 NONE 6G(50) 0 0.00 1. 0 0 0.e+00 0 1 NONE 2F(02) 0 0.00

Re: [R] regex - negate a word

2009-01-18 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: # r code ungrep = function(pattern, x, ...) grep(paste(pattern, (*COMMIT)(*FAIL)|(*ACCEPT), sep=), x, perl=TRUE, ...) strings = c(abc, xyz) pattern = a[a-z] (filtered = strings[ungrep(pattern, strings)]) # xyz this was a toy example, but if you need this

Re: [R] ?grep

2009-01-18 Thread John Fox
Dear Oscar, You don't need grep() to do what you want: Data[Data$Category == G(50), c(Time, QC)] Time QC 2 0.00 1. 6 0.01 1.0001 7 0.02 1.0003 8 0.03 1.0004 9 0.04 1.0005 10 0.05 1.0007 11 0.06 1.0008 12 0.07 1.0009 13 0.08 1.0011 14 0.09 1.0012 15 0.10 1.0013 I hope this

Re: [R] regex - negate a word

2009-01-18 Thread Rau, Roland
Thanks! (I have to admit, though, that I expected something simple) Thanks, Roland -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Sun 1/18/2009 8:54 PM To: Rau, Roland Cc: r-help@r-project.org Subject: Re: [R] regex - negate a word Try this:

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
Well, that's why it was only provided when you insisted. This is not what regexp's are good at. On Sun, Jan 18, 2009 at 4:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Thanks! (I have to admit, though, that I expected something simple) Thanks, Roland -Original Message- From:

Re: [R] regex - negate a word

2009-01-18 Thread Rolf Turner
On 19/01/2009, at 10:44 AM, Gabor Grothendieck wrote: Well, that's why it was only provided when you insisted. This is not what regexp's are good at. On Sun, Jan 18, 2009 at 4:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Thanks! (I have to admit, though, that I expected something simple)

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
That's an entirely different point from whether regular expressions can do it as grep -v is just another way to do it without using a regular expression to specify the entire job. On Sun, Jan 18, 2009 at 5:02 PM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 19/01/2009, at 10:44 AM, Gabor

Re: [R] regex - negate a word

2009-01-18 Thread Stavros Macrakis
On Sun, Jan 18, 2009 at 2:22 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: x - c(abcdef, defabc, qwerty) ...[find] all elements where the word 'abc' does not appear (i.e. 3 in this case of 'x'). x[-grep(abc, x)] which unfortunately fails if none of the strings in x

Re: [R] regex - negate a word

2009-01-18 Thread Gabor Grothendieck
Note that the variation of this that I posted already handles that case. On Sun, Jan 18, 2009 at 5:32 PM, Stavros Macrakis macra...@alum.mit.edu wrote: On Sun, Jan 18, 2009 at 2:22 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: x - c(abcdef, defabc, qwerty) ...[find] all

[R] Combinations

2009-01-18 Thread glenn
Hi All, some help on this would be appreciated; Understood combinations(7,4) returns all the possible 4 part combinations out of 7. Is is possible to substitute the ³7² for a list of stuff you would like to see the mix of; c(³a²,...,²g²) say ? Thanks Glenn [[alternative HTML version

Re: [R] Combinations

2009-01-18 Thread Jorge Ivan Velez
Dear Glenn, Try this: # Your example choose(7,4)# 35 require(forward) fwd.combn(7,4) # a 4x35 matrix # Other possibilities sapply(4:10,function(x) choose(x,4)) sapply(4:10,function(x) fwd.combn(x,4)) HTH, Jorge On Sun, Jan 18, 2009 at 6:06 PM, glenn g1enn.robe...@btinternet.com

[R] MH algorithm syntax help

2009-01-18 Thread ekwaters
Hi all, I am trying to write a random walk metropolis hastings algorithm, I using the latest debian distribution of R. Can anyone tell me what I need to insert in the below code? I have tried putting various combinations of curly brackets and punctuation between the acc=1 and if statements, all

Re: [R] Extracting random rows from a dataset

2009-01-18 Thread S.Putoto
Thank you everybody, problem solved! :) David Winsemius wrote: read.table(textConnection(gsub(\\(|\\), , var) )) #from prior posting V1 V2 1 p1 10 2 p1 3 3 p1 4 4 p2 20 5 p2 30 6 p2 40 7 p3 4 8 p3 1 9 p1 2 ridxs - sample(1:nrow(df),floor(0.7*nrow(df)) ) # the

[R] Mac OS X / preview.app / fullrefman.pdf

2009-01-18 Thread m.u.r.
this may be slightly off-topic, as it doesn't pertain directly to the R application, but some of the documentation. when reading R's fullrefman.pdf (available from http://cran.r-project.org/doc/manuals/fullrefman.pdf) in Mac OS X's preview.app (version 4.1, on Mac OS 10.5.x), if i try to do a

[R] Perl-R bridge

2009-01-18 Thread ANJAN PURKAYASTHA
Hi, I'm planning to access R from my perl scripts. The only noteworthy bridge seems to be Statistics-R-0.03http://search.cpan.org/%7Ectbrown/Statistics-R/lib/Statistics/R.pm. Would anyone like to share their experience with this Perl-R bridge? I'd like to install it in a Mac OS X. Suggestions on

Re: [R] MH algorithm syntax help

2009-01-18 Thread David Winsemius
The comma *before* acc=1 ? I also wondered whether (further up) this should work: s2y[i,]=s2y[i-1] # would think this to result in a dimension mismatch This looks sketchy as well: s2y[i,j] = s2y[b[i-1,j] + rnorm(1,mean=0, sd=s2yscale[j]) ^ ^ ^ # unmatched sqr-brackets It

[R] Question about contributed packages

2009-01-18 Thread Murray Cooper
I am working on a methodology for qualifying R, for GLP and GCP. If I quailfy only the base R install, with no contributed packages, it seems relatively simple to qualify R. However, from time to time I will want to use a contributed package. If I use a contributed package, does it leave

Re: [R] using virtual memory in R (Tom Allen)

2009-01-18 Thread Thomas Allen
hi are you using a 64bit system? 32 bit systems can only allocate about 3GB to a single process. http://msdn.microsoft.com/en-gb/library/aa366778.aspx I used to use 32bit winXP, then moved to 64bit Ubuntu8.04 to solve my memory problems. if you are 64bit, you should try playing around with the

[R] lazy evaluation question

2009-01-18 Thread markleeds
I've been going back to old difficult R-list evaluation emails that I save in order to understand evaluation better and below still confuses me. Could someone explain why A) works and B) doesn't. A variant of below is in the Pat's Inferno book also but I'm still not clear on what is

Re: [R] lazy evaluation question

2009-01-18 Thread Gabor Grothendieck
Note that rm(i) for(j in 1:4) F(j) raises an error due to scoping issues. On Sun, Jan 18, 2009 at 10:02 PM, markle...@verizon.net wrote: I've been going back to old difficult R-list evaluation emails that I save in order to understand evaluation better and below still confuses me. Could

Re: [R] Question about contributed packages

2009-01-18 Thread Rolf Turner
On 19/01/2009, at 3:14 PM, Murray Cooper wrote: I am working on a methodology for qualifying R, for GLP and GCP. If I quailfy only the base R install, with no contributed packages, it seems relatively simple to qualify R. However, from time to time I will want to use a contributed package. If

[R] conditional weighted quintiles

2009-01-18 Thread Ozan Bakis
Dear All, I am economist and working on poverty / income inequality. I need descriptive statitics like the ratio of education expentitures between different income quintiles where each household has a different weight. After a bit of google search I found 'Hmisc' and 'quantreg' libraries for

[R] sort or order problem.

2009-01-18 Thread GreggAllen
Thanks to everyone who helped me when I was totally clueless. Now I'm only partially clueless, and in writing functions, which is major progress. This is a function that is a major improvement over which I was using MS Excel for: function() { files - list.files(pattern=ABN*) # All the

Re: [R] sort or order problem.

2009-01-18 Thread Jorge Ivan Velez
Dear Gregg, Take a look at ?duplicates. Here is an example: z-data.frame( ID=c(1,1,2,1,1,1,1,2,2,3,4,3,2,2,2,2,3,4,4,5,5,6,6,7), y=rnorm(24) ) z[!duplicated(z$ID),] See ?duplicated for more information. HTH, Jorge On Sun, Jan 18, 2009 at 11:27 PM, greggal...@gmail.com wrote:

Re: [R] read a xls file

2009-01-18 Thread Liviu Andronic
Hello, On 1/18/09, Michele Santacatterina miksa...@gmail.com wrote: i have a xls file. I will read it in r, what library-command i use for this?? This has been discussed recently. Please search the archives for `excel'. Liviu -- Do you know how to read?

Re: [R] regression model selection (John P. Burkett)

2009-01-18 Thread Monte Milanuk
John, Thanks for the tip on that document; after some searching I found a PDF copy of it on the 'Net. It may take me a little while to work through it, but it looks to be full of good info and worth the effort. I'll also take a look at leaps as I get time. Thanks, Monte [[alternative

[R] Deleting columns where the frequency of values are too disparate

2009-01-18 Thread Josh B
Hello R-help community, I have another question about filtering datasets. Please consider the following toy data matrix example, called x for simplicity. There are 20 different individuals (ID), with information about the alleles (A,T, G, C) at six different loci (Locus1 - Locus6) for each

Re: [R] lattice question: independent per-row or per-column scaling?

2009-01-18 Thread Deepayan Sarkar
On 1/8/09, René J.V. Bertin rjvber...@gmail.com wrote: Hello - and happy newyear to all of you! I've got some data that I'm plotting with bwplot, a 3x2x3 design where the observable decreases with the principle independent factor, but at different rates. I'd like to get lattice to