[R] structural equations using sem package

2012-11-05 Thread Soon Yi
Hello I am using sem to look at the direct effect of one variable on another but i am uncertain if i am progressing correctly. An example: covar1<-  matrix(c(0.4,-0.2,3,-0.2 , 0.3,-2 , 3 ,-2 , 60), nrow=3,byrow=T) rownames(covar1)<-colnames(covar1)<-c("endo","exo","med") path1<-matrix(c(    "

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread siddu479
Hi Arun, Thanks for your reply but your script is removing only one row( first row and last row) for each Unique and StepNo combination and calculating mean for the rest of rows. For below data , your script removing the #'s rows perfectly. But in reality I may need to ignore *say first 10 rows

Re: [R] Dates as POSIXt

2012-11-05 Thread Prof Brian Ripley
You cannot have a POSIXlt column in a data frame: if you did your homework you would know it is because it is length-9 list. I don't know why str() is reporting POSIXt as a class, and your example is not reproducible. Normally date-times have class > class(Sys.time()) [1] "POSIXct" "POSIXt"

Re: [R] lines with colored segments

2012-11-05 Thread Jim Lemon
On 11/05/2012 12:29 AM, David Stevens wrote: Hello all I'm trying to create a plot similar to a plot.default(..., type='b') with points plotted connected by lines that leave small gaps between the end of the line and the point symbol, BUT, with each line segment's color controlled by a category.

[R] Post hoc tests in gam (mgcv)

2012-11-05 Thread chirleu
Hi. I'm analysing some fish biological traits with a gam in mgcv. After several tries, I got this model log(tle) = sexcolor + s(doy, bs = "cc", by = sexcolor) +log(tl) sexcolor is a factor with 4 levels doy is "day of year", which is modeled as a smoother tl is "total length of the fish" The sum

[R] division giving spurious NA

2012-11-05 Thread Christian Hoffmann
Hi, I stumbled acros the following disturbing computation: x <- matrix(c( 2.594028,0.8468867,NA,2.244600,1.215535,0.8233032,NA,3.176697,3.425393,2.5345225,NA,3.247219),nrow=3,byrow=TRUE) x # having NA in column3 only x[1:2,]/x[3,] ## [,1] [,2] [,3] [,4] [1,] 0.7572935

Re: [R] division giving spurious NA

2012-11-05 Thread Rui Barradas
Hello, Your behavior is due to the fact that R uses _column_ vectors. The first column of x[1:2,] is divided by the first two elements of x[3,], then the second column of x[1:2,] by the next two elements of x[3,] and one of them is NA. Then the 3rd and 4th columns of x[1:2,], each by two elem

Re: [R] Can you turn a string into a (working) symbol?

2012-11-05 Thread R. Michael Weylandt
On Sun, Nov 4, 2012 at 3:10 AM, andrewH wrote: > Yes, the assign command goes a little way toward what what I was hoping for. > But it requires a different syntax, and it does not in general let you use > quoted expressions that you could use with other assignment operators. For > instance, > >>

Re: [R] blackboost (mboost package) function leads to non-reclaimable memory usage

2012-11-05 Thread R. Michael Weylandt
On Sun, Nov 4, 2012 at 1:06 PM, nima82 wrote: > Dear all, > > I am puzzled by R's memory usage when calling the blackboost function from > package mboost to estimate a Gradient boosting model on a simulated dataset > with 20 correlated variables and 100,000 obs. The blackboost object created > by

[R] averaging a list of matrices element wise

2012-11-05 Thread ONKELINX, Thierry
Dear all, I have a list of n matrices which all have the same dimension (r x s). What would be a fast/elegant way to calculate the element wise average? So result[1, 1] <- mean(c(raw[[1]][1, 1] , raw[[2]][1, 1], raw[[...]][1, 1], raw[[n]][1, 1])) Here is my attempt. #create a dummy dataset n <

Re: [R] averaging a list of matrices element wise

2012-11-05 Thread D. Rizopoulos
If you don't have any NAs, then one way is: n <- 3 r <- 5 s <- 6 raw <- lapply(seq_len(n), function(i){ matrix(rnorm(r * s), ncol = r) }) Reduce("+", raw) / length(raw) I hope it helps. Best, Dimitris On 11/5/2012 11:32 AM, ONKELINX, Thierry wrote: > Dear all, > > I have a list of n matri

[R] Error message in nmkb()

2012-11-05 Thread MMar86
Hallo together, I am trying to use the nmkb() optimizer and I have problems using the function, as it causes the following error message Fehler (error)* in while (nf < maxfeval & restarts < restarts.max & dist > ftol & : Fehlender Wert (missing value)* , wo (where)* TRUE/FALSE nötig ist (is req

[R] FW: Having some Trouble Data Structures

2012-11-05 Thread Benjamin Ward (ENV)
From: Benjamin Ward (ENV) Sent: 03 November 2012 13:29 To: Jeff Newmiller; r-help@r-project.org Subject: RE: [R] Having some Trouble Data Structures Hi, Thank you very much for your reply - how you prefer, is how my supervisor implemented the layout in Minitab, however I was unsure of how to get

Re: [R] ffdfindexget from package ff

2012-11-05 Thread Jan
Hi Dave, I'm working currently on Windows and I didn't get the error message. I'm getting the following output shown below. Maybe you changed something in the ffbatchbytes option? > require(ff) > myVec = ff(1:5) > another = ff(10:14) > littleFrame = ffdf(myVec, another) > posVec = ff(c(2, 4),

[R] Error message

2012-11-05 Thread Haris Rhrlp
Dear R users, I have this problem with memory i guess  AA<-array(rep(0,96096000),dim=c(16,5,3003,400)) Error: cannot allocate vector of size 733.2 Mb can anyone help me,  Thanks in advance... [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] averaging a list of matrices element wise

2012-11-05 Thread arun
Hi, You can also try this:  apply(simplify2array(raw),c(1,2),mean) #   [,1]   [,2]   [,3]    [,4]    [,5] #[1,] -0.5457338 -0.2138714 -0.6555012 -0.03926681 -0.61747866 #[2,]  0.1241875 -0.5987224 -1.6752304  0.72977962 -0.47794016 #[3,]  1.0154878 -0.5175063  0.7309496 -0.

Re: [R] Hypothesis "RayosRayos.2 = (Intercept)" is not well formed: contains bad coefficient/variable names.

2012-11-05 Thread John Fox
Dear Jean, This is, I suppose, linearHypothesis() in the car package. It's impossible to know from the information that you've given what the source of the problem is, since you don't show the formula for model.rayos. If it's correct, which apparently isn't the case, the hypothesis that you spe

[R] error in comparisons using glht function

2012-11-05 Thread paola
hi everybody this is my last chance, I dont know what else to do I was trying to find my multiple comparisons using the code in R glht next is my function and the error I get vol.interallaovsol<-aov(scoresol~ffjob+ffage+ffstudies+ffjob:ffstudies+ffjob:ffage+ffstudies:ffage+ffjob:ffage:ffstudies

Re: [R] structural equations using sem package

2012-11-05 Thread John Fox
Dear Soon Yi, Yes, if a variable in the model doesn't appear in the data (either a data set, given by the data argument, or a covariance or moment matrix given by the S argument to sem), sem will assume that the variable is a latent variable. On the other hand, the models you've specified have

[R] exporting 3D dynamic graph

2012-11-05 Thread Christophe Genolini
Hi the list, Using misc3d, we can export 3d dynamic graph in pdf format. Is it also possible to export these graph into a format that we can publish on the web? Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du ca

[R] Logistic Regression with Offset value

2012-11-05 Thread Lucas Chaparro
Dear R friends. I´m trying to fit a Logistic Regression using glm( family='binomial'). Here is the model: *model<-glm(f_ocur~altitud+UTM_X+UTM_Y+j_sin+j_cos+temp_res+pp, offset=(log(1/off)), data=mydata, family='binomial')* mydata has 76820 observations. The response variable f_ocur) is a 0-1. Thi

[R] Logistic Regression with Offset value

2012-11-05 Thread Lucas Chaparro
Dear R friends. I´m trying to fit a Logistic Regression using glm( family='binomial'). Here is the model: *model<-glm(f_ocur~altitud+UTM_X+UTM_Y+j_sin+j_cos+temp_res+pp, offset=(log(1/off)), data=mydata, family='binomial')* mydata has 76820 observations. The response variable f_ocur) is a 0-1. Thi

Re: [R] rgl package and animation

2012-11-05 Thread Robert Baer
-- snip -- On 11/4/2012 7:45 AM, Duncan Murdoch wrote: First, draw the new sphere at the first point and save the object id: sphereid <- sphere3d(dat[1,c("X", "Y", "Z")], col="red", radius=1) # Also save the spinner that you like: spin <- spin3d( ) #maybe with different parms # Now, the ani

Re: [R] exporting 3D dynamic graph

2012-11-05 Thread Robert Baer
On 11/5/2012 8:23 AM, Christophe Genolini wrote: > Hi the list, > > Using misc3d, we can export 3d dynamic graph in pdf format. > > Is it also possible to export these graph into a format that we can publish > on the web? > > Christophe You don't provide enough information to know exactly what you

Re: [R] exporting 3D dynamic graph

2012-11-05 Thread Duncan Murdoch
On 05/11/2012 9:23 AM, Christophe Genolini wrote: Hi the list, Using misc3d, we can export 3d dynamic graph in pdf format. Is it also possible to export these graph into a format that we can publish on the web? You could write to WebGL. Most browsers support this (but it might need to be t

Re: [R] averaging a list of matrices element wise

2012-11-05 Thread Bert Gunter
Gents: Although it is difficult to say what may be faster, as it typically depends on the data, and it is even more difficult to say what is fast enough, I suspect that ?rowMeans ## specifically written for speed would be considerably faster than Reduce (or an apply() )approach on the array), b

Re: [R] Error message

2012-11-05 Thread Jessica Streicher
It depends a bit on your setup, but you could have a look at ?memory.size or ?memory.limit and see if any of that helps Jessi On 05.11.2012, at 12:49, Haris Rhrlp wrote: > Dear R users, > > I have this problem with memory i guess > > AA<-array(rep(0,96096000),dim=c(16,5,3003,400)) > Error

Re: [R] exporting 3D dynamic graph

2012-11-05 Thread Christophe Genolini
Perfect, thanks a lot ! > On 11/5/2012 8:23 AM, Christophe Genolini wrote: >> Hi the list, >> >> Using misc3d, we can export 3d dynamic graph in pdf format. >> >> Is it also possible to export these graph into a format that we can publish >> on the web? >> >> Christophe > You don't provide enough

[R] Problem compiling Rnw file

2012-11-05 Thread Riccardo Romoli
Dear R list, I'm using R 2.15.2 with TeX Live 2009 and ESS 12.09 . I have a R project in the '/home/r/Documents/myproj/', which is my working directory (where I have the .Rnw file). Inside the document I have several "setwd()" to collect the datasets I use. After I compile from the terminal using

Re: [R] Problem compiling Rnw file

2012-11-05 Thread Marc Schwartz
On Nov 5, 2012, at 9:23 AM, Riccardo Romoli wrote: > Dear R list, > I'm using R 2.15.2 with TeX Live 2009 and ESS 12.09 . I have a R > project in the '/home/r/Documents/myproj/', which is my working > directory (where I have the .Rnw file). Inside the document I have > several "setwd()" to collec

Re: [R] select duplicate identifier with higher mean across sample columns

2012-11-05 Thread Adrian Johnson
Thanks a lot for the help. -Adrian On Sun, Nov 4, 2012 at 2:39 PM, jim holtman wrote: > Is this what you want: > >> mdf <- read.table(text = " id samp1 samp2 samp2a > + 1 A 100 110110 > + 2 A 120 130150 > + 3 C 101 131151 > + 4 D 110 150130 > + 5 E 132 12

Re: [R] Problem with lm

2012-11-05 Thread Eva Prieto Castro
Hi, I solved as follws:  f <- formula(y ~ x1 + x2)   single <- do.call("lm", list(f, data=mydf)) It works in every machine!!. Thanks and I'm sorry if I did not answer all your responses about this question. Cheers, Eva --- El vie, 2/11/12, Eva Prieto Castro escribió: De: Eva Prieto Castr

Re: [R] optim & .C / Crashing on run

2012-11-05 Thread William Dunlap
You said the R traceback was not very informative, but it did include the line > > 4: function (par) fn(par, ...)(c(4334.99, 53, 4.57, 0.277, 433.50033, 2.158, 0.288)) and if I try to run your fsbl_chi2 with those parameters, outside of any optimizer, R crashes: > fsbl_chi2(c(4334.99, 5

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread Jeff Newmiller
This is not a free do-my-work-for-me forum, this is a help-you-learn-R forum. If you study the solution you have been given until you understand how it works, and combine that with an understanding of indexing from the Introduction to R document that comes with R, you should be able to complete

[R] A general question: Is language S a component part of R?

2012-11-05 Thread Iurie Malai
In the "Introduction and preliminaries" the "An Introduction to R" manual says about R: "... Among other things it has ... a well developed, simple and effective programming language (Called 'S') ... ". Now I'm a little confused. This means that language S is a component part of R? And S is not fre

Re: [R] Problem compiling Rnw file

2012-11-05 Thread Jessica Streicher
I'll second the full path option. Just create a variable path_to_data and concatenate it with the names of any files you need in that directory. You could also try to use relative paths if the data is "nearby" and is likely to not change that position. e.g. if the data was in '/home/r/Documents

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread R. Michael Weylandt
On Mon, Nov 5, 2012 at 4:43 PM, Iurie Malai wrote: > In the "Introduction and preliminaries" the "An Introduction to R" manual > says about R: "... Among other things it has ... a well developed, simple > and effective programming language (Called 'S') ... ". Now I'm a little > confused. This mean

Re: [R] Problem compiling Rnw file

2012-11-05 Thread Yihui Xie
Let me clarify a little bit about me comments on SO: setwd() should be called in the first place before you work on anything, and it should never be used in the middle of a project (if you do, you need to restore it later). Presumably Sweave writes the output file using something like cat(output, f

[R] fusion of overlapping intervals

2012-11-05 Thread Hermann Norpois
Hello, I have start and end coordinates from different experiments (DNase hypersensitivity data) and now I would like to combine overlapping intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101 are combined to 30-101. But 49-101 and 70-103 would not be combined because they ar

Re: [R] fusion of overlapping intervals

2012-11-05 Thread Martin Morgan
On 11/05/2012 09:14 AM, Hermann Norpois wrote: Hello, I have start and end coordinates from different experiments (DNase hypersensitivity data) and now I would like to combine overlapping intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101 are combined to 30-101. But 49-101

Re: [R] Error message

2012-11-05 Thread jim holtman
What size system are you running on? (physical memory) What version of R are you using (32 or 64 bit)? If 32-bit, then the array you are trying to allocate requires 733MB of physical memory and there is not sufficient memory available. Do you have other large objects allocated that you might hav

[R] r-help or r-devel ?

2012-11-05 Thread Christophe Genolini
Hi the list, I have some basic questions about "writing a package". On which list shall I post them? Theoretically, I am supposed to post them on r-devel, but all the questions on this list are very advance questions, not basic ones... So I don't know what to do. Christophe -- Christophe Ge

Re: [R] averaging a list of matrices element wise

2012-11-05 Thread Bert Gunter
Gents: Well... (munch munch) I do think I must eat my words: >z <- lapply(seq_len(1e6),function(x)matrix(runif(100),nr=10)) > system.time(Reduce("+",z)/length(z)) user system elapsed 3.480.053.52 > system.time(rowMeans(array(unlist(z),dim=c(10,10,length(z))),dims=2)) user syst

[R] no method for coercing this S4 class to a vector

2012-11-05 Thread Sam Steingold
all of a sudden, after a SparseM upgrade(?) I get this error: > str(z) Formal class 'matrix.csr' [package "SparseM"] with 4 slots ..@ ra : num [1:85372672] -0.4288 0.0397 0.0104 -0.1843 -0.1203 ... ..@ ja : int [1:85372672] 1 2 3 4 5 6 7 8 9 10 ... ..@ ia : int [1:699777] 1

Re: [R] r-help or r-devel ?

2012-11-05 Thread Marc Schwartz
On Nov 5, 2012, at 11:24 AM, Christophe Genolini wrote: > Hi the list, > > I have some basic questions about "writing a package". On which list shall I > post them? > Theoretically, I am supposed to post them on r-devel, but all the questions > on this list are very > advance questions, not

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Iurie Malai
Thanks all! At least for me, the manual text has a contradiction. If R is much like S, in other words it is a "diverged" S, as Michael says, it can't include itself as a component part. Regards, Iurie 2012/11/5 R. Michael Weylandt > On Mon, Nov 5, 2012 at 4:43 PM, Iurie Malai wrote: > > In t

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Patrick Burns
There is a bit of history in: http://www.portfolioprobe.com/2012/05/31/inferno-ish-r/ Pat On 05/11/2012 17:09, R. Michael Weylandt wrote: On Mon, Nov 5, 2012 at 4:43 PM, Iurie Malai wrote: In the "Introduction and preliminaries" the "An Introduction to R" manual says about R: "... Among oth

Re: [R] Struggeling with nlminb...

2012-11-05 Thread Ravi Varadhan
Try optimx() in the "optimx" package with the control option `all.methods=TRUE'. Ravi Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Division of Geriatric Medicine & Gerontology Johns Hopkins University rvarad...@jhmi.edu 410-502-2619

Re: [R] optim & .C / Crashing on run

2012-11-05 Thread Ravi Varadhan
You might also want to try the Nelder-Mead algorithm, nmk(), in the "dfoptim" package. It is a better algorithm than the Nelder-Mead in optim. It is all R code, so you might be able to modify it to fit your needs. Ravi Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Di

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread arun
HI Siddu, Sorry, I looked only at your first statement: "in this example case I need to exclude the first row and last row(N=1)" You can try this: dat1<-read.table(text=" Unique StepNo Data1 Data2 1  A  1    4    5 2  A  1    5    6 3  A  1    7    8   4  A

[R] Diference in results from doBy::popMeans, multcomp::glht and contrast::contrast for a lme model

2012-11-05 Thread Walmes Zeviani
Hello R users, I'm analyzing an experiment in a balanced incomplet block design (BIB). The effect of blocks are assumed to be random, so I'm using nlme::lme for this. I'm analysing another more complex experiments and I notice some diferences from doBy::popMeans() compared multcomp::glht() and con

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread arun
Hi, You can also try this: dat1<-read.table(text=" Unique StepNo Data1 Data2 1  A  1    4    5    2  A  1    5    6    3  A  1    7    8  4  A  1    3    4    5  A  1    1    1    6  B  1    2    4 7  B  1    3    5    8  B

[R] custom function & missing value where TRUE/FALSE needed

2012-11-05 Thread jcrosbie
I can't figure out why this function wont work. #Custom Function used fallInBand <- function(x){ #Assume the bands fall go up form 0 to 100 in intervals of 5 then from 100 to 1000 in intervals of 100. #returns the location (band number) if (is.na(x) == FALSE) { if(x < 100) {#bands of 5

[R] Customly low standard deviation in fracdiff.var function

2012-11-05 Thread Joe Cocker
Hi,I have a question about the fracdiff.var function (package fracdiff) which goal is to recompute more precise confidence intervals for the parameters estimated by fracdiff (or arfima). More precisely, it deals with the standard error of the "d" coefficient : Is it normal that the standard err

Re: [R] Problem with lm

2012-11-05 Thread Rolf Turner
On 06/11/12 05:20, Eva Prieto Castro wrote: Hi, I solved as follws: Â f <- formula(y ~ x1 + x2) Â single <- do.call("lm", list(f, data=mydf)) It works in every machine!!. Well, if you are happy with the result, I guess that can't be argued with. However the fact that your previous attempts

[R] Empty plot in R

2012-11-05 Thread Shahzad Ali
Hello everyone I am trying to plot something in R but the plot is always empty. It only appears when I resize the plot windows. What exactly do I need to verify in options. My system is ARCH Linux 3.6.x Best Regards Shahzad __ R-help@r-project.org m

Re: [R] custom function & missing value where TRUE/FALSE needed

2012-11-05 Thread Sarah Goslee
In this line: if (is.na(x) == FALSE) { x is a vector, so you presumably want any(is.na(x)) or possibly all(is.na(x)) depending on what you are intending to check for. When I run your function (thanks for the reproducible example), the error I get is: Warning message: In if (is.na(x) == FALSE) {

Re: [R] Empty plot in R

2012-11-05 Thread Sarah Goslee
Can you provide a reproducible example? On Mon, Nov 5, 2012 at 12:38 PM, Shahzad Ali wrote: > Hello everyone > > I am trying to plot something in R but the plot is always empty. It > only appears when I resize the plot windows. > > What exactly do I need to verify in options. > > My system is ARC

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Iurie Malai
After reading the 'Inferno-ish R' the first thing that comes to mind is that R is very much like S, but it's still different (R is not S), so it can't contain the S as a programming language, as the manual says. Or I'm wrong? 2012/11/5 Patrick Burns > There is a bit of history in: > > http://ww

Re: [R] Empty plot in R

2012-11-05 Thread David Winsemius
On Nov 5, 2012, at 11:08 AM, Sarah Goslee wrote: > Can you provide a reproducible example? > > On Mon, Nov 5, 2012 at 12:38 PM, Shahzad Ali wrote: >> Hello everyone >> >> I am trying to plot something in R but the plot is always empty. It >> only appears when I resize the plot windows. >> >>

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread William Dunlap
Almost all syntactically correct S code works in R and S+ the same as it did in S (the last version of which came out c. 1999), modulo bug fixes. Off the top of my head, I'd say the only things that were eliminated were the use of the underscore as the assignment operator and the elimination

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Iurie Malai
So, R (as a language) can be viewed as an extended S language (S + some improvements)? And the R environment includes this (extended) language + extensions? 2012/11/5 William Dunlap > Almost all syntactically correct S code works in R and S+ the same as it > did in S > (the last version of whic

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Rolf Turner
On 06/11/12 09:40, Iurie Malai wrote: So, R (as a language) can be viewed as an extended S language (S + some improvements)? And the R environment includes this (extended) language + extensions? Are others getting as sick of this silly, pedantic and completely irrelevant pseudo-scholasticism as

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Berend Hasselman
On 05-11-2012, at 22:04, Rolf Turner wrote: > On 06/11/12 09:40, Iurie Malai wrote: >> So, R (as a language) can be viewed as an extended S language (S + some >> improvements)? And the R environment includes this (extended) language + >> extensions? > > Are others getting as sick of this silly,

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread R. Michael Weylandt
On Nov 5, 2012, at 6:37 PM, Iurie Malai wrote: > Thanks all! > > At least for me, the manual text has a contradiction. If R is much like S, > in other words it is a "diverged" S, as Michael says, it can't include > itself as a component part. I'd think something like C/C++ -- the later includ

Re: [R] fusion of overlapping intervals

2012-11-05 Thread arun
HI, May be you should check this link (http://r.789695.n4.nabble.com/R-overlapping-intervals-td810061.html). dat1<-structure(list(chr = structure(c(1L, 1L, 1L, 2L, 2L, 2L), .Label = c("a", "b"), class = "factor"), start = c(5, 30, 49, 70, 100, 129),     end = c(10, 52, 101, 103, 130, 140)), .Na

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread David L Carlson
Logic is irrelevant. You must simply embrace the FoRce. -- Obi Wan David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-

Re: [R] relative convergence in 'optim'

2012-11-05 Thread Mauricio Zambrano-Bigiarini
2012/11/5 Mauricio Zambrano-Bigiarini : > Dear list, > > I have a question related to the correct interpretation of the > relative convergence criterion used by 'optim'. > > > In the help of the function is it written that: > > "reltol:Relative convergence tolerance. The algorithm stops if it is >

Re: [R] constrained optimization help please!

2012-11-05 Thread hayduke
Thank-you Berend. This approach does work. Now I need to constrain the problem so that sum(d.NR) is positive for each fleet. I tried this but with no luck: *nfleets<-2 nareas<-2 M<-1 M<-array(M,dim=c(nfleets,nareas)) N<-1000 cost<-c(40,40) cost<-array(cost,dim=c(nfleets,nareas)) Price<-2 Price<-ar

[R] Plot 3 lines in one graph

2012-11-05 Thread Ignacio Martinez
I'm new with R. I want to plot 3 lines in one graph. This is my data: print(x) V1 V2 V3 V41 -4800 25195.73 7415.219 7264.282 -2800 15195.73 5415.219 7264.28 I tried using matplot, but I cannot get exactly what I want. This is what I get, and this is my code: matplot(x[,1],x

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread Hadley Wickham
On Monday, November 5, 2012, Rolf Turner wrote: > On 06/11/12 09:40, Iurie Malai wrote: > >> So, R (as a language) can be viewed as an extended S language (S + some >> improvements)? And the R environment includes this (extended) language + >> extensions? >> > > Are others getting as sick of this

[R] GLM and WLS

2012-11-05 Thread frespider
Hi I am running some simulation in R after resampling from a huge data set 500 columns and 86759 rows and fit these two model and calculate R-square fit <- lm(Y~X,weights = Weights) bhat <- coef(fit) Yhat <- X%*%bhat SST <- sum((Y - mean(Y))^2) SSE <- sum(

[R] Append Data to an Excel File through each Iteration of a For Loop

2012-11-05 Thread Cheryl Johnson
Hi, I would like to find a way to append data to an excel file through each iteration of a for loop. Is there a way to use a command such as write.table and append each iteration to a different sheet? Thanks [[alternative HTML version deleted]] __

[R] R comic graph

2012-11-05 Thread 蓁蓁 李
Hi, I would like to do comic graph in R, the following website have some examples. The graph is working fine, but font doesn't work. Not in basic plot or ggplot. Is there any other ways to have comic font for the text? http://stackoverflow.com/questions/12675147/how-can-we-make-xkcd-style-graph

Re: [R] Append Data to an Excel File through each Iteration of a For Loop

2012-11-05 Thread Jim Holtman
try the XLConnect package. You can write multiple sheets. Sent from my iPad On Nov 5, 2012, at 21:37, Cheryl Johnson wrote: > Hi, > > I would like to find a way to append data to an excel file through each > iteration of a for loop. Is there a way to use a command such as > write.table and ap

Re: [R] mergeing a large number of large .csvs

2012-11-05 Thread Benjamin Caldwell
Thanks to you all. Modifying the code to use rbind instead of merge worked like a charm - I can only speculate why. Best *Ben Caldwell* PhD Candidate University of California, Berkeley 130 Mulford Hall #3114 Berkeley, CA 94720 Office 223 Mulford Hall (510)859-3358 On Sat, Nov 3, 2012 at 2:19 P

Re: [R] Plot 3 lines in one graph

2012-11-05 Thread Peter Alspach
Tena koe Ignacio I cannot follow you example (you might care to read the posting guide, link at end, to help you in this regard). However, the usual way to plot three lines in one graph is to use lines. For example, yourData <- data.frame(x=1:2, y1=runif(2), y2=runif(2), y3=runif(2)) with(you

Re: [R] Plot 3 lines in one graph

2012-11-05 Thread David L Carlson
matplot works just fine, but you only have two data points, at -4800 and at -2800. You chop the x axis at -4500 so that the first point is outside the graph window and extend it to -100 which is far beyond your point at -2800. If you want to project the lines, you will have to add points. > x <-

Re: [R] Problem with lm

2012-11-05 Thread Eva Prieto Castro
Hi Rolf, I agree with you, but the problem is that I don't have knowledge enough in order to find the reason of that fact of working in some machines but not in every machines. If you have an idea, please tell me, now or later, when it can be. Thanks Eva --- El lun, 5/11/12, Rolf Turner es

[R] Filling matrix elements with a function

2012-11-05 Thread Aimee Kopolow
Hi all, I have a matrix simulating migration in a spatial model. I want to be able to define movement (the values of m1, m2 and m3) as only != 0 between adjacent patches and contingent on certain conditions as defined in the function. Here is the code: WET<-function(t) {everglades$precipitation