Re: [R] envelope in spatstat

2010-04-14 Thread Turner Rolf
Comments in-ine below. Tom Richardson wrote: Hi R users, This query is regarding the use of the 'envelope' function in Spatstat. My data can be represented as a point process with CONTINUOUS marks: points <- ppp(x=x,y=y, marks=m, window= wind) However the marks are alignments (lines), and so

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Petr PIKAL
Hi Bert Gunter napsal dne 14.04.2010 18:54:37: > > > Petr Pikal wrote: > > "... > > I mean that you can use > > fit<- lm(y~x+I(x^2)) > coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 > > but you can not use > > fit<- lm(y~poly(x,2)) > coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 " >

Re: [R] nlsList{nlme} control of min and max parameter bounds?

2010-04-14 Thread Dieter Menne
.. and do not forget that the real power comes from using nlme after nlsList; i.e. on the result of nlsList, even if some did not converge! The effect of taming outliers can be amazing. See Pinheiro/Bates or http://www.menne-biomed.de/gastempt/index.html Dieter From: Steve Oswald [

[R] Regression w/ interactions

2010-04-14 Thread Michael Dykes
I have a project due in my Linear Regression class re: regression on a data set & my professor gave us a hint that there were *exactly *2 sig interactions. The data set is attached. We have to find which predictors are significant, & which 2 interactions are sig. Also, I nedd some guidance for this

Re: [R] search and replace

2010-04-14 Thread Erik Iverson
Chuck wrote: I have a dataframe with almost a million rows which has one column with strings. That column has several entries with the words "South", "North", "East" and "West" which I would like to replace with S, N, E, and W, respectively. Obviously, I can use gsub multiple times df $col2 <-

Re: [R] search and replace

