[R] how to convert a table to adjacency matrix used in social network analysis?

2008-02-27 Thread Samuel
Hi Guys, Do you any one know how to convert a long format table to an adjacency matrix used in sna? The long table looks like p1 p2 counts a b 100 a c 200 a d 100 b c 80 b d 90 b e 100 c d 100 c e 40 d e 60 and I want to convert it to an adjacency matrix which can be used in sna? Any methods

Re: [R] Loading user defined functions autometically each time I start R

2008-02-27 Thread anna freni sterrantino
Hi, an easy way, is to save your functions in a file and have it in your working directoy and sources it. i.e. source(myfile.r) otherwise you can try to build your own package, see ?package.skeleton Hope it helps Regards A - Messaggio originale - Da: Arun Kumar Saha [EMAIL

Re: [R] Plot Principal component analysis

2008-02-27 Thread Jim Lemon
SNN wrote: Hi, I have matrix of 300,000*115 (snps*individual). I ran the PCA on the covariance matrix which has a dimention oof 115*115. I have the first 100 individuals from group A and the rest of 15 individuals from group B. I need to plot the data in two and 3 dimentions with respect to

[R] glm binomial with no successes

2008-02-27 Thread juli pausas
Dear all, I have a question on glm, family binomial. I do not see significant differences between the levels of a factor (treatment) if all data for a level is 0; and replacing a 0 for a 1 (in fact reducing the difference), then I detect the significant difference that I expected. Is there a way

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread ONKELINX, Thierry
Chris, 1. This code will give you the boxplot that you want. library(ggplot2) series - c('C2','C4','C8','C10','C15','C20') ids - c('ID1','ID2','ID3') mydata - data.frame(SERIES=rep(series,30),ID=rep(ids,60),VALUE=rnorm(180)) ggplot(mydata, aes(y = VALUE, x = factor(1))) + geom_boxplot() +

[R] periodic term

2008-02-27 Thread Antonio Gasparrini
Hello, I'm trying to built a model for a time-series analysis with an periodic term for seasonality. I've tried both harmonic (package spatstat) and periodicSpline (package splines). The former don't allow a periodic constraint, while I've not been able to use the latter within a dataframe

Re: [R] how to specify ggplot2 facet plot order

2008-02-27 Thread ONKELINX, Thierry
Chris, The order of the facets row or column depend on the order in the associated factor. The code below is what you want. Note that I have changed 'cases' in 'series' because your example was not reproducible as a definition of 'cases' was missing. library(ggplot2) series -

Re: [R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-27 Thread Jim Lemon
Judith Flores wrote: Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type=n) for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i])

Re: [R] Multiple linear regression with for loop

2008-02-27 Thread Uwe Ligges
Markus Mühlbacher wrote: Hi everyone! I have an array containing the following fields for over hundred compounds: cpd, activity, fixterm, energy1, energy2, energy3, ... I want to run a multiple linear regression on all entries of an array. Therefore I tried to do this with a for loop.

Re: [R] Loading user defined functions autometically each time I start R

2008-02-27 Thread Richard . Cotton
I wrote some user defined function for my own. Now I want to get a mechanism so that every time I start R, those function will automatically be loaded in R without manually copying pasting. Can gurus here pls tell me how to do that? Or I have to build my own packages bundled with those

