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 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 impose not a singl

[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") f

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

Re: [R] read a xls file

2009-01-18 Thread Liviu Andronic
Hello, On 1/18/09, Michele Santacatterina 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? http://www.alienetworks.com/srtest.cfm Do you know

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, wrote: > Thanks to everyone who

[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 mod

[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 weig

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

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, 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 > someone explain why

[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 happeni

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 co

[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 anything

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 w

[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.03. 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

[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 keyw

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.

[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,

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 wrote: > Hi All, some help on

[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 del

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 wrote: > On Sun, Jan 18, 2009 at 2:22 PM, Wacek Kusnierczyk > wrote: >>> x <- c("abcdef", "defabc", "qwerty") >>> ...[find] all elements where the word 'abc' does not appear

Re: [R] regex -> negate a word

2009-01-18 Thread Stavros Macrakis
On Sun, Jan 18, 2009 at 2:22 PM, Wacek Kusnierczyk 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 matches the pattern, > i

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 wrote: > > On 19/01/2009, at 10:44 AM, Gabor Grothendieck wrote: > >> We

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 wrote: Thanks! (I have to admit, though, that I expected something simple) It may not be wha

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 wrote: > Thanks! (I have to admit, though, that I expected something simple) > > Thanks, > Roland > > > > -Original Message- > From: Gabor Grothend

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: grep(

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 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

[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 100.00

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 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 ex

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 mat

[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! [[alternat

[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 erro

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 i

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

2009-01-18 Thread Dirk Eddelbuettel
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 in R. Any suggestions? Yes. Just install the pre-built binary from Ubuntu via $ sudo apt-get install r-cran-rggobi This will also install Ggobi itself

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 _

[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 a

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 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 >> x0[- gre

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

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 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 real

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] 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 x-ax

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] 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

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

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 assu

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 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 wrote: > Dear all, > > let's assume

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

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

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)]

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

[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] 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 wrote: > Dear all, > > let's assume I have a vector of character strings: > > x <- c("abcdef", "defabc", "qwerty") > > What I would like

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

[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 slo

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 seri

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 = rnor

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 *periodi

[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]] _

[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 thin

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 wrote: > Hello, > > i have a xls file. I will read it in r, what library-command i use for > this?? > > any ideas?? > > Thanks > > Mic

[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 The

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 wrote: > Please RTFM, specifi

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

[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 setw

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

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 wrote: > Hello, > > I have a dataset (named "x") with many (966) columns. What I would like to do > is delete any columns that do not

[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 res

[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 non-bl

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: http://tolstoy.newcastle.edu.au

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 wrote: > Hello, > > i have a xls file. I will read it in r, what library-command i use for > this?? > > a

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 sc

[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 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 t

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

[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] 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 op

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 t

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 wrote: On 17/01/2009 4:29 PM, Ben Bolker wrote: Duncan Murdoch stats.uwo.ca> writes: R is open source, so this is no mystery: if you use [noae] then Sweave won't use the ae package in LaTeX. The p

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., al

[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()

[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

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 ma

[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] 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-h