[R] how to compute uncentered (pearson correlation) correlation efficiently

2008-03-07 Thread Ng Stanley
Hi, Seeking suggestions to compute uncentered (pearson correlation) correlation efficiently. corr from stats library works on x and y columns. dist from amap library works on x and y rows. My data layout is slightly different such that row(i) of matrix x is compared to row(i) of matrix y. Than

[R] Deleting rows satisfying a certain condition (sum of some colums>2)

2008-03-07 Thread Katie C
I have a huge matrix and need to delete certain rows. What I need to do is: 1.In each row, calculate the sum of jth column and (J+2)th column 2. If the sum is greater than 2 then that row needs to be deleted. I have a sample matrix and my codes here. It does remove some rows but when it does, it

[R] ask for help on nonlinear fitting

2008-03-07 Thread Ruqiang Liang
I have a table like the following. I want to fit Cm to Vm like this: Cm ~ Cl+Q1*b1*38.67*exp(-b1*(Vm-Vp1)*0.03867)/(1+exp(-b1*(Vm-Vp1)*0.03867))^2+Q2*b2*38.67*exp(-b2*(Vm-Vp2)*0.03867)/(1+exp(-b2*(Vm-Vp2)*0.03867))^2 I use nls, with start=list(Q1=2e-3, b1=1, Vp1=-25, Q2=3e-3, b2=1, Vp2=200). But

Re: [R] parameters for lbfgsb (function for optimization)

2008-03-07 Thread Katie C
I think I did not make myself clear when I asked about lbfgsb (function for optimization) yesterday. I'm writing my functions in C but actual calculation will be done in R by using .Call. To be able to use lbfgsb (using the interfaces defined in header 'R_ext/Applic.h') , I need to supply my funct

Re: [R] Irregular Time Series Issue

2008-03-07 Thread Gabor Grothendieck
I noticed a problem with the merging factors so try using character variables instead: library(zoo) Lines <- "Time Data Time1 Data1 1 b1 e 7 g 4i NA NA 5 k NA NA NA NA " DF <- read.table(textConnection(Lines), header = TRUE, as.i

[R] white lines in large plot

2008-03-07 Thread Paul Winward
Hi, I have a plot with about 2 million points. It should be a fairly dense plot over the reals, but I'm seeing many narrow, white vertical lines uniformly spread in my plot where nothing was plotted. I'm using a period as the plot character. I've played around with the cex parameter, but I

Re: [R] locate the rows in a dataframe with some criteria

2008-03-07 Thread Bill.Venables
i <- with(M, which(x >= 10 & y == "A")) ## will get you the row indices. m <- subset(M, x >= 10 & y == "A") ## will get you the rows themselves -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zhihuali Sent: Saturday, 8 March 2008 1:51 AM To: [EMAIL PROT

Re: [R] Irregular Time Series Issue

2008-03-07 Thread Gabor Grothendieck
The following reads in the series as a data frame and then na.omit's the NA's and converts to zoo. Optionally we can merge them back together aligning them on the times. library(zoo) Lines <- "Time Data Time1 Data1 1 b1 e 7 g 4i NA NA 5 k N

Re: [R] error in random forest

2008-03-07 Thread Nagu
Thank you very much. I'll jump in to the data and verify the consistency between the training and testing variables and their levels. On Fri, Mar 7, 2008 at 5:14 PM, <[EMAIL PROTECTED]> wrote: > The error message is pretty clear, really. To spell it out a bit more, > what you have done is as fo

Re: [R] Irregular Time Series Issue

2008-03-07 Thread Spencer Graves
Have you considered using 'corCAR1' with 'lme' in the 'nlme' package? Hope this helps. Spencer Graves p.s. If you are not familiar with this, I highly recommend Pinheiro, J.C., and Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS (Springer). The "~R\library\nlme\scr

Re: [R] error in random forest

2008-03-07 Thread Bill.Venables
The error message is pretty clear, really. To spell it out a bit more, what you have done is as follows. Your training set has factor variables in it. Suppose one of them is "f". In the training set it has 5 levels, say. Your test set also has a factor "f", as it must, but it appears that in t

Re: [R] boxcox.fit error

2008-03-07 Thread Bill.Venables
As the error message says: the transformation requires positive data Your data has a minimum value at zero. That means it is merely non-negative. Positive means all the values must be greater than zero. Strictly. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] Problems installing packages using the inbuilt facility: "Error i n gzfile(file, "r") : unable to open connection"