Re: [R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Gavin Simpson
On Wed, 2008-02-27 at 11:35 +0100, Paul Hiemstra wrote: Dear All, I try to use Sweave to make a document. But when I use the Sweave() command on it and build a pdf with pdflatex (3.141592-1.40.3) my apostrophes are replaced by some gibberish (an 'a' with a hat on it, a capital A with a

Re: [R] how to specify ggplot2 facet plot order

2008-02-27 Thread ONKELINX, Thierry
Chris, You can use the as.is or stringsAsFactors argument in read.csv to prevent that strings are converted into factors. See ?read.csv for the details. Thierry ir. Thierry Onkelinx Instituut voor natuur- en

[R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Paul Hiemstra
Dear All, I try to use Sweave to make a document. But when I use the Sweave() command on it and build a pdf with pdflatex (3.141592-1.40.3) my apostrophes are replaced by some gibberish (an 'a' with a hat on it, a capital A with a arc pointing upwards on it and a capital Y with two points on

Re: [R] how to specify ggplot2 facet plot order

2008-02-27 Thread Chris Friedl
Hi Thierry thanks for your help. I've been searching the R-help archives for posts by you and Hadley as a way to learn ggplot details so I appreciate your help to the R community. I wasn't aware of the levels option in the factors function. In my real application I get the data using read.csv

[R] Calculating monthly var-cov matrix on non-overlapping rooling window basis

2008-02-27 Thread Megh Dal
let create a 'zoo' object : library(zoo) date.data = seq(as.Date(01/01/01, format = %m/%d/%y), as.Date(06/25/02, format = %m/%d/%y), by = 1) len = length(date.data) data1 = zoo(matrix(rnorm(2*len), nrow = len), date.data ) head(data1) Now I want to create an 3 dimensional

Re: [R] glm binomial with no successes

2008-02-27 Thread Prof Brian Ripley
On Wed, 27 Feb 2008, juli pausas wrote: Dear all, I have a question on glm, family binomial. I do not see significant differences between the levels of a factor (treatment) if all data for a level is 0; and replacing a 0 for a 1 (in fact reducing the difference), then I detect the

Re: [R] Calculating monthly var-cov matrix on non-overlapping rooling window basis

2008-02-27 Thread Henrique Dallazuanna
Perhaps something like this: lapply(split(data1, format(index(data1), %m)), cov) On 27/02/2008, Megh Dal [EMAIL PROTECTED] wrote: let create a 'zoo' object : library(zoo) date.data = seq(as.Date(01/01/01, format = %m/%d/%y), as.Date(06/25/02, format = %m/%d/%y), by = 1) len =

Re: [R] how to convert a table to adjacency matrix used in social network analysis?

2008-02-27 Thread Chuck Cleland
On 2/27/2008 3:13 AM, Samuel wrote: Hi Guys, Do you any one know how to convert a long format table to an adjacency matrix used in sna? The long table looks like p1 p2 counts a b 100 a c 200 a d 100 b c 80 b d 90 b e 100 c d 100 c e 40 d e 60 and I want to convert it to an

Re: [R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Paul Hiemstra
Hi Gavin, I worked perfectly. Thank you so much. cheers, Paul Gavin Simpson wrote: On Wed, 2008-02-27 at 11:35 +0100, Paul Hiemstra wrote: Dear All, I try to use Sweave to make a document. But when I use the Sweave() command on it and build a pdf with pdflatex (3.141592-1.40.3) my

Re: [R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Prof Brian Ripley
These are not 'apostrophe's: it's (that is an apostrophe) misleading to call them that. They are single quotes, and there are two sorts if you look carefully. Probably you are using a UTF-8 locale and not telling LaTeX (or us) so. There are several ways to do so, depending on the age of your

Re: [R] Multiple linear regression with for loop

2008-02-27 Thread bartjoosen
I'm not sure if this is what you want but if you have a matrix as response, you can use the matrix ~ term: example: x - 1:10 y - rep(rnorm(10,x,0.5),10) dim(y) - c(10,10) y - as.matrix(y) coef(lm(y~x)) Bart Markus quot;Mühlbacherquot; wrote: Hi everyone! I have an array containing the

Re: [R] glm binomial with no successes

2008-02-27 Thread juli pausas
Thank you very much for your reply. Then I understand that would not be correct to perform the test in summary for testing the significance of the different levels of a factor in relation to the first level, including when there are more than 2 levels, as in my real case; at least for binomial

[R] Problems with quantreg and party package in 2.6.2 ver

2008-02-27 Thread Pablo Fernández Alvarez
I've problem with this pkg: - quantreg - party When i try to run this pkg under 2.6.2 (win 32). the system reports problems to reed the Rblas lib. (Not find the dynamic library links) Any suggestions to solve the problem ... tks, pablo. -- Pablo Fco. Fernández Alvarez

Re: [R] column name handling and long labels

2008-02-27 Thread Werner Wernersen
Somehow, I don't get how the labels of Hmisc work. My expectation was that if I use the following code and then the print method, I would get an output where the headers are replaced by the labels but I get the normal variable names. How can I get the labels as headers instead in the printed

[R] Plan to build Package to use GRASS from R

2008-02-27 Thread Rainer M Krug
Hi Sorry for crossposting, but I think this can be of interest for GRASS and R users. I am planning to write a package to make the use of GRASS from R easier. The idea is to wrap the system call to execute the GRASS command into an R command of the same name. e.g: r.to.vect - function(...,

Re: [R] [R-sig-Geo] Plan to build Package to use GRASS from R

2008-02-27 Thread Rainer M Krug
On 27/02/2008, Virgilio Gomez-Rubio [EMAIL PROTECTED] wrote: Hi, if you are refering to spgrass6, yes, But if I want to execute commands in GRASS, I still have to use system(...) OK. I just wanted to check... :) Not sure what ROger Bivand will think, but maybe it would be better to

Re: [R] Raw histogram plots

2008-02-27 Thread Henrique Dallazuanna
If I understand: x - rnorm(1e6) out - tapply(x, ceiling(x), length) plot(as.numeric(names(out)), out) On 27/02/2008, Andre Nathan [EMAIL PROTECTED] wrote: On Wed, 2008-02-27 at 14:15 +1300, Peter Alspach wrote: If I understand you correctly, you could try a barplot() on the result of

Re: [R] Raw histogram plots

2008-02-27 Thread Andre Nathan
On Wed, 2008-02-27 at 14:15 +1300, Peter Alspach wrote: If I understand you correctly, you could try a barplot() on the result of table(). Hmm, table() does the counting exactly the way I want, i.e., just counting individual values. Is there a way to extract the counts vs. the values from a

Re: [R] Highlighting different series with colors

2008-02-27 Thread Valentin Bellassen
Thanks, it works fine except that 7 colors are repeated twice (so that one color corresponds to two types). I tried the following but it makes things worse: the legend disappears and I get only 4 different colors: pan-function(x,y) {

Re: [R] Running randomForests on large datasets

2008-02-27 Thread Liaw, Andy
There are a couple of things you may want to try, if you can load the data into R and still have enough to spare: - Run randomForest() with fewer trees, say 10 to start with. - Run randomForest() with nodesize set to something larger than the default (5 for classification). This puts a limit on

[R] Label outliers in boxplot

2008-02-27 Thread Giulio Di Giovanni
Sorry if this is a stupid question, I'm a beginner and I didn't find help in manuals, archives, or web I have a z matrix of this type: a b c d 786-30.s2.gpr 0.2186214 1.3374486 89.37757 9.066358786-31.s1.gpr 1.0931070

[R] image analysis package

2008-02-27 Thread Abhilash Venu
Dear all, I would like to know whether any package is available for microarray image analysis. -- Regards, Abhilash [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] score test statistic in logistic regression

2008-02-27 Thread bkelcey
Hi, looking for a function or syntax to estimate the score test in logistic regression for the null hypothesis b1=0 in the model logit(p)=b0+ b1*x +b2*z. Data comes from the binomial distribution (n,p). Thanks, ben __ R-help@r-project.org mailing

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread Chris Friedl
Thanks Thierry. But this leads to a couple more questions if you don't mind. 1. I tried to extend your example to a grid by the facet_grid command with the aim of getting a boxplot of VALUE according to two factors SERIES and ID. However whatever syntax I use give me an error. For example:

Re: [R] Raw histogram plots

2008-02-27 Thread Charilaos Skiadas
On Feb 27, 2008, at 8:16 AM, Andre Nathan wrote: On Wed, 2008-02-27 at 14:15 +1300, Peter Alspach wrote: If I understand you correctly, you could try a barplot() on the result of table(). Hmm, table() does the counting exactly the way I want, i.e., just counting individual values. Is

Re: [R] Raw histogram plots

2008-02-27 Thread Frank E Harrell Jr
Andre Nathan wrote: On Wed, 2008-02-27 at 14:15 +1300, Peter Alspach wrote: If I understand you correctly, you could try a barplot() on the result of table(). Hmm, table() does the counting exactly the way I want, i.e., just counting individual values. Is there a way to extract the counts

Re: [R] question

2008-02-27 Thread Kwaku Aduse-Poku
Dear sir, I have this persistent problem trying to use the lmer function. After loading the lmer4 library and submitted my input command Model1- lmer(IndividualNum~BaitType*TrapType+( 1 |dTransect/dTrapStation/Expedition/Community), family=poisson(link=log)) It does fine but

Re: [R] Plot Principal component analysis

2008-02-27 Thread Thibaut Jombart
Jim Lemon wrote: SNN wrote: Hi, I have matrix of 300,000*115 (snps*individual). I ran the PCA on the covariance matrix which has a dimention oof 115*115. I have the first 100 individuals from group A and the rest of 15 individuals from group B. I need to plot the data in two and 3 dimentions

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread ONKELINX, Thierry
Chris, 1. This will make more sense. ggplot(mydata, aes(y = VALUE, x = SERIES)) + geom_boxplot() + facet_grid(.~ ID) 2. Now I think I understand want you want. I'm affraid that won't be easy because you're trying to mix continuous variables with categorical ones on the same scale. A density

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread hadley wickham
Now I think I understand want you want. I'm affraid that won't be easy because you're trying to mix continuous variables with categorical ones on the same scale. A density plot has two continuous scales: VALUE and it's density. The boxplot has a continuous scale (VALUE) and the other is

[R] png and pdf : point size, font size, etc.

2008-02-27 Thread Stephan Ripke
Hi, I am new to this mailing list. Didn`t find the answer in the archives. But I guess, there are people out there, who know the solution: In an automatic script, I want to produce simple plots. First I prefer pdf, because of scalability and standardization. But when I have too many datapoints

[R] Cross Validation

2008-02-27 Thread Carla Rebelo
Hello, How can I do a cross validation in R? Thank You! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] png and pdf : point size, font size, etc.

2008-02-27 Thread Michael
On 27 Feb 2008, Stephan Ripke wrote: The problem is, that the font size and the point-size of the plotpoints and the all of the plot is getting much smaller when using png-format. Why is this and how can I circumvent this issue? These are the two devices, I am opening for the two reasons:

Re: [R] png and pdf : point size, font size, etc.

2008-02-27 Thread Prof Brian Ripley
Since bitmap() used postscript, you may as well use PDF and convert to PNG (and bitmap in R-devel uses this as an option). I've no idea about the size differences, and we don't have a reproducible example. Again, R-devel offers many more options. On Wed, 27 Feb 2008, Stephan Ripke wrote:

Re: [R] Raw histogram plots

2008-02-27 Thread Andre Nathan
On Wed, 2008-02-27 at 08:48 -0500, Charilaos Skiadas wrote: x - table(rbinom(20,2,0.5)) plot(names(x),x) should do it. You can also try just plot(x). Use prop.table on table if you want the relative frequencies instead. Yes, names is what I needed :) Thanks for the prop.table hint. I

[R] multiple plots per page using hist and pdf

2008-02-27 Thread Ben Tupper
Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are generated. The first results in 4 plots on one pdf page as expected. However, the second, which swaps one of the plot() calls for hist(),

[R] Call for abstracts: Innovative Tools in Data Analysis (ERCIM08)

2008-02-27 Thread Bettina Gruen
Dear useRs, we are organizing the following session Topic: Innovative Tools in Data Analysis Organizers: Achim Zeileis and Bettina Gruen at the First Workshop of the ERCIM Working Group on Computing Statistics June 19-21, 2008 Neuchatel, Switzerland URL: http://www.dcs.bbk.ac.uk/ercim08 To

Re: [R] History of R

2008-02-27 Thread Kevin Wright
Kathy, You might find some relevant reading in volume 13 of the Journal of Statistical Software: http://www.jstatsoft.org/v13 Some of the papers have a bit of discussion on why R has become more widely used than lisp-stat. K Wright On Fri, Feb 15, 2008 at 1:53 PM, Kathy Gerber [EMAIL

Re: [R] glm binomial with no successes

2008-02-27 Thread Gavin Simpson
[Following up for my own personal education so a bit OT!] Naively, I would have thought that package multcomp would be of use here. So I tried, for my own comprehension and education, to answer the OP's question using multcomp. Here's what I got: ## make this reproducible (I hope) set.seed(1234)

[R] selecting consecutive records over a threshold

2008-02-27 Thread Jamie Ledingham
Dear all, I am having trouble working out how I might do the following and would appreciate any thoughts. I am working with data concerning precipitation. The data are in 2 columns in a data frame called storm in the following format: HourCount - 1,2,3,4,5,6,7,8,...48 Amt -

Re: [R] Cross Validation

2008-02-27 Thread Patrick Burns
http://www.burns-stat.com/pages/Tutor/bootstrap_resampling.html may be of some use to you. 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) Carla Rebelo wrote: Hello, How can I do a cross validation in R?

Re: [R] Plot Principal component analysis

2008-02-27 Thread SNN
Thanks for your help, Can R plot the data in 3 dimention, with different colors for each group ? for exmple I would like to have the plot with respect to PC1, PC2 and PC3. Thanks, SNN wrote: Hi, I have matrix of 300,000*115 (snps*individual). I ran the PCA on the covariance matrix

Re: [R] Running randomForests on large datasets

2008-02-27 Thread Nagu
Thank you Andy. It is throwing memory allocation error for me for numerous combinations of ntree and nodesize values. I tried with memory.limit() and memory.size to use the maximum memory but the error was consistent. But one thing I noticed was that I had tough time even just loading the dataset

[R] installing package

2008-02-27 Thread zmontaze
Dear all, I have prepared a package to install in R. I followed all steps explained in writing R extensions. Also I read the section add-on package in R installation and administration. These documents refer to R CMD INSTALL command but I don't know how to use this command. My specific question

Re: [R] multiple plots per page using hist and pdf

2008-02-27 Thread Ben Tupper
On Feb 27, 2008, at 11:45 AM, Gavin Simpson wrote: On Wed, 2008-02-27 at 11:31 -0500, Ben Tupper wrote: Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are generated. The first results in 4

Re: [R] column name handling and long labels

2008-02-27 Thread Frank E Harrell Jr
Werner Wernersen wrote: Somehow, I don't get how the labels of Hmisc work. My expectation was that if I use the following code and then the print method, I would get an output where the headers are replaced by the labels but I get the normal variable names. How can I get the labels as

Re: [R] jpeg in batch mode

2008-02-27 Thread Elizabeth Purdom
Thanks for the quick reply and sorry that I didn't see the documentation that could help me. I actually didn't see anything on the jpeg() help pages, or didn't recognize what was there as relating to my problem. I will look further on the archives if this plus Henrik's reply is not enough.

Re: [R] selecting consecutive records over a threshold

2008-02-27 Thread Gabor Grothendieck
Convert the data frame to a zoo object and note that: diff(-rollmax(-z, 2) 2) 0 diff(rollmax(z, 2) 1) 0 have 1 at the start and end of the storm period respectively so that cumsum of their difference has ones for the storm period. In the last line we extract that portion. # input DF

Re: [R] installing package

2008-02-27 Thread Doran, Harold
Yes. If you're building this package in windows this is done at a dos prompt in your r source directory -Original Message- From: [EMAIL PROTECTED] on behalf of [EMAIL PROTECTED] Sent: Wed 2/27/2008 1:02 PM To: r-help@r-project.org Subject: [R] installing package Dear all, I have

Re: [R] Running randomForests on large datasets

2008-02-27 Thread Max Kuhn
Also, use the non-formula interface to the function: # saves some space randomForest(x, y) the formula interface: # avoid: randomForest(y~., data = something) This second method saves a terms object that is very sparse and takes up a lot of space. Max On Wed, Feb 27, 2008 at 12:31

Re: [R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Prof Brian Ripley
On Wed, 27 Feb 2008, Gavin Simpson wrote: On Wed, 2008-02-27 at 11:35 +0100, Paul Hiemstra wrote: Dear All, I try to use Sweave to make a document. But when I use the Sweave() command on it and build a pdf with pdflatex (3.141592-1.40.3) my apostrophes are replaced by some gibberish (an 'a'

Re: [R] Sweave produces gibberish instead of apostrophe in pdf

2008-02-27 Thread Gavin Simpson
On Wed, 2008-02-27 at 20:33 +, Prof Brian Ripley wrote: On Wed, 27 Feb 2008, Gavin Simpson wrote: On Wed, 2008-02-27 at 11:35 +0100, Paul Hiemstra wrote: snip / Stick this in your preamble and see if it works (you might need to install a TexLive package from your usual Debian

[R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Ken Spriggs
Hello, I'm trying to do cor(x1,x2) and I get the following error: Error in cor.default(x1, x2) : missing observations in cov/cor A few things: 1. I've used cor() many times and have never encountered this error. 2. length(x1) = length(x2) 3. is.numeric(x1) = is.numeric(x2) = TRUE 4.

Re: [R] Reading a file created with Fortran

2008-02-27 Thread Mike Prager
Ben Bolker [EMAIL PROTECTED] wrote: Dennis Fisher fisher at plessthan.com writes: I am trying to read a file written by Fortran. Several lines of the file are pasted below: Perhaps read.fwf is what you want? (fwf stands for fixed width format). You would have to work out the

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Peter Dalgaard
Ken Spriggs wrote: Hello, I'm trying to do cor(x1,x2) and I get the following error: Error in cor.default(x1, x2) : missing observations in cov/cor A few things: 1. I've used cor() many times and have never encountered this error. 2. length(x1) = length(x2) 3. is.numeric(x1) =

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Erik Iverson
What happens when you type cor at the R prompt? Perhaps your calling of the cor function is not calling the cor function in the stats package? Ken Spriggs wrote: Hello, I'm trying to do cor(x1,x2) and I get the following error: Error in cor.default(x1, x2) : missing observations in

[R] plot y1 and y2 on one graph

2008-02-27 Thread milton ruser
Dear all I have a code like x-1:10 y1-x+runif(10)*2 y2-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Any help are welcome. Kind regards Miltinho

Re: [R] numeric format

2008-02-27 Thread Mike Prager
Rolf Turner [EMAIL PROTECTED] wrote: I have often wanted to suppress these row numbers and for that purpose wrote the following version of print.data.frame() [...] The ``srn'' argument means ``suppress row numbers''; [...] I once suggested to an R Core person that my version of

Re: [R] Label outliers in boxplot

2008-02-27 Thread David Hewitt
simply when I boxplot i use boxplot(as.data.frame(z)) I would like the rownames to appear close to the outliers in the boxplot. There is a command to do it ? I've seen the identify() function but I'm not able to obtain any results. Your data frame came through scrambled for me.

Re: [R] plot y1 and y2 on one graph

2008-02-27 Thread jim holtman
This should do what you want: x-1:10 y1-x+runif(10)*2 y2-seq(0,50,length.out=10)+rnorm(10)*10 plot(y1~x, bty='c') par(new=TRUE) # plot on the same graph plot(y2~x, col='red', axes=FALSE, bty='c', xlab='', ylab='') axis(4, col.axis='red', col='red') mtext(y2, 4, col='red', line=-2) On Wed,

[R] multi-level hierarchical logistic regression with sampling weight

2008-02-27 Thread GUO, Qian
Hi I would like to run a multi-level hierarchical logistic regression model with sampling weight? Is this possible with R? Thanks a lot, Qian Guo - [[alternative HTML version deleted]] __

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Ken Spriggs
I get the following class(x1) [1] numeric class(x2) [1] numeric and: cor(x1,x2) Error in cor.default(x1, x2) : missing observations in cov/cor traceback() 2: cor.default(x1, x2) 1: cor(x1, x2) Peter Dalgaard wrote: Ken Spriggs wrote: Hello, I'm trying to do cor(x1,x2) and I get

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Ken Spriggs
I get the following: cor function (x, y = NULL, use = all.obs, method = c(pearson, kendall, spearman)) { UseMethod(cor) } Erik Iverson wrote: What happens when you type cor at the R prompt? Perhaps your calling of the cor function is not calling the cor function in the stats

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread Chris Friedl
Thierry 1. ggplot(mydata, aes(y = VALUE, x = SERIES)) + geom_boxplot() + facet_grid(.~ ID) creates a grid with three ID columns (ID1, ID2, ID3) and six SERIES columns within each ID column with two boxplots in each ID column (C10, C2) (C15, C4), (C20, C8). I was aiming for a grid with ID

Re: [R] Custom LaTeX tables

2008-02-27 Thread Werner Wernersen
Thanks for the answers! I will play around a bit and maybe I really need to write a custom wrapper than. Best, Werner --- Gabor Grothendieck [EMAIL PROTECTED] schrieb: On Tue, Feb 26, 2008 at 10:58 AM, Werner Wernersen [EMAIL PROTECTED] wrote: Hello, I am very happy that I have Sweave

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Erik Iverson
OK, that is not the definition of cor in the stats package. Some add-on package you are loading might be overwriting it. What happens if you do stats::cor(x1,x2) ? Ken Spriggs wrote: I get the following: cor function (x, y = NULL, use = all.obs, method = c(pearson, kendall,

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Rolf Turner
On 28/02/2008, at 11:11 AM, Ken Spriggs wrote: I get the following class(x1) [1] numeric class(x2) [1] numeric and: cor(x1,x2) Error in cor.default(x1, x2) : missing observations in cov/cor traceback() 2: cor.default(x1, x2) 1: cor(x1, x2) ``Clearly'' you must be using a

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread Chris Friedl
Hi Hadley First off, thanks for ggplot2 and everything that bringing it to life and sustaining it entails. I noticed the coord flip problem during my ggplot investigations. Is this something I can override by getting into the code? On the coord flipping problem I was thinking to grab the

Re: [R] multi-level hierarchical logistic regression with sampling weight

2008-02-27 Thread Rolf Turner
On 28/02/2008, at 11:28 AM, GUO, Qian wrote: Hi I would like to run a multi-level hierarchical logistic regression model with sampling weight? Is this possible with R? Yes. In R, all things are *possible*. :-) cheers, Rolf Turner

Re: [R] multiple plots per page using hist and pdf

2008-02-27 Thread John Kane
I think you need to reset the par(mfrow=c(2,2)) before plotting the second set of graphs. --- Ben Tupper [EMAIL PROTECTED] wrote: Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are

[R] problem with creation of eSet

2008-02-27 Thread Manisha Brahmachary
Hi, I am having troubles with creating an eSet and would appreciate any help on the following problem. I am trying to create an eSet using the following code pd - read.table(file=pdata.txt,header =TRUE,row.names=1); colnames(pd) - c(type,tumor,time,id); pdN - list(type =

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Daniel Malter
Does the code below solve your problem? If you have NAs in the same rows, you have to use c or p as use= parameters. Otherwise you get the error you described. a=c(1,2,3,4,NA,6) b=c(2,4,3,5,NA,7) which(is.na(a))==which(is.na(b)) cor(a,b) Error cor(a,b,use=all.obs) Error

Re: [R] Error in cor.default(x1, x2) : missing observations in cov/cor

2008-02-27 Thread Daniel Malter
Sorry, I overlooked the = integer(0) result to which(is.na(x1))==which(is.na(x2)). So that's not it. Cheers. - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: Daniel Malter [mailto:[EMAIL PROTECTED] Gesendet: Wednesday,

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread hadley wickham
I noticed the coord flip problem during my ggplot investigations. Is this something I can override by getting into the code? The basic problem is all the geoms/stats in ggplot are based around the assumption that we are interested in Y | X, rather than X | Y. I don't think this is an

Re: [R] plot y1 and y2 on one graph

2008-02-27 Thread hadley wickham
Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Before you actually do that, you might want to think about if it's a good idea or not. Are you trying to deliberately mislead or confuse your readers? If so, it's a good idea,

Re: [R] plot y1 and y2 on one graph

2008-02-27 Thread Gabor Grothendieck
There is an example in library(zoo) example(plot.zoo) On Wed, Feb 27, 2008 at 5:05 PM, milton ruser [EMAIL PROTECTED] wrote: Dear all I have a code like x-1:10 y1-x+runif(10)*2 y2-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot

Re: [R] problem with creation of eSet

2008-02-27 Thread Martin Morgan
Hi Manisha -- this is a bioconductor package, so ask on the Bioconductor mailing list. The 'exprSet' class is quite old, and has been replaced by the 'ExpressionSet' class. Update your venison of R and Bioconductor (http://bioconductor.org/download). Then evaluate the commands library(Biobase)

Re: [R] plot y1 and y2 on one graph

2008-02-27 Thread milton ruser
Thanks to all, I reached up to my needs. miltinho Brazil. On 2/27/08, Gabor Grothendieck [EMAIL PROTECTED] wrote: There is an example in library(zoo) example(plot.zoo) On Wed, Feb 27, 2008 at 5:05 PM, milton ruser [EMAIL PROTECTED] wrote: Dear all I have a code like x-1:10

[R] problem of subscript value from vector and list

2008-02-27 Thread Jingru Dai
Hi, everyone I got some problems when trying to subscript the value of vector and list, by using calculated indices. Here is the vector I am generated lon-rep(0,886);lat-rep(0,691) for (i in 1:886){ lon[i]-112+0.05*(i-1) } for (i in 691:1){ lat[i]--44.5+0.05*(691-i) } For a given

Re: [R] multi-level hierarchical logistic regression with sampling weight

2008-02-27 Thread David Winsemius
Rolf Turner [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: On 28/02/2008, at 11:28 AM, GUO, Qian wrote: Hi I would like to run a multi-level hierarchical logistic regression model with sampling weight? Is this possible with R? Yes. In R, all things are *possible*. :-) Is

Re: [R] Calculating monthly var-cov matrix on non-overlapping rooling window basis

2008-02-27 Thread Megh Dal
Thanks Henrique for this mail. It works fine. However I need one more modification. When number of column is 1 then some error is coming : library(zoo) date.data = seq(as.Date(01/01/01, format = %m/%d/%y),as.Date(06/25/02, format = %m/%d/%y), by = 1) len = length(date.data) data1 =

Re: [R] multi-level hierarchical logistic regression with sampling weight

2008-02-27 Thread Charilaos Skiadas
On Feb 27, 2008, at 11:04 PM, David Winsemius wrote: Rolf Turner [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: On 28/02/2008, at 11:28 AM, GUO, Qian wrote: Hi I would like to run a multi-level hierarchical logistic regression model with sampling weight? Is this possible with R?

Re: [R] ggplot2 boxplot confusion

2008-02-27 Thread Chris Friedl
hadley wrote: I noticed the coord flip problem during my ggplot investigations. Is this something I can override by getting into the code? However, there is one geom that is parameterised in the opposite direction: geom_vline. So your second option just draw the density plots with

[R] Very Simple Regression Question

2008-02-27 Thread i_finlayson37
I've just been running my first ever regression and I'm using R for an lmer. I've created two models, a null one (part ~ 1 + (1 | id) + (1 | word)) and another with a predictor I want to test (part ~ 1 + conf + (1 | id) + (1 | word)). I've compared them both and the model with a predictor is

[R] How to read HUGE data sets?

2008-02-27 Thread Jorge Iván Vélez
Dear R-list, Does somebody know how can I read a HUGE data set using R? It is a hapmap data set (txt format) which is around 4GB. After read it, I need to delete some specific rows and columns. I'm running R 2.6.2 patched over XP SP2 using a 2.4 GHz Core 2-Duo processor and 4GB RAM. Any

Re: [R] How to read HUGE data sets?

2008-02-27 Thread Mark W Kimpel
Depending on how many rows you will delete, and if you know in advance which ones they are, one approach is to use the skip argument of read.table. If you only need a fraction of the total number of rows this will save a lot of RAM. Mark Mark W. Kimpel MD ** Neuroinformatics ** Dept. of

Re: [R] How to read HUGE data sets?

2008-02-27 Thread Roy Mendelssohn
I may be mistaken, but I believe R does all it work in memory. If that is so, you would really only have 2 options: 1. Get a lot of memory 2. Figure out a way to do the desired operation on parts of the data at a time. -Roy M. On Feb 27, 2008, at 9:03 PM, Jorge Iván Vélez wrote: Dear

Re: [R] 2D kolmogorov

2008-02-27 Thread Christos Hatzis
Googling MUAC mentioned in that message will take you to the following site with information on the algorithm and apparently access to the code. http://www.acooke.org/jara/muac/index.html -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [R] How to read HUGE data sets?

2008-02-27 Thread Patrick Connolly
On Wed, 27-Feb-2008 at 09:13PM -0800, Roy Mendelssohn wrote: | I may be mistaken, but I believe R does all it work in memory. If | that is so, you would really only have 2 options: | | 1. Get a lot of memory But with a 32bit operating system, 4G is all the memory that can be addressed

[R] Kaiser-Meyer-Olkin

2008-02-27 Thread Robert Kopp
I am a beginner when it comes to using R, though fortunately I already know something about statistics. I think factor analysis should be used sparingly, but I occasionally use it. It doesn't seem to me that factanal() provides Kaiser's Measure of Sampling Adequacy, which should be computed for

  1   2   >