2010-04-14 Thread Dennis Murphy
Hi: Does this work for you? > x <- sample(c('AB', 'ABC', 'ABCD', 'East', 'West', 'North', 'South'), + 100, replace = TRUE) > table(x) x AB ABC ABCD East North South West 14111514131617 > x2 <- ifelse(x %in% c('East', 'West', 'North', 'South'), strt

Re: [R] nlsList {nlme} - control arguments problem

2010-04-14 Thread Steve Oswald
Hi Rick Thanks to Dieter Menne I did manage to solve the problem of imposing bounds on the parameter space duirng an nlsList fit. He suggested using optim to optimize the parameters prior to each fit. This worked well for me as I had a customized selfStart function that then optimized the paramet

[R] classes and functions for qqnorm and stem

2010-04-14 Thread Uwe Dippel
Referring to "Using R for Data Analysis and Graphics" by J H Maindonald, and available from the R site, I found the example on p.30 non-working: > stem(qqnorm(possum$hdlngth)) Error in stem(qqnorm(possum$hdlngth)) : 'x' must be numeric Since qqnorm(possum$hdlngth) plots, and > class(possum$hdlngt

[R] sequence clustering and assembly

2010-04-14 Thread Bogdan Tanasa
Dear all, please could you suggest any R functions or packages (or external programs), that a. take as input a large number (> 10 000) of short 20-30 nt sequences, and do sequence assembly, to reconstruct larger (extended) 30-50 sequences ? b. take as input a larger number of sequences (100 000

Re: [R] nlsList{nlme} control of min and max parameter bounds?

2010-04-14 Thread Steve Oswald
Thanks Dieter That solved the issue. I had negative parameters but I customized a selfStart function which contained the following lines for the optimization of my five parameter function (entered in the vector 'value'): #function to optimize func1 <- function( value) { A = value[1] k =

Re: [R] Summarization

2010-04-14 Thread Pete B
Dennis Very nice! Thanks Pete -- View this message in context: http://n4.nabble.com/Summarization-tp1840718p1840730.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] lme posthoc comparisons in R

2010-04-14 Thread Romina Rader
Hi there, I was hoping to post this message. Im hoping I;ve got the right spot?! Hi there, sorry for basic question but im very new to R. Im trying to run a lme model with two categorical variables, each having 6 (for the explanatory variable C.f) and 5 levels (for expl. variable D.f) respect

Re: [R] sum specific rows in a data frame

2010-04-14 Thread Chuck
Depending on the size of the dataframe and the operations you are trying to perform, aggregate or ddply may be better. In the function below, df has the same structure as your dataframe. Check out this code which runs aggregate and ddply for different dataframe sizes.

[R] Non-parametric Tests for location in R

2010-04-14 Thread maithili davda
How do I do the sign test and the sign rank test that SAS gives as an output in proc univariate in R? sign.test and wilcox.test do not give the same output. Also how do you pick what output you want displayed in R? like if I want only the test statistic and p value displayed and nothing else how

[R] search and replace

2010-04-14 Thread Chuck
I have a dataframe with almost a million rows which has one column with strings. That column has several entries with the words "South", "North", "East" and "West" which I would like to replace with S, N, E, and W, respectively. Obviously, I can use gsub multiple times df $col2 <- gsub("West", "W

[R] fImport - yahooKeystats

2010-04-14 Thread Makwana
I have written a simple querty where I am trying to download all Keystats for NASDAQ tickers using the following code:- library (fImport) library (Matrix) #reading csv list of NASDAQ tickers into matrix; x = read.csv(file = "C:\\D Drive\\UChicago\\SV_Project\\Matlab\\list.csv",head = F, sep=

Re: [R] Summarization

2010-04-14 Thread Dennis Murphy
Hi: Try this: with(rle(x), data.frame(Level = values, Count = lengths)) Level Count 1 1 3 2 0 4 3 1 2 4 0 3 5 1 2 6 0 1 HTH, Dennis On Wed, Apr 14, 2010 at 7:11 PM, Pete B wrote: > > Hi All > > I have a vector x containing 2 levels > > x = c(1

Re: [R] R interactive input like C++

2010-04-14 Thread 余舟
Huhu, Thank you for all you guys. readline works. I hope R can be more and more powerful to deal with strings. Thank you so much; Zhou 2010/4/14 Erik Iverson > David Scott wrote: > >> Erik Iverson wrote: >> >>> ?? wrote: >>> Thank you for your reply. My objective is simple. Ass

[R] Summarization

2010-04-14 Thread Pete B
Hi All I have a vector x containing 2 levels x = c(1,1,1,0,0,0,0,1,1,0,0,0,1,1,0) I would like to derive the following summarization Level Count 1 3 0 4 1 2 0 3 1 2 0 1 I have generated an inelegant solution using lags and loops but feel sure that there must be a better approach. If anyone ha

[R] graphic question

2010-04-14 Thread Tighiouart, Hocine
Hello, I have a simple question that I could not really figure out. I am plotting labels within a graph using the text function. I first plot the first label by specifying the x and y coordinates on the graph. Then to plot the second label next to it, I am using te strwidth function to get the

Re: [R] predict.lm with NAs

2010-04-14 Thread Wincent
see ?na.exclude you can set na.action='na.exclude' when fit the model. On 15 April 2010 09:06, Martin Batholdy wrote: > Hi, > > I wanted to use the predict.lm() function to compare the empirical data with > the predicted values. > The problem is that I have NAs in my data. > > I wanted to cbin

Re: [R] R interactive input like C++

2010-04-14 Thread Erik Iverson
David Scott wrote: Erik Iverson wrote: ?? wrote: Thank you for your reply. My objective is simple. Assume I have a constant vector, say Vector. in C++ code, I want to do: int index; cout<<"Please enter the index of the element you want to look at Vector :"; cin>>index cout

Re: [R] R interactive input like C++

2010-04-14 Thread David Scott
Erik Iverson wrote: ?? wrote: Thank you for your reply. My objective is simple. Assume I have a constant vector, say Vector. in C++ code, I want to do: int index; cout<<"Please enter the index of the element you want to look at Vector :"; cin>>index cout

[R] histogram

2010-04-14 Thread Santosh
Dear R gurus... How do I control "smoothing" of a density plot in panel.densityplot when using histogram? Thanks much, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] R interactive input like C++

2010-04-14 Thread Lukas Schefczyk
?readline HTH Lukas Schefczyk -- From: "??" Sent: Thursday, April 15, 2010 2:40 AM To: "Erik Iverson" Cc: Subject: Re: [R] R interactive input like C++ Thank you for your reply. My objective is simple. Assume I have a constant vector, say Vec

[R] predict.lm with NAs

2010-04-14 Thread Martin Batholdy
Hi, I wanted to use the predict.lm() function to compare the empirical data with the predicted values. The problem is that I have NAs in my data. I wanted to cbind my data.frame with the empirical values with the vector I get from predict.lm. But they don't have the same length because predict.

Re: [R] R interactive input like C++

2010-04-14 Thread Erik Iverson
?? wrote: Thank you for your reply. My objective is simple. Assume I have a constant vector, say Vector. in C++ code, I want to do: int index; cout<<"Please enter the index of the element you want to look at Vector :"; cin>>index cout

Re: [R] how to draw multiple vertical bands

2010-04-14 Thread Felix Andrews
There is panel.xblocks() in the latticeExtra package: http://latticeextra.r-forge.r-project.org/#panel.xblocks and a corresponding base graphics function xblocks() in the development version of the zoo package (not in the current CRAN release). On 15 April 2010 00:36, senne wrote: > hi R gurus

Re: [R] R interactive input like C++

2010-04-14 Thread 余舟
Thank you for your reply. My objective is simple. Assume I have a constant vector, say Vector. in C++ code, I want to do: int index; cout<<"Please enter the index of the element you want to look at Vector :"; cin>>index cout< > ?? wrote: > >> Hi, >> >> Does R have some way to function as the c

Re: [R] R interactive input like C++

2010-04-14 Thread Erik Iverson
?? wrote: Hi, Does R have some way to function as the cin object in C++ like I generate a integer variable x in R, and I want the user to input the value x, like in C++ cin>>x See ?scan __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] R interactive input like C++

2010-04-14 Thread 余舟
Hi, Does R have some way to function as the cin object in C++ like I generate a integer variable x in R, and I want the user to input the value x, like in C++ cin>>x I have been using R as a statistics graduate students for 2 years but never know any function similar like this. Any suggestion w

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

2010-04-14 Thread Víctor Homar Santaner
Anyone? [[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.html and provide commented, minimal, self-con

Re: [R] how to draw multiple vertical bands

2010-04-14 Thread jim holtman
?rect On Wed, Apr 14, 2010 at 10:36 AM, senne wrote: > hi R gurus > > I saw some graphs with vertical band like this one: > > http://pragcap.com/wp-content/uploads/2010/04/GS.png > > how to draw the blue band in R, can't find any clue to do this,any ideas? > > thanks in advance > >[[alte

Re: [R] Ranking correlation with R

2010-04-14 Thread David Nemer
Hello Guys, thank you all very much for the help! Sorry for my total lack of knowledge in R... so I did the correlation.. and got these results: > cor(A, C, method = "spearman") >[1] 0.4922165 > cor(B, C, method = "spearman") >[1] 0.1922412 > cor(A, B, method = "spearman") > [1] -0.00889328 I do

Re: [R] R package documentation

2010-04-14 Thread David Scott
Sébastien Bihorel wrote: Thanks Tobias, If there is no automated way to combine both documents, I will stack them manually... that will likely cause some problems with page numbering tough. Sebastien There was a thread a while back (this year) about someone who wanted to incorporate his pac

Re: [R] Sig differences in Loglinear Models for Three-Way Tables

2010-04-14 Thread Charles C. Berry
See comments in line. On Wed, 14 Apr 2010, Sachi Ito wrote: Hi all, I've been running loglinear models for three-way tables: one of the variables having three levels, and the other two having two levels each. An example looks like below: yes.no <- c("Yes","No") switch <- c("On","Off")

Re: [R] curve

2010-04-14 Thread Ben Bolker
Dwayne Blind gmail.com> writes: > How can I use "curve" with a function of two variables ? see "curve3d" in the emdbook package. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] liner regression for multiple keys

2010-04-14 Thread Ben Bolker
newbie_2010 gmail.com> writes: > 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 >

[R] curve

2010-04-14 Thread Dwayne Blind
Dear R users, How can I use "curve" with a function of two variables ? Thank you very much, Dwayne [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

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

2010-04-14 Thread Erik Iverson
Peter Ehlers wrote: I think that this package is very much in the early stages of development. It may be that the tsts function is still just a gleam in the eyes of the developers. The paper that you cite may be ahead of code development. Yes, in my reply I assumed behind, but 'ahead' is cer

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

2010-04-14 Thread Peter Ehlers
I think that this package is very much in the early stages of development. It may be that the tsts function is still just a gleam in the eyes of the developers. The paper that you cite may be ahead of code development. -Peter Ehlers On 2010-04-14 10:20, dbonneau wrote: Thank you so much for y

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

2010-04-14 Thread Erik Iverson
You need to take this up with the package authors. After I install tradesys, and type vignette("tradesys"), I get a PDF that no longer contains the example in the PDF you reference from the web. That particular version of the PDF that you reference is probably no longer relevant to the packag

[R] Conflict plot.circular and layout() using different column width of the layout matrix

2010-04-14 Thread Daniela Buesser
Hi I am trying to make a figure with several subfigure using the layout(). The subfigures include circular plots (package:circular). When I use different widths of the columns (layout(matrix(1:6, 2,3), width=c(1,1.5,1))) the circular plots in the first row have an elliptic and unpredictible sha

[R] envelope in spatstat

2010-04-14 Thread T.O. Richardson
Hi R users, This query is regarding the use of the 'envelope' function in Spatstat. My data can be represented as a point process with CONTINUOUS marks: points <- ppp(x=x,y=y, marks=m, window= wind) However the marks are alignments (lines), and so have to be treated differently to normal scal

[R] how to draw multiple vertical bands

2010-04-14 Thread senne
hi R gurus I saw some graphs with vertical band like this one: http://pragcap.com/wp-content/uploads/2010/04/GS.png how to draw the blue band in R, can't find any clue to do this,any ideas? thanks in advance [[alternative HTML version deleted]]

[R] Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)

2010-04-14 Thread Christos Argyropoulos
Hi, I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can select the order of the derivative penalty. For my particular problem the order of the penalty (parameter "m" inside the "s" terms of the formula argument) appe

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

2010-04-14 Thread dbonneau
Thank you so much for your reply. On the first page of the paper, there are logics which I typed > library(tradesys) > library(TTR) > data(spx) > tail(spx) ,and it runs smoothly. But it gives me an error at x <- tsts(spx) Thanks, db -- View this message in context: http://n4.nabble.com/Erro

Re: [R] svm of e1071 package

2010-04-14 Thread Shyamasree Saha [shs]
Hello Steve, Thanks for your reply. yes, i converted input matrix to a sparse matrix (via SparseMatrix). rbind is fine for our case as anyway we have to do it. So, instead of using rbind on dense matrix and convert the whole matrix at the end, we take convert each chunk and add it to the big on

Re: [R] Import ASCII data using a .sas program

2010-04-14 Thread John Fox
Dear Don, What read.fwf() needs are the field widths. I think that the following will do what you want: > strings <- scan(what="") 1: perstat1 $1-2 3: linenum $3-4 5: I_wave1 $5-5 7: bnocost1 $6-10 9: bnosta1 $11-12 11: Read 10 items > (fields <- matrix(as.numeric(unlist

Re: [R] what is the intercept of a two-way anova model without interaction term?

2010-04-14 Thread Dennis Murphy
Hi: Perhaps this will clarify some things: > model.matrix(m) (Intercept) factor1B factor1C factor2t2 factor2t3 1 100 0 0 2 110 0 0 3 101 0 0 4 10

Re: [R] GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?

2010-04-14 Thread Gavin Simpson
On Wed, 2010-04-14 at 10:03 +0200, JANSEN, Ivy wrote: > Hi, > > I was reading the book on "Mixed Effects Models and Extensions in > Ecology with R" by Zuur et al. > In Section 6.2, an example is discussed where a gamm-model is fitted, > with a smoother for time, which differs for each value of

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

2010-04-14 Thread Gavin Simpson
On Tue, 2010-04-13 at 15:02 +0200, Kim Vanselow wrote: > 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 use

Re: [R] NMDS Ordination Graphics Problem

2010-04-14 Thread Gavin Simpson
On Mon, 2010-04-05 at 09:58 -0800, Trey wrote: > Dr. Stevens, Hmm, did you get the wrong address there ;-) As Michael Denslow has mentioned, the way to handle this sort of customised plotting at the moment in vegan is to build the plot up by hand. Michael's response earlier showed you how to do i

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Greg Snow
Does this do what you want? m1 <- cbind(1:5,1:5,1:5) m2 <- m1 for(i in 2:ncol(m1)){ m2[,i] <- apply(m1[,1:i],1,sum) } m2 ut <- diag( ncol(m1) ) ut[upper.tri(ut)] <- 1 m3 <- m1 %*% ut m3 all.equal(m2,m3) hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermount

[R] Sig differences in Loglinear Models for Three-Way Tables

2010-04-14 Thread Sachi Ito
Hi all, I've been running loglinear models for three-way tables: one of the variables having three levels, and the other two having two levels each. An example looks like below: > yes.no <- c("Yes","No") > switch <- c("On","Off") > att <- c("BB","AA","CC") > L <- gl(2,1,12,yes.no) > T <- gl(

[R] ur.df ADF Unit Root Test: what is the meaning of phi1 and phi2 test statistic?

2010-04-14 Thread Maximilian Rausch
Hello, I am using the ur.df function from the {arca} package to run the augmented Dickey-Fuller unit root test on several time series. However; I do not understand the econometric interpretation of the the "phi1" and "phi2" test-statisitc which are output if you choose a "trend" or "drift" model.

Re: [R] Factor variables with GAM models

2010-04-14 Thread Gavin Simpson
On Fri, 2010-03-19 at 20:37 -0700, Steven McKinney wrote: > Hi Noah > > GAM models were developed to assess the functional form > of the relationship of continuous predictor variables to the > response, so weren't really meant to handle factor variables > as predictor variables. GAMs are of the f

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

2010-04-14 Thread Steve Lianoglou
> "If you think you need '<<-', think again.  If on reflection you still > think you need '<<-', think again." > > Is this in package::fortunes? +1 for adding that to fortunes ... I remember reading through The R Inferno and getting a good laugh from several such one liners ... -steve -- Steve

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

2010-04-14 Thread Gabor Grothendieck
x <<- will usually wind up assigning into the parent or global environment but since it depends on what is already there the following are safer: e <- environment() parent.env(e)$x <- 1 globalenv()$x <- 2 Typically in cases like this the function that contains the assignment can be regarded as a

Re: [R] import file formatted RFC-822

2010-04-14 Thread Barry Rowlingson
On Wed, Apr 14, 2010 at 6:20 PM, Sebastian Kruk wrote: > I have a problem, In a few cases "robot-exclusion-useragent" have 2 or > more values, is there a manner to fix it? For example, robot askjeeves > has three names. use 'all=TRUE'? test data: foo: 1 bar: 2 foo: 1 foo: 2 bar: 4 baz: 7 > r

Re: [R] import file formatted RFC-822

2010-04-14 Thread Sebastian Kruk
I have a problem, In a few cases "robot-exclusion-useragent" have 2 or more values, is there a manner to fix it? For example, robot askjeeves has three names. 2010/4/13 Barry Rowlingson : > On Tue, Apr 13, 2010 at 6:26 PM, Sebastian Kruk > wrote: >> Dear R-list users: >> >> I would like to impor

Re: [R] Getting Started with Bayesian MCMC

2010-04-14 Thread Greg Snow
The purpose of the task view is to answer questions like this. I for one would not be able to give a better answer than what is there. My suggestion would be to pull out your Bayesian textbook (or get one, or use online notes from a class, etc.) and look through the homework problems and examp

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

2010-04-14 Thread Greg Snow
There are several ways in which the picture you show is uglier than the histogram produced by R. Which of these do you want to accomplish and why? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > F

Re: [R] Network Analysis

2010-04-14 Thread Jakson A. Aquino
On Wed, Apr 14, 2010 at 07:44:23AM -0800, bchaney wrote: > > Does anyone have any thoughts on this? I would really appreciate any > insights/suggestions that the group could provide. I did not do sophisticated analyzes, but my opinion is that igraph is easier to use and more versatile than statne

[R] what is the intercept of a two-way anova model without interaction term?

2010-04-14 Thread Xiaokuan Wei
Dear list, I have a question regarding the meaning of intercept term in a two-way anova model without interaction term. for example (let's assume there is no interaction between factor1 and factor2) : > df         val        factor1 factor2 1  48.61533       A      t1

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

2010-04-14 Thread jim holtman
If you use '<<-' remember that you are going to get into trouble and it will be a challange to debug your script. Only use it if you have a real good understanding of the scoping rules in R and have exhausted all the other avenues. I, like Greg, am guilty of using it because I still keep some of

Re: [R] array manipulation

2010-04-14 Thread Bert Gunter
1+pmax(abs(row(z)-3),abs(col(z)-3)) ?row ?col ?pmax for details. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Muhammad Rahiz Sent: Wednesday, April 14, 2010 9:44 AM To: r-help@r-p

Re: [R] Simulation problem.

2010-04-14 Thread Greg Snow
This looks like homework. If it is, you should really tell us along with what your teacher's policy is on getting help over the internet is (and note that many teachers monitor this list and can see if you are getting help). You have done the first part yourself, much better than some who have

Re: [R] Import ASCII data using a .sas program

2010-04-14 Thread Donald Catanzaro, PhD
Good Day, I have several ASCII data files that I would like to import into R. They all have a SAS import file which is used to bring the data into SAS and I am hoping to use this to bring the data into R. There are lots of variables involved and the ASCII data file is 2308 columns long so I

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Bert Gunter
Petr Pikal wrote: "... I mean that you can use fit<- lm(y~x+I(x^2)) coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 but you can not use fit<- lm(y~poly(x,2)) coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 " (to get the fits for any x vector) -- But you **can** use ypred <- predict(fi

Re: [R] Gaussian Quadrature Numerical Integration In R

2010-04-14 Thread Ravi Varadhan
Just do a variable transformation. If your function is f(x), your new function would be: f'(x) = sigma * f(sigma * x + mu). You can integrate f'(x) using the Hermite quadrature. Ravi. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On B

Re: [R] memory failure in adonis function (permanova)

2010-04-14 Thread Gavin Simpson
On Tue, 2010-03-16 at 17:12 +0100, Paloma Ruiz wrote: > Dear all, > > I am trying to get a PERMANOVA with quite large data set. I am reading a lot > about this question, but I do not get the answer about it. Although I know > that the R function is adonis () (vegan package), it does not work: > >

[R] array manipulation

2010-04-14 Thread Muhammad Rahiz
Hello listeRs, I'm trying to make a square radius around a given reference point. So given the following array, how can I manipulate it so that x0 <- array(1,dim=c(5,5)) x0 1 1 1 1 1 1 1 1 1 1 1 1 *1* 1 1 1 1 1 1 1 1 1 1 1 1 becomes into 3 3 3 3 3 3 2 2 2 3 3 2 *1* 2 3 3 2 2 2 3 3 3 3 3 3

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

2010-04-14 Thread Szumiloski, John
I love Patrick Burns' comment on the <<- operator in R Inferno: "If you think you need '<<-', think again. If on reflection you still think you need '<<-', think again." Is this in package::fortunes? John John Szumiloski, Ph.D. Senior Biometrician Biometrics Research WP53B-120 Merck Resea

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Petr PIKAL
Hi Bert Gunter napsal dne 14.04.2010 18:01:52: > Below. > > -- Bert > > > Bert Gunter > Genentech Nonclinical Statistics > > > Coefficients are different as you fit different values. See > > ?poly > > poly(-10:10,2) > > I believe that others give you better explanation. So you can not

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Bert Gunter
Below. -- Bert Bert Gunter Genentech Nonclinical Statistics Coefficients are different as you fit different values. See ?poly poly(-10:10,2) I believe that others give you better explanation. So you can not use coefficients evaluated by lm(.~poly(...)) directly. -- Well, it depends what

[R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.04.2010 17:12:51: > Hi List, > > I can not get my head around the following problem. I want to fit a > quadratic function to some data and stumbled across poly(). What exactly > does it, i.e. why are there different results for fit1 and fit2? > >

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

2010-04-14 Thread Greg Snow
The <<- assignment operator is very powerful, but can be dangerous as well. When tempted to use it, look for alternatives first, there may be a better way. But having said that, I am one of the more guilty people for using it (quite a few of the functions in the TeachingDemos package use <<-).

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Bert Gunter
Eleni et. al.: Perhaps it's worth noting that there is generally NO reason to prefer apply-family code to explicit for-loops for execution speed. Apply-type statments **are** essentially disguised loops -- that is, they execute the loop code repeatedly at the R interpreter level. They do employ so

Re: [R] Network Analysis

2010-04-14 Thread bchaney
Does anyone have any thoughts on this? I would really appreciate any insights/suggestions that the group could provide. -- View this message in context: http://n4.nabble.com/Network-Analysis-tp1838902p1839992.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] sum specific rows in a data frame

2010-04-14 Thread arnaud Gaboury
Thank you for your help. The best I have found is to use the ddply function. > pose DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/101467.75 2 WHEAT May/101467.75 3 WHEAT May/101467.75 4 WHEAT May/1014

Re: [R] fitting a quadratic function - poly?

2010-04-14 Thread Duncan Murdoch
On 14/04/2010 11:12 AM, Stefan Uhmann wrote: Hi List, I can not get my head around the following problem. I want to fit a quadratic function to some data and stumbled across poly(). What exactly does it, i.e. why are there different results for fit1 and fit2? x = seq(-10, 10) y = x^2 fit1 =

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Stefan Uhmann
Hi muting, # your data muting <- data.frame(col1 = c(1,1,2,1,2,1), col2=c(NA,1,2,1,2,NA)) # 1. finding rows with NA is.na(muting) # 2. counting the NAs per column colSums(is.na(muting)) # 3. keeping only the ones without NAs muting[,colSums(is.na(muting)) == 0] Regards, Stefan schrieb muting, A

Re: [R] how to delete columns with NA values?

2010-04-14 Thread muting
Thank you all! It works well now -- View this message in context: http://n4.nabble.com/how-to-delete-columns-with-NA-values-tp1839902p1839953.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

[R] fitting a quadratic function - poly?

2010-04-14 Thread Stefan Uhmann
Hi List, I can not get my head around the following problem. I want to fit a quadratic function to some data and stumbled across poly(). What exactly does it, i.e. why are there different results for fit1 and fit2? x = seq(-10, 10) y = x^2 fit1 = lm(y ~ x + I(x^2)) fit2 = lm(y ~ poly(x, 2))

Re: [R] R package documentation

2010-04-14 Thread Sharpie
pomchip wrote: > > Dear R users, > > I am currently writing the documentation for my first package. I have > created a short user manual using sweave/pdflatex which is distinct from > the > manual/summary-of-package-functions created by R CMD CHECK. I was > wondering > how could I seamlessly co

[R] Roxygen - basic usage uncertain

2010-04-14 Thread David Esp
I am trying to make a package consisting of a single function with auto-documentation assistance from 'roxygen' but am uncertain of the correct procedure. My version of 'R' is 2.10.1. I followed the following steps: 1) Get an existing function (un-commented) as an '.R' file. 2) Add formal comm

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Chuck Cleland
On 4/14/2010 10:56 AM, muting wrote: > Hi everyone: > > I have a dataset: > > tm1 > col1 col2 > [1,]1 NA > [2,]11 > [3,]22 > [4,]11 > [5,]22 > [6,]1 NA > > I need to delete entire column 2 that has NA in it(not all of them are NAs), > and the resu

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Erik Iverson
Hello, muting wrote: Hi everyone: I have a dataset: This looks like a matrix. To perform functions on each row or column of a matrix, use the apply function. If you had a data.frame, you could perform a function on each column using sapply or lapply. tm1 col1 col2 [1,]1 NA [

[R] how to delete columns with NA values?

2010-04-14 Thread muting
Hi everyone: I have a dataset: tm1 col1 col2 [1,]1 NA [2,]11 [3,]22 [4,]11 [5,]22 [6,]1 NA I need to delete entire column 2 that has NA in it(not all of them are NAs), and the result I want is tm1 col1 [1,]1 [2,]1 [3,]2

Re: [R] env() for lme4

2010-04-14 Thread Rob Goedman
Pierre, This question is better asked on R-sig-ME. I updated below call to 'profile(fm...@env)' Regards, Rob On Apr 14, 2010, at 6:28 AM, pnouvellet wrote: > > Hi, > > using lme4a, and the dystuff data, I call profile and get: >> profile(fm1ML) > Error in UseMethod("profile") : > no appli

Re: [R] svm of e1071 package

2010-04-14 Thread Steve Lianoglou
Hi Shyama, On Tue, Apr 13, 2010 at 10:40 AM, Shyamasree Saha [shs] wrote: > 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 runn

[R] total. factor. prodctvty. help!!

2010-04-14 Thread serdal
Dear all, I have a basic(!) econometric question which i couldnt find the way to do it in R. Well this could be also because of my wrong interpretation of the econometric process that i am trying to implemet.so here i wanna ask if am doing a logical mistake!!! so here is the question with the exp

Re: [R] import file formatted RFC-822

2010-04-14 Thread Sebastian Kruk
Barry, thank you so much! It's work. __ 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, self-contained, reproducib

Re: [R] MiscPsycho - incorrect levenshtein distance?

2010-04-14 Thread Doran, Harold
Thanks for pointing this out, it is indeed a bug. I have a few things on my plate today but will try and revise and place a new version on CRAN soon. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Wednesday, April 14, 2010 9:06 AM To: Ben Meijering Cc: r

Re: [R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in " c(0"

2010-04-14 Thread John Fox
Dear David, Thank you for addressing this question, but I answered Simon's question in an email I sent to the R help list a while ago: You can't mix : and c() in a recode specification; : isn't the sequence operator in a recode specification but rather represents a continuous range of values. Thus

[R] Third and fourth order of derivative in smooth.lf function from locfit package

2010-04-14 Thread FMH
Dear All, Could someone please advice me the way to define the derivative of the local polynomial regression in third and fourth order from the smooth.lf function? Thank you Fir [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] env() for lme4

2010-04-14 Thread pnouvellet
Hi, using lme4a, and the dystuff data, I call profile and get: > profile(fm1ML) Error in UseMethod("profile") : no applicable method for 'profile' applied to an object of class "lmer" any solutions? -- View this message in context: http://n4.nabble.com/env-for-lme4-tp1565045p1839791.html Se

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Eleni Rapsomaniki
That's really interesting... I have always assumed that for-loops take longer than apply. Perhaps it depends on the application. I'll try both in my code and see. Thank you! Eleni Rapsomaniki Research Associate Tel: +44 (0) 1223 740273 Strangeways Research Laboratory Department of Public He

Re: [R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Thanks Tobias, If there is no automated way to combine both documents, I will stack them manually... that will likely cause some problems with page numbering tough. Sebastien On Wed, Apr 14, 2010 at 8:18 AM, Tobias Verbeke < tobias.verb...@openanalytics.eu> wrote: > Hi Sébastien, > > Sébastien

  1   2   >