2008-03-07 Thread Henrik Bengtsson
Works fine for me on the same setup. Try this and compare (especially the size of the downloaded file): > url <- "http://cran.uk.r-project.org/bin/windows/contrib/2.6/ada_2.0-1.zip";; > download.file(url, basename(url), mode="wb") # Note "wb"!!! trying URL 'http://cran.uk.r-project.org/bin/windo

Re: [R] triple integral: adapt package question

2008-03-07 Thread Ravi Varadhan
Here is a simple-minded approach using indicator functions: fxyz <- function(w) { x <- w[1] y <- w[2] z <- w[3] x*y*z*(y < x) * (z < x) } library(adapt) lower <- rep(0,3) upper <- rep(1, 3) # exact answer is 1/24 = 0.041666 adapt(ndim=3, lower=lower, upper=upper, functn = fxyz, eps=1.e-03) T

Re: [R] Warning: matrix by vector division

2008-03-07 Thread Alexey Shipunov
Dear all, Thank you very much for all your valuable suggestions! Best wishes, Alexey Shipunov __ 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.htm

Re: [R] Warning: matrix by vector division

2008-03-07 Thread Marc Schwartz
Alexey Shipunov wrote: > Dear list, > > I just made a very simple mistake, but it was hard to spot. And I > think that I should warn other people, because it is probably so > simple to make... > > === R code === > > # Let us create a matrix: > (a <- cbind(c(0,1,1), rep(1,3))) > > # [,1] [

Re: [R] Warning: matrix by vector division

2008-03-07 Thread jim holtman
R is working exactly as documented. If you look at how the matrix is stored (column-wise) and then what you are dividing by, you will see that it is doing what you asked (when recycling values): > as.vector(a) [1] 0 1 1 1 1 1 > as.vector(a)/c(2,3) [1] 0.000 0.333 0.500 0.333 0.50

[R] How to Estimate Covariance by Week based on a linear regression model

2008-03-07 Thread Felipe Carrillo
Hi all: I have always used SPSS to estimate weekly covariance based on a linear regression model but have to hard code the model Std. Error and the Mean-Square and then execute one week a the time. I was wondering if someone could give me an idea on how to estimate weekly(WK) covariance usi

Re: [R] Warning: matrix by vector division

2008-03-07 Thread Benilton Carvalho
and you might want to check ?prop.table > prop.table(a, 2) [,1] [,2] [1,] 0.0 0.333 [2,] 0.5 0.333 [3,] 0.5 0.333 or even ?sweep (which will be useful for more complex situations) > sweep(a, 2, colSums(a), "/") [,1] [,2] [1,] 0.0 0.333 [2,] 0.5 0.333

[R] Irregular Time Series Issue

2008-03-07 Thread A Mani
Hello, I have an irregular time series of the form : Time Data Time1 Data1 1 b1 e 7 g 4i NA NA 5 k NA NA NA NA ... (the columns have varying length of NAs after a certain point) Converting this to regular time se

[R] Warning: matrix by vector division

2008-03-07 Thread Alexey Shipunov
Dear list, I just made a very simple mistake, but it was hard to spot. And I think that I should warn other people, because it is probably so simple to make... === R code === # Let us create a matrix: (a <- cbind(c(0,1,1), rep(1,3))) # [,1] [,2] # [1,]01 # [2,]11 # [3,]

Re: [R] Finding Interaction and main effects contrasts for two-way ANOVA

2008-03-07 Thread Thompson, David (MNR)
Dale, Other than the first SAS contrast, does the following demonstrate what your asking for? > summary(twoway) material temp voltage 1:12 50:12 Min. : 20 2:12 65:12 1st Qu.: 70 3:12 80:12 Median :108 Mean :106 3rd Qu.

Re: [R] Combine two columns

2008-03-07 Thread Gabor Grothendieck
Depending on your purpose you might want to look at ?interaction or its synonym : (i.e. a colon) On Fri, Mar 7, 2008 at 4:09 PM, <[EMAIL PROTECTED]> wrote: > Is there a way to combine two columns within a data frame? > > Example data: > > id snp AL1 AL2 > 150030 A B >

Re: [R] Passing function to tapply as a string

2008-03-07 Thread Henrique Dallazuanna
Or perhaps: myfun <- function(fname, ...)match.fun(fname)(...) On 07/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Was wondering if it is possible to pass function name as a parameter > > Yes. This isn't exactly what you wanted, but it demonstrates the > principle. > > x = rnorm(5)

Re: [R] Combine two columns

2008-03-07 Thread Henrique Dallazuanna
Try: transform(x, AL1Al2 = paste(AL1, AL2, sep=''))[-c(3:4)] On 07/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there a way to combine two columns within a data frame? > > Example data: > > id snp AL1 AL2 > 150030 A B > 151030 A A > 15

