[R] maptools-export owin as shapefile, error message

2010-04-13 Thread Tom Elliott
Hello R users, I am trying to export an object of class "owin" from the Spatstat package to an ESRI shapefile using the package Maptools. I am using the function "writePolyShape"; "pointsp" is an object of class "ppp", "ripras" is a function in SpatStat that creates a polygon around points. I hav

Re: [R] how can I plot the histogram like this using R?

2010-04-13 Thread Tal Galili
Aer you asking how to have more bars on the axis ? That can be controlled using: barplot(stuff, br = 50) # br can be other numbers according to needs. The vertical line can be done with: abline(v=20) # You may change 20 There are other elements to the plot to reproduce, but is this enough for you

Re: [R] how can I plot the histogram like this using R?

2010-04-13 Thread Dennis Murphy
Hi: On Tue, Apr 13, 2010 at 9:45 PM, bbslover wrote: > > I want to get the plot like this, > > http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg > %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87

[R] creating a new corClass for lme()

2010-04-13 Thread Michael Steven Rooney
Hi, I have been using the function lme() of the package nlme to model grouped data that is auto-correlated in time and in space (the data was collected on different days via a moving monitor). I am aware that I can use the correlation classes corCAR1 and corExp (among other options) to model the t

[R] how can I plot the histogram like this using R?

2010-04-13 Thread bbslover
I want to get the plot like this, http://n4.nabble.com/file/n1839303/%25E9%25A2%2591%25E7%258E%2587%25E5%2588%2586%25E5%25B8%2583%25E5%259B%25BE%25E6%25A0%2587%25E5%2587%2586.jpg %E9%A2%91%E7%8E%87%E5%88%86%E5%B8%83%E5%9B%BE%E6%A0%87%E5%87%86.jpg not this, http://n4.nabble.com/file/n1839303/R.jp

Re: [R] R beginner