[R] Combine two columns

2008-03-07 Thread amarkey
Is there a way to combine two columns within a data frame? Example data: id snp AL1 AL2 150030 A B 151030 A A 152030 A B This is what I would like: indvsnp AL1AL2 150030 AB 151030 AA 152030 AB Any help

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Prof Brian Ripley
On Fri, 7 Mar 2008, Max wrote: > Prof Brian Ripley formulated on Friday : >> On Fri, 7 Mar 2008, Max wrote: >> >>> Dear UseRs, >>> >>> I'm curious about the derivative of n!. >>> >>> We know that Gamma(n+1)=n! So when on takes the derivative of >>> Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf)

Re: [R] training svm

2008-03-07 Thread Max Kuhn
Also, see the nearZeroVar function in the caret package. MAx On Fri, Mar 7, 2008 at 7:41 AM, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > On Mar 7, 2008, at 2:17 AM, Oldrich Kruza wrote: > > > Hello Soumyadeep, > > > > if you store the data in a tabular file, then I suggest using standard

[R] triple integral: adapt package question

2008-03-07 Thread Davood Tofighi
Dear All, I have a function f(x,y,z)=exp(x^3+y^4+x^2*y+x*z^2+y/z) over D, where is D={ (x,y,z)| 0 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, self-contained, reproducible code.

[R] [R-pkgs] bayesm version 2.2-0

2008-03-07 Thread Rossi, Peter E.
bayesm version 2.2-0 is now available on CRAN. Major changes include: 1. general density estimation using a Dirichlet Process Prior and a normal base 2. linear instrumental variable models with unknown error distributions (the Bayesian analogue of IV methods). Achieved via DP priors. peter r

Re: [R] zoo object won't plot

2008-03-07 Thread Gabor Grothendieck
1. This is not reproducible. Lines was not provided in reproducible form. Please look at my prior emails and use that form so that one can copy from your post and paste it directly into R and observe the error. 2. What do you mean by does not plot? Do you get an error or does nothing appear? If

[R] error in random forest

2008-03-07 Thread Nagu
Hi, I get the following error when I try to predict the probabilities of a test sample: Error in predict.randomForest(fit.EBA.OM.rf.50, x.OM, type = "prob") : New factor levels not present in the training data I have about 630 predictor variables in the dataset x.OM (25 factor variables and th

Re: [R] Correlation matrix one side with significance

2008-03-07 Thread Martin Kaffanke
Thank you, thats really good and gives me very good information. Thanks, Martin Am Donnerstag, den 06.03.2008, 14:35 -0500 schrieb Chuck Cleland: > On 3/6/2008 2:07 PM, Martin Kaffanke wrote: > > Am Mittwoch, den 05.03.2008, 14:38 -0300 schrieb Henrique Dallazuanna: > >> Try this: > >> > >> On 05

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Ravi Varadhan
Hi max, Prof. Ripley is right. Your problem is that you missed a (-) sign in the exponential. Here is a demonstration showing the agreement between numerical and analytical results: gx <- function(x, n) exp(-x) * x^n * log(x) df <- function(n) {integrate(gx, lower=0, upper=Inf, n=n)$val} lib

Re: [R] Trouble with R CMD check

2008-03-07 Thread Duncan Murdoch
On 3/7/2008 1:53 PM, Shewcraft, Ryan wrote: > Thanks! That's seemed to partially work, but now when I try to load it > in R I get: > > library(polsplineRS) > Error in library.dynam("polspline", pkg, lib) : > shared library 'polspline' not found > Error in library(polsplineRS) : .First.li

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Max
Prof Brian Ripley formulated on Friday : > On Fri, 7 Mar 2008, Max wrote: > >> Dear UseRs, >> >> I'm curious about the derivative of n!. >> >> We know that Gamma(n+1)=n! So when on takes the derivative of >> Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf). >> >> I've tried code like >> >>> in

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Ravi Varadhan
Hi Max, The analytic integral \int _0 ^\Inf exp(-t) t^n log(t) might not converge because the integrand tends to -Inf as t -> 0. So, here is a numerical approach to estimating the derivative of the gamma function: library(numDeriv) fx <- function(x, n) exp(-x) * x^n gf <- function(n) {integrat

[R] zoo object won't plot

2008-03-07 Thread stephen sefick
DateTimeRM61 11/30/2006 12:31NA 11/30/2006 12:46NA 11/30/2006 13:012646784125 11/30/2006 13:16NA 11/30/2006 13:31NA 11/30/2006 13:46NA 11/30/2006 14:012666435177 11/30/2006 14:16NA 11/30/2006 14:31NA 11/30/2006 14:46

Re: [R] Trouble with R CMD check

2008-03-07 Thread Shewcraft, Ryan
Thanks! That's seemed to partially work, but now when I try to load it in R I get: library(polsplineRS) Error in library.dynam("polspline", pkg, lib) : shared library 'polspline' not found Error in library(polsplineRS) : .First.lib failed for 'polsplineRS' -Original Message- Fr

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Prof Brian Ripley
On Fri, 7 Mar 2008, Max wrote: > Dear UseRs, > > I'm curious about the derivative of n!. > > We know that Gamma(n+1)=n! So when on takes the derivative of > Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf). > > I've tried code like > >> integrand<-function(x) {log(x)*exp(x)*x^n} >> integrate(inte

[R] Numerical Integration in 1D

2008-03-07 Thread Max
Dear UseRs, I'm curious about the derivative of n!. We know that Gamma(n+1)=n! So when on takes the derivative of Gamma(n+1) we get Int(ln(x)*exp(-x)*x^n,x=0..Inf). I've tried code like > integrand<-function(x) {log(x)*exp(x)*x^n} > integrate(integrand,lower=0,upper=Inf) It seems that R doesn

Re: [R] Trouble with R CMD check

2008-03-07 Thread Duncan Murdoch
On 3/7/2008 1:21 PM, Shewcraft, Ryan wrote: > Friends, > > I changed one line of a package at the source level and then rebuilt it. > When I run R CMD check, I get an error: You're getting lots of warnings from the compiler; presumably those have nothing to do with you. Then at the end you're g

[R] Trouble with R CMD check

2008-03-07 Thread Shewcraft, Ryan
Friends, I changed one line of a package at the source level and then rebuilt it. When I run R CMD check, I get an error: installing R.css in C:/polsplineRS.Rcheck -- Making package polsplineRS adding build stamp to DESCRIPTION making DLL ... making hareall.d from harea

[R] Problems installing packages using the inbuilt facility: "Error i n gzfile(file, "r") : unable to open connection"

2008-03-07 Thread Kauer, Philipp
Hi I have been trawling the web, FAQs, and R manuals for help on the following issue, but have failed and was wondering if anyone has a solution to the following problem: After having installed R 2.6.2 for Windows (binary), I tried to install various packages. Every time I try loading a packa

Re: [R] R-Logo in \LaTeX

2008-03-07 Thread Gabor Csardi
Jean, On Fri, Mar 07, 2008 at 06:09:35PM +0100, Jean lobry wrote: > Gabor, > > > this is nice, but > > 1) the logo is a bitmap, it is ugly if you resize it > > Sure, it's a bitmap, but the naked eye resolution is only > 100 $\mu$m so that a vectorized solution is overkilling > in most common sit

[R] Time series panel

2008-03-07 Thread GRAHAM LEASK
I have a set of data that consists of a number of biological measurements. The columns are Time that runs from 01/01/2005 to 01/5/2007, Group which has 23 levels and postcode which is nested within group. This is a balanced panel but the number of postcodes differs within groups, from 15 to

[R] confused about CORREP cor.LRtest

2008-03-07 Thread Mark W Kimpel
After some struggling with the data format, non-standard in BioConductor, I have gotten cor.balance in package CORREP to work. My desire was to obtain maximum-likelihood p-values from the same data object using cor.LRtest, but it appears that this function wants something different, which I can

Re: [R] LaTeX in R

2008-03-07 Thread Mario Maiworm
I finally got everything plotted as I had planned. So, thank you again. Sundars suggestion looks more flexible when it comes to large numbers of categories (i.e. sigmas). In the plot I will be using, there are 3 sigmas... I am keen to learn about that bquote and substitute stuff. I will definitely

Re: [R] R-Logo in \LaTeX

2008-03-07 Thread Jean lobry
Gabor, > this is nice, but > 1) the logo is a bitmap, it is ugly if you resize it Sure, it's a bitmap, but the naked eye resolution is only 100 $\mu$m so that a vectorized solution is overkilling in most common situations IMHO. I have to zoom by a factor 1200% to see some pixellization problems

Re: [R] Rpart and bagging - how is it done?

2008-03-07 Thread apjaworski
I would like to thank Brian Ripley and Torsten Hothorn for their quick and thoughtful responses. I rerun the example given by Professor Ripley by just starting R and sourcing the code below and I got slightly different results. Then I ran it again setting the random seed before the sample command

[R] Help with Error!

2008-03-07 Thread hoogeebear
Hi, Can anyone explain the following error?? Error in FUN(newX[, i], ...) : missing observations in cov/cor In addition: Warning message: In FUN(newX[, i], ...) : NAs introduced by coercion svm_modelSAheart1 <- svm(x_training, y_training) is the command i am using.my x/y training are working fi

Re: [R] LaTeX in R

2008-03-07 Thread Sundar Dorai-Raj
Or my personal favorite if the length of mySigma is variable: mySigma <- 2:3 plot(1:10, dnorm(1:10, sd = mySigma[1]), type = 'l') lines(dnorm(1:10,sd = mySigma[2]),lty = 2) leg <- as.expression(lapply(mySigma, function(x) bquote(sigma == .(x legend(x = "topright", lty = c(1,2),legend = leg) T

[R] polygon shapefile from line edge coordinate list

2008-03-07 Thread Murray Richardson
Hello, I am looking for advice on a task I am trying to complete. I have a 4 column dataframe defining the start and end coordinates of line edges (from a CGAL alpha shapes function to define concave hulls from point clusters). I would like to create polygon shapefiles from these line edges,

Re: [R] LaTeX in R

2008-03-07 Thread Uwe Ligges
You might want to read Ligges, U. (2002): R Help Desk: Automation of Mathematical Annotation in Plots. R News 2 (3), 32-34. with an example at the end that meets your requirements: (please note that I removed those ugly ";" mySigma[1] <- 2 mySigma[2] <- 3 plot(1:10, dnorm(1:10, sd = mySigma[1

Re: [R] locate the rows in a dataframe with some criteria

2008-03-07 Thread Henrique Dallazuanna
Try: with(m, which((x >= 10 & y == "A"))) On 07/03/2008, zhihuali <[EMAIL PROTECTED]> wrote: > > Hi, netters, > > This is probably a rookie question but I couldn't find the answer after > hours of searching and trying. > > Suppose there'a a dataframe M: > > x y > 10 A > 13 B > 8

Re: [R] locate the rows in a dataframe with some criteria

2008-03-07 Thread N. Lapidus
Hi Zhihua, M <- data.frame (x=c(10, 13, 8, 11), y=c('A', 'B', 'A', 'A')) which (M$x >= 10 & M$y == 'A') # [1] 1 4 Hope it helps, Nael 2008/3/7 N. Lapidus <[EMAIL PROTECTED]>: > Hi Zhihua, > > M <- data.frame (x=c(10, 13, 8, 11), y=c('A', 'B', 'A', 'A')) > which (M$x >= 10 & M$y == 'A') > # [1]

Re: [R] LaTeX in R

2008-03-07 Thread Mario Maiworm
Finally, this should work for an array of sigmas. I just realized that the substitute()-command is not evaluated within a c()-environment :( mySigma[1] <- 2; mySigma[2] <- 3; plot(1:10, dnorm(1:10, sd = mySigma[1]), type = 'l') ; lines(dnorm(1:10,sd = mySigma[2]),lty = 2); legend(x = "topright", l

Re: [R] locate the rows in a dataframe with some criteria

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 10:50 AM, zhihuali wrote: > > Hi, netters, > > This is probably a rookie question but I couldn't find the answer > after hours of searching and trying. > > Suppose there'a a dataframe M: > > x y > 10 A > 13 B > 8 A > 11 A > > I want to locate the rows where x >=

[R] locate the rows in a dataframe with some criteria

2008-03-07 Thread zhihuali
Hi, netters, This is probably a rookie question but I couldn't find the answer after hours of searching and trying. Suppose there'a a dataframe M: x y 10 A 13 B 8 A 11 A I want to locate the rows where x >=10 and y="A". I know how to do it to vectors by using which, but how t

[R] boxcox.fit error

2008-03-07 Thread Alexys Herleym Rodriguez Avellaneda
Hi, Thakns all for your help I am doing the next in my dataframe tabla, column pend1, because the Lilliefors (Kolmogorov-Smirnov) test give me a pvalue < alfa. (data no normal distribution). I need do a transformation with box-cox or other: > bc <- boxcox.fit(tabla$pend1) R send to me: Error in

Re: [R] R-Logo in \LaTeX (Mag. Ferri Leberl)

2008-03-07 Thread Gabor Csardi
Jean, this is nice, but 1) the logo is a bitmap, it is ugly if you resize it, 2) you don't need a pdf version for pdflatex, it handles jpg (and maybe also png as well), so you can just use the logos at the R developer site. It would be really nice to have a non-bitmap version, though. If it e

Re: [R] LaTeX in R

2008-03-07 Thread Uwe Ligges
Mario Maiworm wrote: > Thank you, uwe and jeremy. I was actually looking exactly for that! But > something still doesn't work: > I want to plot a symbol in a legend of a plot, lets say "\sigma = 2". 2 > should be the value of a variable. So, when I try > > mySigma=2;plot(1:10,dnorm(1:10,sd=mySi

Re: [R] LaTeX in R

2008-03-07 Thread Mario Maiworm
Thank you, uwe and jeremy. I was actually looking exactly for that! But something still doesn't work: I want to plot a symbol in a legend of a plot, lets say "\sigma = 2". 2 should be the value of a variable. So, when I try mySigma=2;plot(1:10,dnorm(1:10,sd=mySigma),type='l') legend(x="topright",

[R] How to do a time-stratified case-crossover analysis for air pollution data? Unformatted text-version, with an additional note

2008-03-07 Thread Nilsson Fredrik X
Dear Experts, I am trying to do a time-stratified case-crossover analysis on air pollution data and number of myocardial infarctions. In order to avoid model selection bias, I started with a simple simulation. I'm still not sure if my simulation is right. But the results I get from the "ts-ca

Re: [R] R-Logo in \LaTeX (Mag. Ferri Leberl)

2008-03-07 Thread Jean lobry
Dear Mag. Ferri Leberl, I'm using something like: --- tex.tex --- \documentclass{article} \usepackage{graphicx} \usepackage{fancyvrb} \newcommand{\Rlogo}{\protect\includegraphics[height=1.8ex,keepaspectratio]{Rlogo.pdf}} \newcommand{\myinput}[1] {\begin

[R] How to do a time-stratified case-crossover analysis for air pollution data?

2008-03-07 Thread Nilsson Fredrik X
Dear Experts, I am trying to do a time-stratified case-crossover analysis on air pollution data and number of myocardial infarctions. In order to avoid model selection bias, I started with a simple simulation. I'm still not sure if my simulation is right. But the results I get from the "ts

Re: [R] R code for selecting places spatially and by time

2008-03-07 Thread Ben Bolker
Andrew McFadden maf.govt.nz> writes: > > > Hi all > > The code of trying to write relates to selecting properties (given by x > and y co-ordinates) spatially (distance "X" from "infected" properties > identified by date) over a certain time period. > > i.e. what properties are within 3 km fro

Re: [R] R code for selecting places spatially and by time

2008-03-07 Thread Felix Andrews
Andrew, You haven't defined the problem clearly, but I will try to guess what you mean... > i.e. what properties are within 3 km from properties infected on > "2008-01-01" over the last 14 days. I'm guessing that each row of your sample data represents one infection event, and you want to find

Re: [R] How to plot raster obtained from readRAST6 in grey scale?

2008-03-07 Thread Uwe Ligges
Rainer M Krug wrote: > Hi > > I have a raster which I would like to plot in a greyscale instead of > colour. Is this possible, and how? Probably, and we may tell you how given you tell us what "raster" means: > ?raster No documentation for 'raster' in specified packages and libraries: you cou

Re: [R] Error

2008-03-07 Thread Uwe Ligges
Carla Rebelo wrote: > Hello! > > I need some help, because I don't know how this error means: Error: > variables ‘Output1’, ‘Output2’, ‘Output3’, ‘Output4’, ‘Output5’ were > specified with different types from the fit Please read the posting guide! Please tell us at least what produced the er

Re: [R] LaTeX in R

2008-03-07 Thread Uwe Ligges
Mario Maiworm wrote: > Dear Rers, > I understand that I can include R-code in LaTeX using Sweave. Is there a way > to do it the other way round? Particularly, I need some TeX symbols in the > legend of an R-plot. This can be done in matlab easily, so I am optimistic > with R. Any suggestions for

Re: [R] Error

2008-03-07 Thread Richard . Cotton
> >> I need some help, because I don't know how this error means: Error: > >> variables ?Output1?, ?Output2?, ?Output3?, ?Output4?, ?Output5? were > >> specified with different types from the fit > >> Execution halted > I have two tables and I join them like this: tabela <- > data.frame(dados.i

Re: [R] Odp: mean and sd with number of values?

2008-03-07 Thread Petr PIKAL
Hi Martin Kaffanke <[EMAIL PROTECTED]> napsal dne 06.03.2008 18:05:03: > > Am Donnerstag, den 06.03.2008, 17:47 +0100 schrieb Petr PIKAL: > > Hi > > > > [EMAIL PROTECTED] napsal dne 06.03.2008 17:41:06: > > > > > Hi there, > > > > > > When i do > > > > > > mean(fl[1:20], na.rm=T) > > > > e

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 8:41 AM, Rainer M Krug wrote: >> >> I'm not sure I understand it, why don't you want to just number the >> subfigures in the order in which you will draw them? > > Because i thought it would be easier the other way round? Thanks > anyway Yes, I agree it should not be as har

[R] LaTeX in R

2008-03-07 Thread Mario Maiworm
Dear Rers, I understand that I can include R-code in LaTeX using Sweave. Is there a way to do it the other way round? Particularly, I need some TeX symbols in the legend of an R-plot. This can be done in matlab easily, so I am optimistic with R. Any suggestions for a command or package? Best, Mari

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Rainer M Krug
On 07/03/2008, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > On Mar 7, 2008, at 8:02 AM, Rainer M Krug wrote: > > > On 07/03/2008, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > >> On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: > >> > >>> Hi > >>> > >>> I created a complex layout with usin

Re: [R] Passing function to tapply as a string

2008-03-07 Thread Richard . Cotton
> Was wondering if it is possible to pass function name as a parameter Yes. This isn't exactly what you wanted, but it demonstrates the principle. x = rnorm(5) [1] -0.6510448 0.4591730 1.3225205 1.2314391 -0.0888139 myfun <- function(fname, x) eval(parse(text=paste(fname,"(x)",sep=""))) myfu

Re: [R] Rpart and bagging - how is it done?

2008-03-07 Thread Torsten Hothorn
On Fri, 7 Mar 2008, Prof Brian Ripley wrote: > I believe that the procedure you describe at the end (resampling the cases) > is the original interpretation of bagging, and that using weighting is > equivalent when a procedure uses case weights. > > If you are getting different results when repl

Re: [R] Error: file association for 'doc\html\index.html' not available or invalid

2008-03-07 Thread Jon Olav Vik
On 3/7/08, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > Today HTML help stopped working. The menu command "Help > Html help" > usually > > brings up my default web browser (Opera 9.26), but now R gives the error > > Error: file association for 'doc\html\index.html' not available or invalid

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 8:02 AM, Rainer M Krug wrote: > On 07/03/2008, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: >> On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: >> >>> Hi >>> >>> I created a complex layout with using layout() and it looks >>> exactly as >>> I need it. But I don't want to print

Re: [R] Error

2008-03-07 Thread Richard . Cotton
> I need some help, because I don't know how this error means: Error: > variables ?Output1?, ?Output2?, ?Output3?, ?Output4?, ?Output5? were > specified with different types from the fit > Execution halted > > Can you help me? No! Please read the posting guide at http://www.R-project.org/posti

Re: [R] training svm

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 2:17 AM, Oldrich Kruza wrote: > Hello Soumyadeep, > > if you store the data in a tabular file, then I suggest using standard > text-editing tools like cut (say your file is called data.csv, fields > are separated with commas and you want to get rid of the third and > sixth colum

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Rainer M Krug
On 07/03/2008, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: > > > Hi > > > > I created a complex layout with using layout() and it looks exactly as > > I need it. But I don't want to print in the order in which the > > subfigure are numbered,

Re: [R] How to navigate in layout() created graph?

2008-03-07 Thread Charilaos Skiadas
On Mar 7, 2008, at 7:18 AM, Rainer M Krug wrote: > Hi > > I created a complex layout with using layout() and it looks exactly as > I need it. But I don't want to print in the order in which the > subfigure are numbered, but in a different order. > > How can I navigate in the layout so that I can s

Re: [R] Help with 'memory not mapped'

2008-03-07 Thread Ramon Diaz-Uriarte
Dear Javier, On Fri, Mar 7, 2008 at 1:09 PM, <[EMAIL PROTECTED]> wrote: > Dear Ramon, > I'm afraid I'm the author of the C function. Although I'm not a 'real' Oh, oh... that's too bad. There is not anyone else to blame, then :-). > programmer I need to do some programming in my research wo

[R] Error

2008-03-07 Thread Carla Rebelo
Hello! I need some help, because I don't know how this error means: Error: variables ‘Output1’, ‘Output2’, ‘Output3’, ‘Output4’, ‘Output5’ were specified with different types from the fit Execution halted Can you help me? Thank You __ R-help@r-projec

[R] How to plot raster obtained from readRAST6 in grey scale?

2008-03-07 Thread Rainer M Krug
Hi I have a raster which I would like to plot in a greyscale instead of colour. Is this possible, and how? Thanks Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Plant Conservation Unit Department of Botany University of Cape Town Rondebosch 7701 South Africa

[R] How to navigate in layout() created graph?

2008-03-07 Thread Rainer M Krug
Hi I created a complex layout with using layout() and it looks exactly as I need it. But I don't want to print in the order in which the subfigure are numbered, but in a different order. How can I navigate in the layout so that I can specify the subfigure in which to plot? At the moment I am usi

Re: [R] Help with 'memory not mapped'

2008-03-07 Thread jgarcia
Dear Ramon, I'm afraid I'm the author of the C function. Although I'm not a 'real' programmer I need to do some programming in my research work. As you say, I've used MAKEFLAGS="CFLAGS=-O1", and valgrind, with the expression you've said. The content of the log file contains three blocks of the typ

Re: [R] dictionary lookup

2008-03-07 Thread Thomas Manke
Duncan Murdoch wrote: > On 06/03/2008 6:45 PM, Thomas Manke wrote: >> Hi, >> >> I have a character-valued vector (old_names) and want to translate >> its entries whenever possible, using a dictionary (dict=data.frame). >> The translation direction is dict$V3 --> dict$V2, but >> some values may be

Re: [R] Error: file association for 'doc\html\index.html' not available or invalid

2008-03-07 Thread Prof Brian Ripley
On Fri, 7 Mar 2008, Jon Olav Vik wrote: > Today HTML help stopped working. The menu command "Help > Html help" usually > brings up my default web browser (Opera 9.26), but now R gives the error > Error: file association for 'doc\html\index.html' not available or invalid > If I try the same menu co

Re: [R] Passing function to tapply as a string

2008-03-07 Thread Henrique Dallazuanna
Yes, tapply(rnorm(100), gl(5,20), "max") On 07/03/2008, Yuri Volchik <[EMAIL PROTECTED]> wrote: > > Hi, > > Was wondering if it is possible to pass function name as a parameter, smth > along this line > > param.to.pass<-c(1,'max','h') > > dd<-function(dfd, param=param.to.pass,...){ > ttime

[R] Reading microsoft .xls format and openoffice OpenDocument files

2008-03-07 Thread Ajay Shah
1. I have used gdata::read.xls() with much happiness. But every now and then it breaks. I have not, as yet, been able to construct a mental model about the class of .xls files for which it works. Does someone have a simple rule for predicting the circumstances under which it will work?

[R] Passing function to tapply as a string

2008-03-07 Thread Yuri Volchik
Hi, Was wondering if it is possible to pass function name as a parameter, smth along this line param.to.pass<-c(1,'max','h') dd<-function(dfd, param=param.to.pass,...){ ttime.int <- format(ttime,fmt) data.frame( param[3] = tapply(dfd[,param[1]],ttime.int,param[3]), ...) }

Re: [R] using xyplot with groups and panel.linejoin

2008-03-07 Thread Dieter Menne
sms.ed.ac.uk> writes: > I am using xyplot() with many groups like this: > > statselect <- levels(dat$stat) > xyplot(relmse~T|lambda, groups=stat, data=dat, >panel = panel.superpose, >key=simpleKey(statselect, lines=T)) > Add lty="l". And remove the panel=panel.superpose, it's

[R] [R-pkgs] Packages micEcon, sampleSelection, and maxLik

2008-03-07 Thread Arne Henningsen
Dear R Users: We have splitted up the micEcon package into three packages: a) Package "maxLik" provides tools for maximum likelihood estimations (see http://www.maxLik.org). b) Package "sampleSelection" provides tools for estimating Heckman-type sample selection/generalized tobit models (see h

[R] Error: file association for 'doc\html\index.html' not available or invalid

2008-03-07 Thread Jon Olav Vik
Today HTML help stopped working. The menu command "Help > Html help" usually brings up my default web browser (Opera 9.26), but now R gives the error Error: file association for 'doc\html\index.html' not available or invalid If I try the same menu command a second time, R crashes with the message

Re: [R] legend for several graphics

2008-03-07 Thread Georg Otto
Thanks a lot, John, Gavin; Hadley and Greg, for your helpful comments and suggestions. I finally achieved what I wanted using the suggested method from Gavin with corrections from Greg. Out of curiosity (and interest to learn): Hadley, how would you simplify that code using lattice or ggplot and h

Re: [R] Help with 'memory not mapped'

2008-03-07 Thread Ramon Diaz-Uriarte
Dear Javier, >From your description, it seems you are not the author of the C function rrfunc, which is where the problem is probably located (the segmentation fault is most likely a pointer related problem where the C code is trying to do something with memory it should not be trying to do). Depe

[R] using xyplot with groups and panel.linejoin

2008-03-07 Thread k . m . csillery
Dear All, I am using xyplot() with many groups like this: statselect <- levels(dat$stat) xyplot(relmse~T|lambda, groups=stat, data=dat, panel = panel.superpose, key=simpleKey(statselect, lines=T)) However, I want lines not scatterplots and if I set panel.groups=panel.linejoin that

  1   2   >