2010-04-13 Thread azman
I have try again my function from this email.I just copy and paste it on the R software and it doesn't give any problem like before.Did you change anything to my function? Actually before this I have do others about my research and long time not see this function. Thank you very much for your help

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 10:58 PM, RICHARD M. HEIBERGER wrote: The spurious condition (ds==2) is actually interpreted as the action taken by the else statement. Then the braced plot statement is seen as the next statement after the conclusion of the if () {} else () statement. I did ta

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread RICHARD M. HEIBERGER
The spurious condition (ds==2) is actually interpreted as the action taken by the else statement. Then the braced plot statement is seen as the next statement after the conclusion of the if () {} else () statement. [[alternative HTML version deleted]] _

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 5:41 PM, casperyc wrote: === myf=function(ds=1){ x=rnorm(10) y=rnorm(10) { #start of if if (ds==1) { list(x,y) } else (ds==2) { plot(x,y) } } # end of if } # end of function === Hi All, the problem i am having here is, t

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 5:41 PM, casperyc wrote: === myf=function(ds=1){ x=rnorm(10) y=rnorm(10) { #start of if if (ds==1) { list(x,y) } else (ds==2) ?"if" That seems odd. I would expect this function to return TRUE or FAKSE rather than proceeding to a plot function.

[R] Error: could not find function "tsts" tradesys package

2010-04-13 Thread dbonneau
Hi, I am pretty new to R and would like to follow the code in the paper below, tradesys package. but I am stuck at the 2nd page where x<-tsts(spx) is written. Could anyopne help me why I am getting an Error :"could not find function "tsts" ". I guess I need function call "tsts". where can I find

[R] Gaussian Quadrature Numerical Integration In R

2010-04-13 Thread Ines Azaiez
Hi All, I am trying to use A Gaussian quadrature over the interval (-infty,infty) with weighting function W(x)=exp(-(x-mu)^2/sigma) to estimate an integral. Is there a way to do it in R? Is there a function already implemented which uses such weighting function. I have been searching in the sta

[R] [R-pkgs] debug 1.2.2 on CRAN

2010-04-13 Thread Mark.Bravington
Version 1.2.2 of 'debug' is now on CRAN. The debugging facilities offered include code display, graceful error recovery, line-numbered conditional breakpoints, access to exit code, flow control, and full keyboard input. The new version supports debugging of code inside 'try', 'eval', 'evalq', an

[R] [R-pkgs] mvbutils 2.5.1 on CRAN

2010-04-13 Thread Mark.Bravington
Version 2.5.1 of 'mvbutils' is now on CRAN. This version offers improved support for easy package preparation and maintenance, plus minor changes required by the new version of the 'debug' package (see separate announcement). Package 'mvbutils' offers the following main features, as well as a nu

[R] Gaussian Quadrature Numerical Integration In R

2010-04-13 Thread Ines Azaiez
Hi All, I am trying to use A Gaussian quadrature over the interval (-infty,infty) with weighting function W(x)=exp(-(x-mu)^2/sigma) to estimate an integral. Is there a way to do it in R? Is there a function already implemented which uses such weighting function. I have been searching in the sta

Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Alice Johnstone
Hi Greg Thank you, the wmf version looks much better in Word and prints out lovely. The file size is very large for the volcano plots, but the other graphs are smaller than the png ones. I wasn't resizing the png's but I think word was definitely changing them. I only have six volcano plots s

Re: [R] Getting Started with Bayesian MCMC

2010-04-13 Thread Shige Song
Hi Ben, Before you begin playing with BUGS/JAGS, there are several native R packages that deal with a wide variety of Bayesian models that worth considering. Among many others, I find MCMCpack, DPpackage, and MCMCglmm very useful (and convenient). Best, Shige On Tue, Apr 13, 2010 at 7:49 PM, Ben

[R] Getting Started with Bayesian MCMC

2010-04-13 Thread Ben
Hi all, I would like to start to use R's MCMC abilities to compute answers in Bayesian statistics. I don't have any specific problems in mind yet, but I would like to be able to compute/sample posterior probabilities for low-dimensional custom models, as well as handle "standard" Bayesian cases l

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread casperyc
what i am triyng to do is when ds=1 give me a list ds=2 plot Thanks casper -- View this message in context: http://n4.nabble.com/writing-function-plot-and-if-problem-tp1839091p1839125.html Sent from the R help mailing list archive at Nabble.com. _

[R] dbFD computing distinct species wrong?

2010-04-13 Thread Sarah Berke
Hi everyone, I am working with the dbFD function of the FD package, and there's something funny happening with the value of sing.sp in the output. Basically, I have a species-function matrix and a community matrix. One site in particular has 6 species, 4 of which have identical functional codin

[R] liner regression for multiple keys

2010-04-13 Thread newbie_2010
a1 is the first key in input. second column is x-axis and 3rd is y-axis and 4th is its corresponding key. Now for every key in 1st column I would like to calculate LR that gives p value. I tried to manage with a single key. But my problem is that How could I manage multiple keys in input. Thanx in

Re: [R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread Peter Alspach
Tena koe Caspar Try removing the (ds==2) - I'm not sure how you expect R to interpret that. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of casperyc > Sent: Wednesday, 14 April 2010 10:42 a.m. > To: r

[R] writing function ( 'plot' and 'if') problem

2010-04-13 Thread casperyc
=== myf=function(ds=1){ x=rnorm(10) y=rnorm(10) { #start of if if (ds==1) { list(x,y) } else (ds==2) { plot(x,y) } } # end of if } # end of function === Hi All, the problem i am having here is, that I want to be able to control the display, lf

[R] Help in gam() in MGCV

2010-04-13 Thread Chen, Jinsong (jc8ww)
Hello, We have a question about how to retrieve the nonparametric curve in gam() function. Now, we get the estimates and draw the fitted curve using the following code. You can see that our fitted curve is parallel to the output from gam() function but differs by a constant shift. However, the

[R] Simulation problem.

2010-04-13 Thread Piotr Arendarski
Hi, I have problem with simulating. This is my task... Suppose that there are N persons some of whom are sick with influenza. The following assumptions are made: * when a sick person meets a healthy one, the chance is á that the latter will be infected * all encounters are between two persons Wri

[R] filled.contour ON TOP of a base map

2010-04-13 Thread Víctor Homar Santaner
Dear R helpers, Any suggestion on how to make the 2D gaussian to show up ON TOP of the map, instead of below the continents? Example code: library(mapdata) x<-seq(-15,15,.2);y<-seq(30,55,.2) expone<-function(x,y){10*exp(-sqrt(x*x+(y-40)*(y-40))/2)} z<-outer(x,y,expone) filled.contour(x,y,z,l

Re: [R] WinBUGS Question

2010-04-13 Thread Yihui Xie
If you are using R2WinBUGS, I guess you may put them in a loop like: # models ... data_i[j]~dnorm(...) ... # save them in a sequence of files with names like 'model_i.bug' # write.model() might help? # then call bugs() for(i in names.of.your.100.datasets){ bugs(data=i,...,model.file='model_i.bu

[R] WinBUGS Question

2010-04-13 Thread Anamika Chaudhuri
Hi: Is there a way we can set up WINBUGS to run 100 simulated datasets on the same model and output results? Or do we have to call in each dataset at a time and repeat the process 100 times manually? Thanks Anamika [[alternative HTML version deleted]] ___

[R] Network Analysis

2010-04-13 Thread bchaney
Hi, I am working on a project to understand the linkages between various websites. My data currently looks like the following: Variables: Website referral_site_1 referral_site_2 ... destination_site_1 destination_site_2 ... The values in these fields are just websites. So for every website in t

Re: [R] source(,echo=T) doesn't echo final comments

2010-04-13 Thread Peter Ehlers
On 2010-04-13 6:50, Duncan Murdoch wrote: On 12/04/2010 7:14 PM, Kuhn, Alexandre (NIH/NIA/IRP) [V] wrote: Hi, source(file,echo=T) will not echo the last comment in "file" if it is the last line in the file. For instance, when sourcing a file containing the following lines #comment 1 a<-1 #comm

[R] random effect prediction with $frail in survreg

2010-04-13 Thread Nicolas RODE
Dear R users, I'm trying to fit a survival model using the survreg function with a Weibull distribution. I'm using the frailty() function in order to fit a "family" random effect in my model. I would like to calculate the estimate for each observation and I know the predict() function doesn't wor

Re: [R] Smoothing

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 10:58 AM, Danai Katsande wrote: I am trying to plot a smoothing spline to using the following code, and an error pops up: car <- read.table("car.csv",sep=",",header=T) attach(car) names(car) [1] "veh_value" "exposure" "clm" "numclaims" "claimcst0" "veh_body"

Re: [R] stepwise regression-fitting all possible models

2010-04-13 Thread Steve Lianoglou
Hi, On Tue, Apr 13, 2010 at 12:51 PM, aspa wrote: > > Dear All, > > I am new to R and I would like to do the following: > > I want to fit a logistic model with 3 predictors and then perform a stepwise > regression to select the best possible model using either the AIC/BIC > criterion. > > I have

Re: [R] (no subject)

2010-04-13 Thread Steve Lianoglou
Hi, On Tue, Apr 13, 2010 at 11:35 AM, Danai Katsande wrote: > I am trying to plot a smoothing spline to using the following code, and an > error pops up: > >> car <- read.table("car.csv",sep=",",header=T) >> attach(car) >> names(car) >  [1] "veh_value" "exposure"  "clm"       "numclaims" "claimcs

Re: [R] Converting a .txt file into a matrix

2010-04-13 Thread Steve Lianoglou
Hi, On Tue, Apr 13, 2010 at 12:37 PM, cobbler_squad wrote: > > I need to convert foo.txt file into as.matrix > .txt file is a single column of numbers > (i.e. > -0.303904 > -0.889965 > -0.0270313 > -0.387125 > 0.189837 > -0.14858 > -0.651178 > -0.162632 > 0.449309 > ) > > and I need to find out t

[R] Revolutions blog: March Roundup

2010-04-13 Thread David M Smith
I write about R every weekday at the Revolutions blog: http://blog.revolution-computing.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. (Sorry this week's roundup is a little later than usual -- I've was preempted by last week's

[R] Kennard-stone or other uniform subset sampling algorithm?

2010-04-13 Thread Woolner, Keith
Is there any package in R which performs something like the Kennard-Stone uniform mapping algorithm (a.k.a. uniform subset selection)? I've used Rseek.org to search the R-help archives and other resources, and found only the following two mentions. http://tolstoy.newcastle.edu.au/R/e2/help/

Re: [R] import file formatted RFC-822

2010-04-13 Thread Barry Rowlingson
On Tue, Apr 13, 2010 at 6:26 PM, Sebastian Kruk wrote: > Dear R-list users: > > I would like to import a database of web robots, > http://www.robotstxt.org/db/all.txt, it´s formatted RFC-822, ¿how can > I do it? RFC822 looks very much like R's package DESCRIPTION files, and they are read in usin

[R] import file formatted RFC-822

2010-04-13 Thread Sebastian Kruk
Dear R-list users: I would like to import a database of web robots, http://www.robotstxt.org/db/all.txt, it´s formatted RFC-822, ¿how can I do it? The RFC 822 specification defines a standard format for electronic messages, which consists of a set of header fields and an optional body. The header

Re: [R] Generating model formulas for all k-way terms

2010-04-13 Thread Michael Friendly
Beautiful! And thanks for the clean-up -Michael Heather Turner wrote: Hi Michael, You need to substitute the value of i for the symbol i in your formula, i.e. update(mod, substitute(.~.^i, list(i = i))) So, with some other tidying up: Kway <- function(formula, family, data, ..., order=nt) {

Re: [R] Time series and non-integer seconds

2010-04-13 Thread Dirk Eddelbuettel
On 13 April 2010 at 18:49, Jeszenszky Péter wrote: | Hello, | | How to handle time series data if the sampling period is a fraction of | a second? Classes such as POSIXct, chron and timeDate stores only integer | second values. Although class POSIXlt suports fractions of a second, | neither packa

[R] SNPassoc

2010-04-13 Thread Euphoria
Hi guys! I am trying to run an interaction analysis between two SNPs using the SNPassoc package. I keep getting the following two errors: Error: switch Error: y value must be 0 <=y <= 1 Here is my code: myData <-setupSNP (data=InterAll, colSNPs=10:11, sep="") ansCod<-interactionPval(log(ALL)~A

[R] ccf problem (cross-correlation)

2010-04-13 Thread Andrea Picco
Hi all, I have a problem concerning my understanding of the cross-correlation (ccf) function in R. assume a time serie as: > t<-seq(0,6.28,by=0.01); > my_serie<-ts(sin(t),start=0,end=6.28,deltat=0.01) then I generate an other one shifted by 12 time points: > my_shifted_serie<-ts(sin(t),start=0+

[R] Converting a .txt file into a matrix

2010-04-13 Thread cobbler_squad
I need to convert foo.txt file into as.matrix .txt file is a single column of numbers (i.e. -0.303904 -0.889965 -0.0270313 -0.387125 0.189837 -0.14858 -0.651178 -0.162632 0.449309 ) and I need to find out the correct syntax to read in this table as.matrix I tried as.matrix(rea

[R] (no subject)

2010-04-13 Thread Amitoj Chopra
I like to get off the mailing list. thank you. Amitoj [[alternative HTML version deleted]] __ 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

[R] stepwise regression-fitting all possible models

2010-04-13 Thread aspa
Dear All, I am new to R and I would like to do the following: I want to fit a logistic model with 3 predictors and then perform a stepwise regression to select the best possible model using either the AIC/BIC criterion. I have used the stepAIC function which works fine but using this method onl

[R] Time series and non-integer seconds

2010-04-13 Thread Jeszenszky Péter
Hello, How to handle time series data if the sampling period is a fraction of a second? Classes such as POSIXct, chron and timeDate stores only integer second values. Although class POSIXlt suports fractions of a second, neither package zoo nor package xts handle POSIXlt date/time objects. Best r

Re: [R] raise a matrix to a power

2010-04-13 Thread li li
Thanks a lot! I found the funciton. Hannah 2010/4/13 Gustaf Rydevik > On Tue, Apr 13, 2010 at 4:58 PM, li li wrote: > > Hi all, > > I know the operator %*% can do matrix multiplication. Is there a > function > > in R that can raise a matrix to a power? > > Hannah

Re: [R] Smoothing

2010-04-13 Thread Danai Katsande
> > I am trying to plot a smoothing spline to using the following code, and an > error pops up: > > > car <- read.table("car.csv",sep=",",header=T) > > attach(car) > > names(car) > [1] "veh_value" "exposure" "clm" "numclaims" "claimcst0" "veh_body" > > [7] "veh_age" "gender""area"

[R] Hmisc::summarize with a dataframe as input?

2010-04-13 Thread arnaud chozo
Hi all, I'm looking for a function with the same functionalities as Hmisc::summarize but accepting a dataframe as input (not just a vector or a matrix). I'd like to compute the correlation between two variables in my dataframe, grouped according to other variables in the same dataframe. For exemp

[R] Variable selection with quadratic terms

2010-04-13 Thread Sophie Baillargeon
Hi, I am trying to do stepwise variable selection with the function step. I want to allow in the model all main effects, double interactions and quadratic terms. However, I would like to respect the hierarchy of the terms, i.e. a quadratic term can be added to the model only if the main effect

Re: [R] (no subject)

2010-04-13 Thread Danai Katsande
I am trying to plot a smoothing spline to using the following code, and an error pops up: > car <- read.table("car.csv",sep=",",header=T) > attach(car) > names(car) [1] "veh_value" "exposure" "clm" "numclaims" "claimcst0" "veh_body" [7] "veh_age" "gender""area" "agecat""X_O

Re: [R] Excel date to R format

2010-04-13 Thread Ken Takagi
One useful package is "chron": example: library(chron) #convert excel time to date time format etime = 39965.0004549653 orig =chron("12/30/1899"); # "origin" of excel time. date.time = orig + etime; substr(as.character(date.time), 2, 18) # as character without parentheses. HTH, Ken __

Re: [R] sensitivity analysis, input factors

2010-04-13 Thread Szalai Márk
Hi Milton, Thanks for your rapid answer. As far as I know the src is a regression based method and can be separated from model evaluations. However, a screening method like Morris requires that the input factors of  latter model evaluations would be determined by the results of previous evalua

r-help@r-project.org

2010-04-13 Thread Kay Cichini
hello heinz, my mistake, i thought this threads dealt only with tests for 2-level grouping factor. many thanks for the hint! kay -- View this message in context: http://n4.nabble.com/kruskal-wallis-stratified-tp1838210p1838666.html Sent from the R help mailing list archive at Nabble.com. _

[R] Wilks lamda and single discriminant function

2010-04-13 Thread Joël Meunier
Dear R-users, I'm wondering how to obtain Wilks-lambda values when discriminant analyses have only one discriminant function (i.e. 2 categories to discriminate between). The use of manova(predictions~groups, test="Wilks") asks for multiple response and the use of anova(lm(predictions~groups)

Re: [R] Inline Package: void vs return type functions

2010-04-13 Thread Dirk Eddelbuettel
On 13 April 2010 at 05:46, satu wrote: | Dear all, | | After having a look at the "inline" package and also going through the | "Rcpp" package which is tighty related to it, it came to me this question: | | 1) my C/ C++ code has a return type (let say a double[][] or a user define | class) It

Re: [R] Generating model formulas for all k-way terms

2010-04-13 Thread Heather Turner
Hi Michael, You need to substitute the value of i for the symbol i in your formula, i.e. update(mod, substitute(.~.^i, list(i = i))) So, with some other tidying up: Kway <- function(formula, family, data, ..., order=nt) { models <- list() mod <- glm(formula, family, data, ...) mod$call

Re: [R] [RPostgreSQL] Fails to load

2010-04-13 Thread Dirk Eddelbuettel
On 13 April 2010 at 16:29, james wrote: | Hi List, | | Running R 2.10.1 on a fresh install of Windows 7. I get the following | error when loading the RPostgreSQL package. | | | >library(RPostgreSQL) | Loading required package: DBI | Error in inDL(x, as.logical(local), as.logical(now), ...) :

Re: [R] raise a matrix to a power

2010-04-13 Thread Gustaf Rydevik
On Tue, Apr 13, 2010 at 4:58 PM, li li wrote: > Hi all, >   I know the operator %*% can do matrix multiplication. Is there a function > in R that can raise a matrix to a power? >                           Hannah > >        [[alternative HTML version deleted]] > Hi, Have you tried to enter "matr

Re: [R] Inline Package: void vs return type functions

2010-04-13 Thread Romain Francois
Le 13/04/10 15:46, satu a écrit : Dear all, After having a look at the "inline" package and also going through the "Rcpp" package which is tighty related to it, it came to me this question: no. 1) my C/ C++ code has a return type (let say a double[][] or a user define class) 2) I am working

[R] [RPostgreSQL] Fails to load

2010-04-13 Thread james
Hi List, Running R 2.10.1 on a fresh install of Windows 7. I get the following error when loading the RPostgreSQL package. >library(RPostgreSQL) Loading required package: DBI Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared library 'C:/Users/james/Documents/

Re: [R] glmer with non integer weights

2010-04-13 Thread Thomas Lumley
On Tue, 13 Apr 2010, ONKELINX, Thierry wrote: So your respons variable behaves like a continuous variable except that is range is limited to the 0-1 interval. In such a case I would transform the respons variable (e.g. logit, sqrt(arcsin())) and use a gaussian model. A logit-Normal has varianc

[R] how to work with big matrices and the ff-package?

2010-04-13 Thread Anne Skoeries
Hello everyone, I need to create and work with some big matrices that actually have somewhat over 2 million columns and 117 rows. To do some calculations on such big matrices R just needs too much memory for my PC (4GB installed). So I need a solution to work with large datasets. I'm trying to

Re: [R] How to run Shapiro-Wilk test for each grouped

2010-04-13 Thread Thomas Lumley
On Tue, 13 Apr 2010, Yvonnick Noel wrote: Iurie, Noel, thanks a lot. This will help me someday. But I have a question. When we run Shapiro-Wilk test, the homogenity of variances is a mandatory condition? No it is not. An homoscedasticity test only makes sense when you have a grouping factor

Re: [R] sensitivity analysis, input factors

2010-04-13 Thread milton ruser
Hi Szalai I had used only "src" function, and on that case you need to have a vector with your Y variable, and a data-frame with all your X (i.e. explanatory) variables. I have interest on stay in touch with others that have been using sensitivity package! bests milton On Tue, Apr 13, 2010 at

[R] sensitivity analysis, input factors

2010-04-13 Thread Szalai Márk
Hi, I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can’t succeed. The definition of input factors can be the problem. library(sensitivity) #A simple model with 4 input factor to test the morris fun

[R] Master Thesis - R

2010-04-13 Thread Andre
Hello, I would like to do a dissertation related to the R-Project. This will be the final work that I have to do to finish my master degree in Information Management. Essentially I would like to present a work with the principal functionalities of R and perhaps I could also do a development of a

Re: [R] Generating model formulas for all k-way terms

2010-04-13 Thread Joshua Wiley
> > Kway <- function(formula, family, data, ..., order=nt) { > models <- list() > mod <- glm(formula, family, data, ...) > terms <- terms(formula) > tl <- attr(terms, "term.labels") > nt <- length(tl) > models[[1]] <- mod for(i in 2:order) { > models[[i]] <- update(mod, .~.^i) > }

[R] raise a matrix to a power

2010-04-13 Thread li li
Hi all, I know the operator %*% can do matrix multiplication. Is there a function in R that can raise a matrix to a power? Hannah [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://sta

Re: [R] svm of e1071 package

2010-04-13 Thread Shyamasree Saha [shs]
Dear Steve, We have finally managed to run our code. Sparse matrix is helping a lot (I should say without matrix.csr, we would not be able to do it). This time it is taking very small amount of memory while running svm, but we could not use as.matrix.csr directly on our huge data. we had to div

Re: [R] renaming factors *efficiently*

2010-04-13 Thread ONKELINX, Thierry
for(i in colnames(dummy)){ levels(dummy[, i]) <- abbreviate(levels(dummy[, i])) } HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg Gaverstraat 4 9500 Gera

Re: [R] lapply - function with arguments

2010-04-13 Thread Arun.stat
another thought possibly fn = function(n, a=1, b=3) return(n*(a+b)) sapply(1:3, fn) -- View this message in context: http://n4.nabble.com/lapply-function-with-arguments-tp1838373p1838506.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] <<- how/when/why do you use it?

2010-04-13 Thread Duncan Murdoch
On 13/04/2010 10:02 AM, Tal Galili wrote: Hi all, Today I came across scoping in the R intro (after reading Robert Gentleman fortune on lexical scooping) , and a

Re: [R] renaming factors *efficiently*

2010-04-13 Thread Dimitris Rizopoulos
maybe ?abbreviate() could help. Best, Dimitris On 4/13/2010 4:18 PM, Federico Calboli wrote: Hi All, I have a data frame where a couple of columns are factors, with long and complex names. Everything works ok --in R, but I need to export the data so it can be used on a dumber program (one

[R] renaming factors *efficiently*

2010-04-13 Thread Federico Calboli
Hi All, I have a data frame where a couple of columns are factors, with long and complex names. Everything works ok --in R, but I need to export the data so it can be used on a dumber program (one with a three letters name starting with S...). I know that those complex factor names are causing

Re: [R] replace cells with column number

2010-04-13 Thread Dimitris Rizopoulos
supposing that these data are in a matrix, try this: # you original data M <- rbind(c(0,1,0,1), c(0,0,0,1), c(1,0,0,1)) V <- M # we make a copy... V[V == 1] <- col(V)[V == 1] V I hope it helps. Best, Dimitris On 4/13/2010 2:07 PM, burgundy wrote: Hello, I'm trying to replace cells with v

[R] exract Shrinkage intensity lambda and lambda.var

2010-04-13 Thread KZ
does anyone know how to extract Shrinkage intensity lambda and lambda.var values after run cov.shrink(x)? thanks, KZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] replace cells with column number

2010-04-13 Thread burgundy
Hello, I'm trying to replace cells with value 1 with the number of the column. Example below. Thank you! from: 0,1,0,1 0,0,0,1 1,0,0,1 to: 0,2,0,4 0,0,0,4 1,0,0,4 -- View this message in context: http://n4.nabble.com/replace-cells-with-column-number-tp1838289p1838289.html Sent from the R h

[R] Inline Package: void vs return type functions

2010-04-13 Thread satu
Dear all, After having a look at the "inline" package and also going through the "Rcpp" package which is tighty related to it, it came to me this question: 1) my C/ C++ code has a return type (let say a double[][] or a user define class) 2) I am working with an extensive library built by someon

[R] Coloring leaves in Dendrogram according to gene names

2010-04-13 Thread PQuery
Hello, I am a new R user and have a question regarding dendrogram coloring. I would like to color each leaf in the dendrogram (dhc) according to a specific criterion. For me this criterion is the gene name. For this, I created a data.frame with 2 variables: The gene name and the corresponding col

[R] problem solved!

2010-04-13 Thread satu
Dear Uwe Ligges, Douglas and Romain, You were right. After changing to test.dl it worked. After doing that I re run the example provided in the "inline" package and worked well. It seems to me that the problem was that: 1) in the enviroment variables the path didn´t have the \bin folders of R too

[R] Generating model formulas for all k-way terms

2010-04-13 Thread Michael Friendly
For the vcdExtra package, I'm exploring methods to generate and fit collections of glm models, and handling lists of such model objects, of class "glmlist". The simplest example is fitting all k-way models, from k=0 (null model) to the model with the highest-order interaction. I'm having troub

[R] Scales and bwplots

2010-04-13 Thread James Rome
I would like to make a series of bwplots with scales that are the same on each plot. x is hours of the day, so I chose hrs = seq(0, 24, 4) hrlabs = c("0","4","8","12","16","20","") g = bwplot((gdf$tt)~gdf$OnHour | gdf$Runway, data=gdf, ylab="Taxi time (min

Re: [R] lapply - function with arguments

2010-04-13 Thread Randall Wrong
Thank you Jim 2010/4/13 jim holtman > lapply(yourList, f, a=1, b=2) > > On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong > wrote: > >> Dear R users, >> >> I have created a function f of n, a and b : f(n,a,b) >> >> I would like to apply this function several times to some values of n. a >> and

[R] <<- how/when/why do you use it?

2010-04-13 Thread Tal Galili
Hi all, Today I came across scoping in the R intro (after reading Robert Gentleman fortune on lexical scooping) , and am very curious about the <<- assignment. Th

Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Greg Snow
Are you resizing the graphs at all? This can cause the shadows/blur, it is best to create the graphs at the exact size that you will end up using them so that there is no resizing (though I would not trust word to not resize even if you tell it not to). You may also want to try producing wmf f

r-help@r-project.org

2010-04-13 Thread Heinz Tuechler
Sorry for not being precise enough. Here http://tolstoy.newcastle.edu.au/R/help/05/08/11177.html you should find the attachment http://tolstoy.newcastle.edu.au/R/help/att-11177/KW.strat.2005.R I used it, and it seems to work. In some cases some elements of weight may become Inf. Heinz At 1

Re: [R] lapply - function with arguments

2010-04-13 Thread jim holtman
lapply(yourList, f, a=1, b=2) On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong wrote: > Dear R users, > > I have created a function f of n, a and b : f(n,a,b) > > I would like to apply this function several times to some values of n. a > and > b are held constant. I was thinking of using lapply. Ho

Re: [R] transpose but different

2010-04-13 Thread Gabor Grothendieck
Try this. First we use outer to form a matrix such that i,j-th entry is TRUE if i, j are in the same group and unequal and FALSE otherwise. We apply which on the rows of that matrix to get the groups that are associated with the row group. We then cbind the components together using ts class to

Re: [R] Using object.size inside a function

2010-04-13 Thread Duncan Murdoch
On 13/04/2010 8:43 AM, Bos, Roger wrote: When I encounter memory errors, I like to see the size of the objects in memory, so I modified one of the examples: z <- sapply(ls(), function(x) object.size(get(x))) as.matrix(rev(sort(z))[1:10]) This works fine if I run it as is, but if I try t

Re: [R] problems on JGR package and demo() function in Ubuntu linux

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 3:31 AM, Mao Jianfeng wrote: Dear R-helpers I want to express my respect and thankfulness to all of you. An apology to the second post of this query. I have ever asked this question yesterday. Following Mr. Henrik Bengtsson's advice I re-submit this query here. I just swi

[R] lapply - function with arguments

2010-04-13 Thread Randall Wrong
Dear R users, I have created a function f of n, a and b : f(n,a,b) I would like to apply this function several times to some values of n. a and b are held constant. I was thinking of using lapply. How can I do this ? Thank you very much Randall [[alternative HTML version deleted]]

Re: [R] R documentation

2010-04-13 Thread Duncan Murdoch
On 13/04/2010 4:58 AM, sophie bouchet wrote: Dear all, I was used to see an htlm documentation when writing the command lines ?plot help.search("plot") The configuration was changed on my computer and help appears now as a R console window, without link with internet. Where can I change the con

[R] vegan (ordisurf): R² for smoothed surf aces

2010-04-13 Thread Kim Vanselow
Dear r-helpers, I just read in an article by Virtanen et al. (2006) where vegetation-environment relationships are studied by fitting smoothed surfaces on an NMDS ordination using GAMs (Wood 2000). The authors describe, that they used R² as goodness-of-fit statistic, which they compare to the R

Re: [R] Binning Question

2010-04-13 Thread David Winsemius
On Apr 13, 2010, at 12:02 AM, Noah Silverman wrote: David, That helps me a lot. Thanks!!! -N On 4/12/10 9:06 PM, David Winsemius wrote: dat <- as.data.frame(matrix( rnorm(200), 100 , 2)) # bivariate normal n=100 ab <- matrix( c(-5,-5,5,5), 2, 2) # interval [-5,5) x [-5,5) nbin <- c( 2

Re: [R] transpose but different

2010-04-13 Thread jim holtman
try this: > x <- read.table(textConnection(" id group + 1 1 1 + 2 2 1 + 3 3 1 + 4 4 1 + 5 5 2 + 6 6 2 + 7 7 3 + 8 8 3 + 9 9 3 + 10 10 3 + 11 11 3 + 12 12 3"), header=TRUE) > # split by group and process >

Re: [R] source(,echo=T) doesn't echo final comments

2010-04-13 Thread Duncan Murdoch
On 12/04/2010 7:14 PM, Kuhn, Alexandre (NIH/NIA/IRP) [V] wrote: Hi, source(file,echo=T) will not echo the last comment in "file" if it is the last line in the file. For instance, when sourcing a file containing the following lines #comment 1 a<-1 #comment 2 R will echo > #comment 1 > a<-1 W

[R] standard errors, graphical representation of glmer

2010-04-13 Thread Kay Cichini
hi, i did a binomial glmer for a repeated measure design. now i wanted to use some indicator of variance for the fixed eff. of the model for the graphical representations. sd's of the plain incident rates are huge and misleading in that context. thus i thought of extracting se's of the coefficien

[R] Using object.size inside a function

2010-04-13 Thread Bos, Roger
When I encounter memory errors, I like to see the size of the objects in memory, so I modified one of the examples: z <- sapply(ls(), function(x) object.size(get(x))) as.matrix(rev(sort(z))[1:10]) This works fine if I run it as is, but if I try to place it inside a function, I get an erro

  1   2   >