Re: [R] maximum/minimum value of a function

2009-07-10 Thread milton ruser
Hi Derek, like this? myfunction<-function(xmin, xmax, number_of_values) { xvalues<-seq(from=xmin, to=xmax, by = ((xmax - xmin)/(number_of_values - 1))) outputvalues<-xvalues^2+(xmax/xvalues)^3*runif(number_of_values) return(outputvalues) } my.values<-myfunction(1,10,100) min(my.values) max(m

[R] hands-on classification tutorial needed...

2009-07-10 Thread Michael
Hi all, I am doing binary classification and want to improve the classification results on imbalanced response data. Currently the performance is poor. Are there ways I could improve the performance? I could either try different classification methodologies, or try exploring the data more, and t

[R] Is there any Gauss-newton library/function in R?

2009-07-10 Thread Hao Jiang
Hi,I am a newbie to R. I wrote a simple Gauss-newton method in least square minimization problems, but it looks not working well. Is there any Gauss-newton library/function in R? Appreciate in advance! Hao [[alternative HTML version deleted]] _

Re: [R] splint

2009-07-10 Thread spencerg
Hello: For any package on CRAN, you can download the "*.tar.gz" source file. When this is unzipped, the result will typically include a subdirectory "src", containing the source code for routines written in Fortran or C or C++. You didn't say where one could find the function

[R] maximum/minimum value of a function

2009-07-10 Thread Derek An
Dear All, Does anyone know how to get the maximum/minimum value of a function using R, I think there should be an instruction, but i can not find it in help files Thank you in advance for your help :) [[alternative HTML version deleted]] __ R

Re: [R] sort data.frame by specific date column

2009-07-10 Thread Mark Knecht
On Fri, Jul 10, 2009 at 7:44 PM, milton ruser wrote: > Hi Mark, > > Like this? > > mydf<-read.table(stdin(), head=T) > Trade PosType  EnDate EnTime  ExDate ExTime PL_Pos > 1   1 1040107    915 1040107   1300    164 > 2   1 1040108    909 1040108   1300    184 > 3   1 1040115    921 1040

Re: [R] sort data.frame by specific date column

2009-07-10 Thread milton ruser
Hi Mark, Like this? mydf<-read.table(stdin(), head=T) Trade PosType EnDate EnTime ExDate ExTime PL_Pos 1 1 1040107915 1040107 1300164 2 1 1040108909 1040108 1300184 3 1 1040115921 1040115 1300 64 4 1 1040120 1134 1040120 1300124 5

[R] sort data.frame by specific date column

2009-07-10 Thread Mark Knecht
I have a data.frame that was built from a number of smaller data.frames with rbind. Each ssmaller data.frame bound together runs over the same date ranges. The format of the whole thing looks like this: Trade PosType EnDate EnTime ExDate ExTime PL_Pos 11 1 1040107915 10401

Re: [R] pcaNNet confusion

2009-07-10 Thread Max Kuhn
On Fri, Jul 10, 2009 at 1:27 AM, matsumotoN wrote: > > Hi. Can anyone suggest how to use the output of pcaNNet() to construct a > confusion matrix possibly using > confusionMatrix()? > Thank you. Take a look at the manual (?predict.pcaNNet) and one of the four package vignettes: http://cran.r-p

Re: [R] generalized linear model (glm) and "stepAIC"

2009-07-10 Thread Ben Bolker
If you possibly can, you should get some local statistical advice. There are a number of pitfalls involved in what you're doing. Frank Harrell's book is a good reference, but may be too advanced if you are a beginner. You are right on the edge of having too little data for what you want to do

Re: [R] \dQuote in packages

2009-07-10 Thread Uwe Ligges
Rebecca Sela wrote: Here is one Rd file with problems, now inline so that it can be read: \name{simpleREEMdata} \docType{data} \alias{simpleREEMdata} \title{Sample Data for RE-EM trees} \description{ This data set is consists of a panel of 50 individuals with 12 observations per individual.

[R] Error when running the examples in plotMultiTS / QRMlib

2009-07-10 Thread stvienna wiener
Dear List, R ist somtimes a bit frustrating... I ran the example from http://bm2.genes.nig.ac.jp/RGM2/R_current/library/QRMlib/man/plotMultiTS.html and I get an error. Has someone an explanation for this? Thanks a lot, Steve CODE: library(R.utils) library(tseries) library(wmtsa) libra

Re: [R] IF STATEMENTS

2009-07-10 Thread Dimitris Rizopoulos
you just need to use quotes, e.g., if (type == "Lower") { tL <- - tU <- qt(1-alpha,n-1) } and so on. I hope it helps. Best, Dimitris Mary A. Marion wrote: Hello, I am working on using if statements. What is the error message telling me here and how do I correct for it? I have

[R] to get R-squared value

2009-07-10 Thread Agus Susanto
Many thanks again for all help. I then also learnt that to get the "Adjusted R-squared", I just issued command "summary(lm(y~x))$adj.r.squared". __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] to get the R-Squared value

2009-07-10 Thread Greg Hirson
Agus, Take a look at the summary method for lm - ?summary.lm x = 1:10 y = 2*x + rnorm(10) summary(lm(y~x)) names(summary(lm(y~x))) summary(lm(y~x))$r.squared # [1] 0.9892822 Hope that helps, Greg Agus Susanto wrote: Dear all, I know there are 'coef', 'predict', 'fit' to get the correspon

Re: [R] to get the R-Squared value

2009-07-10 Thread Henrique Dallazuanna
Using the example from lm help page: summary(lm.D9)$r.squared See str(summary(lm.D9)) for more options. On Fri, Jul 10, 2009 at 7:01 PM, Agus Susanto wrote: > Dear all, > I know there are 'coef', 'predict', 'fit' to get the corresponding > outputs. Is that possible to get the value of R-square

Re: [R] IF STATEMENTS

2009-07-10 Thread Bert Gunter
See also ?switch (where quotes are _not_ required). Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dimitris Rizopoulos Sent: Friday, July 10, 2009 1:15 PM To: Mary A. Marion Cc: r-hel

Re: [R] Randomizing a dataframe

2009-07-10 Thread Mark Na
Greg's reply was just what I needed to get me going. I used his advice to produce a program which does just what I need. In case it helps someone else, my program is below. Mark Na library(reshape) data<-read.csv("data.csv") datam<-melt(data,id=("TREE")) #value = number of individuals datam<-da

Re: [R] Degree of freedom in the linear mixed effect model using lme function in R

2009-07-10 Thread Djibril Dayamba
Hi Kingsford, Thanks a lot for your reply; I am getting more confident now. Before (your email), I went through Pinheiro and Bates (2000) and Zuur et al. (2009) but I could not clearly set my mind. I will carefully again read the chapter and the sections you suggested. With regards, Sidzabda

[R] to get the R-Squared value

2009-07-10 Thread Agus Susanto
Dear all, I know there are 'coef', 'predict', 'fit' to get the corresponding outputs. Is that possible to get the value of R-squared from a 'lm' output? Many thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] prevalence in logistic regression lrm()

2009-07-10 Thread array chip
Hi, I am wondering if there is a way to specify the prevalence of events in logistic regression using lrm() from Design package? Linear Discriminant Analysis using lda() from MASS library has an argument "prior=" that we can use to specify the prevalent of events when the actual dataset being a

Re: [R] t-scores and correlation

2009-07-10 Thread Jorge Ivan Velez
Hi Adrian, Using cor.test you need either two variables or a formula as stated in ?cor.test :-) Take a look at http://www.nabble.com/Re:-applying-cor.test-to-a-(m,-n)-matrix---SUMMARY-to17150239.html#a17150239 for different alternatives to do what you asked for. HTH, Jorge On Fri, Jul 10, 2

Re: [R] Degree of freedom in the linear mixed effect model using lme function in R

2009-07-10 Thread Kingsford Jones
Hi Sidzabda, Adjusting df for non-sphericity is generally not discussed in modern mixed effects modeling because likelihood-based estimators are far more flexible in structuring covariance matrices than the classical method of moments estimators based on expected mean squares. However, there are

Re: [R] t-scores and correlation

2009-07-10 Thread Adrian Johnson
Thank you Jorge. I tried it, i have the following error. honestly I dont understand the error. could you help please. thank you. > cor.test(t(longley),method='pearson') Error in cor.test.default(t(longley), method = "pearson") : element 1 is empty; the part of the args list of 'length' being

Re: [R] t-scores and correlation

2009-07-10 Thread Jorge Ivan Velez
Dear Adrian, See ?cor.test. HTH, Jorge On Fri, Jul 10, 2009 at 4:13 PM, Adrian Johnson wrote: > Hi I have a matrix with samples on columns and variables and their > values on rows. > I want to calculate correlation (pearson) between a variable and > others in rows and obtain t-scores for the v

[R] t-scores and correlation

2009-07-10 Thread Adrian Johnson
Hi I have a matrix with samples on columns and variables and their values on rows. I want to calculate correlation (pearson) between a variable and others in rows and obtain t-scores for the variables. how can i do it. thank you. Ad __ R-help@r-project.o

Re: [R] IF STATEMENTS

2009-07-10 Thread Godmar Back
It thinks twoSided is a variable, but you've never assigned such a variable. Use "twoSided" instead - that's a string constant. On Fri, Jul 10, 2009 at 4:04 PM, Mary A. Marion wrote: > Hello, > > I am working on using if statements.  What  is the error message telling me > here and how do I correc

[R] IF STATEMENTS

2009-07-10 Thread Mary A. Marion
Hello, I am working on using if statements. What is the error message telling me here and how do I correct for it? I have tried various combinations of quotes. Thank you. Sincerely, Mary A. Marion #Find critical values crit<-function(n,alpha,type) { if (type==twoSided) { alpha2=alpha/2 tL<

[R] generalized linear model (glm) and "stepAIC"

2009-07-10 Thread Simone Santoro
Hi, I'm a very new user of R and I hope not to be too "basic" (I tried to find the answer to my questions by other ways but I was not able to). I have 12 response variables (species growth rates) and two environmental factors that I want to test to find out a possible relation. The sample s

Re: [R] \dQuote in packages

2009-07-10 Thread Rebecca Sela
Here is one Rd file with problems, now inline so that it can be read: \name{simpleREEMdata} \docType{data} \alias{simpleREEMdata} \title{Sample Data for RE-EM trees} \description{ This data set is consists of a panel of 50 individuals with 12 observations per individual. The data is based on a r

[R] problem aligning barplot and scatter plot (ala 'layout' example)

2009-07-10 Thread Steve Jaffe
I'm trying just to do the x-barplot + scatterplot from the layout example. The barplot does not come out aligned horizontally with the scatter plot, although I am passing in the same xlim to both. When I run the example it comes out correctly. I haven't figured out what I'm doing differently, e

[R] maximum and C.L.

2009-07-10 Thread Nahuel farias
Hello everybody Someone know how I can determine the global maximum from a sm.spline second derivative and a 95% confidence limits for that point? Thanks in advance -- Lic. Nahuel E. Farias Laboratorio de Invertebrados Departamento de Biología Facultad de Ciencias Exactas y Naturales, Universid

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread Stavros Macrakis
On Fri, Jul 10, 2009 at 8:58 AM, Marc Schwartz wrote: > Review the Note in ?as.character: > "as.character truncates components of language objects to 500 characters > (was about 70 before 1.3.1)." > If this limitation is too hard to fix, shouldn't it at least give a warning or an error?

Re: [R] RUnit detects parse error, but why?

2009-07-10 Thread Seeliger . Curt
> > An RUnit test suite is failing after all tests are complete with the > > following message: > > > > Error in parse(n = -1, file = file) : unexpected '}' at > > 620: > > 621: } > > ... > > You need to take a look at the file that was being passed to parse. One > wa

Re: [R] predict.glm -> which class does it predict?

2009-07-10 Thread Peter Dalgaard
As for why it's not the other way around, well, if it had been, then you could have asked the same question ...and come to think about it, it is rather convenient that it meshes with the default ordering of levels in factor(x) is x is 0/1 or FALSE/TRUE. -- O__ Peter Dalgaard

Re: [R] Compiling R-2.9.1 on Mac OS X 10.4

2009-07-10 Thread Sinha, Raktim, DFCI
Hello -- Just wanted to let you know that installing XCode Tools package took care of the JRI --enable-R-shlib issue. R binary, as you guys suggested, was OK. The JRI compilation error was a bit misleading for me. Thanks for helping out a Mac novice. Raktim -Original Message- From: Sinha

[R] LondonR agenda

2009-07-10 Thread Sarah Lewis
Thank you to everyone for showing such an interest in the next LondonR meeting. Please see below the agenda for the meeting- LondonR meeting - 21st July 2009 Time:4pm - 7pm Venue: The Wall 45 Old Broad Street

[R] Windows Graphics Device Lockups with Rterm

2009-07-10 Thread David Katz
I've been using Rterm with ESS to run R for some time. Recently I've experienced lockups when displaying graphics; the first display seems to work, but then refuses to respond and must be killed with dev.off(). Rgui has no problems. I've tried eliminating all other processes that might cause confl

Re: [R] ' R ' - General Question (newbie)

2009-07-10 Thread Marc Schwartz
On Jul 10, 2009, at 12:35 PM, Mike Prager wrote: Jay Mistry wrote: First-off, I apologize if this is the wrong list to post to, but I would like to install and try out 'R', as an alternative to 'SAS' . As a newbie, could you pl let me know about the following (in terms of online resourc

Re: [R] predict.glm -> which class does it predict?

2009-07-10 Thread Gabor Grothendieck
2009/7/10 Peter Dalgaard : > Peter Schüffler wrote: >> >> Hi, >> >> I have a question about logistic regression in R. >> >> Suppose I have a small list of proteins P1, P2, P3 that predict a >> two-class target T, say cancer/noncancer. Lets further say I know that I can >> build a simple logistic re

Re: [R] ' R ' - General Question (newbie)

2009-07-10 Thread Mike Prager
Jay Mistry wrote: > First-off, I apologize if this is the wrong list to post to, but I would > like to install and try out 'R', as an alternative to 'SAS' . As a newbie, > could you pl let me know about the following (in terms of online resources > and print books) > > 1) Basics of 'R' > > 2) W

Re: [R] RUnit detects parse error, but why?

2009-07-10 Thread Duncan Murdoch
On 7/10/2009 11:53 AM, seeliger.c...@epamail.epa.gov wrote: Folks, An RUnit test suite is failing after all tests are complete with the following message: Error in parse(n = -1, file = file) : unexpected '}' at 620: 621: } All individual tests work when run individu

[R] diagram package graph margins

2009-07-10 Thread rajesh j
Hi, I'm using the diagram package to make some graph networks.But the plot window seems to have some kind of margin thats not letting the graph use entire plot space.How do i remove this? -- Rajesh.J [[alternative HTML version deleted]] __ R-h

[R] help! Error in using Boosting...

2009-07-10 Thread Michael
Here is my code: mygbm<-gbm.fit(y=mytraindata[, 1], x=mytraindata[, -1], interaction.depth=4, shrinkage=0.001, n.trees=2, bag.fraction=1, distribution="bernoulli") Here is the error: Error in gbm.fit(y = mytraindata[, 1], x = mytraindata[, -1], interaction.depth = 4, : The dataset size is t

Re: [R] ReShape/cast question - sum of value in table

2009-07-10 Thread Mark Knecht
On Fri, Jul 10, 2009 at 8:38 AM, Mark Knecht wrote: >   What I need/want is that instead of displaying '1' or '2' - the > number of events that fit these EnTime/ExTime values - I need to have > the sum of the 'value' column from ReShape.Y. > >   Is this possible? I'm sure it's related the the Aggr

[R] RUnit detects parse error, but why?

2009-07-10 Thread Seeliger . Curt
Folks, An RUnit test suite is failing after all tests are complete with the following message: Error in parse(n = -1, file = file) : unexpected '}' at 620: 621: } All individual tests work when run individually, and all but one run within the RUnit test suite. What mi

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread Gabor Grothendieck
Marc has already answered your question. It may also be possible to avoid the long formua in the first place in the context of lm and certain similar functions as we can write this lm(y1 ~ x1 + x2 + x3 + x4, anscombe) as lm(y1 ~., anscombe[1:5]) where anscombe is a data set that is built into

[R] getting a timeseries element into a string

2009-07-10 Thread tradenet
I have a timeseries object, ts, and want to get the first date in the series into a string so I can concatenate it with a SQL query. Input and output are shown below. I must be missing something very basic, but I can't seem to pry the data ("2008-07-01") into a string variable. Any suggestions w

Re: [R] predict.glm -> which class does it predict?

2009-07-10 Thread Peter Dalgaard
Peter Schüffler wrote: Hi, I have a question about logistic regression in R. Suppose I have a small list of proteins P1, P2, P3 that predict a two-class target T, say cancer/noncancer. Lets further say I know that I can build a simple logistic regression model in R model <- glm(T ~ ., data=

[R] ReShape/cast question - sum of value in table

2009-07-10 Thread Mark Knecht
Hi, I've tried to capture the basics of this problem I'm having. Been working on this for a couple of days and just cannot get past it. As a test of this list software I've attached is a small text file zipped up. I hope it gets through but if it doesn't I'll post the actual text which is only 2

[R] Degree of freedom in the linear mixed effect model using lme function in R

2009-07-10 Thread Djibril Dayamba
Hello, I would appreciate if somebody could help me clear my mind about the below issues. I have a factorial experiment to study the effects of Grazing and Fire on Forest biomass production. The experimental unit (to which the treatment combinations are applied) are PLOTs. The measures were made

Re: [R] predict.glm -> which class does it predict?

2009-07-10 Thread Marc Schwartz
On Jul 10, 2009, at 9:46 AM, Peter Schüffler wrote: Hi, I have a question about logistic regression in R. Suppose I have a small list of proteins P1, P2, P3 that predict a two-class target T, say cancer/noncancer. Lets further say I know that I can build a simple logistic regression model

[R] A Lattice Plotting Problem

2009-07-10 Thread Jun Shen
Hi, I have this plotting problem in lattice and appreciate any comments. Say, I want to plot observed drug concentrations in point and prediction in line xyplot(CONC~TIME,data=df1, panel=function(x,y,...){ panel.xyplot(x,y,type='p',col='blue') PRED=df1$PRED panel.xyplot(x,PRED,type='l',col

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread tradenet
Thanks Marc. I forwarded the suggestion to Dr. Wuertz and Dr. Chalabi at Rmetrics. Warm regards, Andrew Borden Marc Schwartz-3 wrote: > > On Jul 10, 2009, at 9:07 AM, tradenet wrote: > >> >> Thanks Marc! >> >> I just found that the ~500 char limitation via an online search for >> the >>

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread Andrew
Thanks Marc.  I really appreciate your help.  I'm going to try my function hack. I forwarded your suggestion to Yohan at rmetrics. Warm regards, Andrew --- On Fri, 7/10/09, Marc Schwartz wrote: From: Marc Schwartz Subject: Re: [R] strange strsplit gsub problem 0 is this a bug or a string le

Re: [R] how can I download an english version of R ?

2009-07-10 Thread Marc Schwartz
On Jul 10, 2009, at 4:43 AM, Casimir de Rham wrote: Dear colleagues, I am Professor of Operations Management at IUM, Intl. University of Monaco. The language at IUM is English and I want to test R. But I'm unable to get an English version (only useless French). Please help me. Thanks,

[R] predict.glm -> which class does it predict?

2009-07-10 Thread Peter Schüffler
Hi, I have a question about logistic regression in R. Suppose I have a small list of proteins P1, P2, P3 that predict a two-class target T, say cancer/noncancer. Lets further say I know that I can build a simple logistic regression model in R model <- glm(T ~ ., data=d.f(Y), family=binomial)

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread Marc Schwartz
On Jul 10, 2009, at 9:07 AM, tradenet wrote: Thanks Marc! I just found that the ~500 char limitation via an online search for the specs for the formula class The rmetrics library I'm using get's it's character array of assets by parsing a formula passed as an input parameter to the portfo

Re: [R] how can I download an english version of R ?

2009-07-10 Thread Mark Knecht
On Fri, Jul 10, 2009 at 2:43 AM, Casimir de Rham wrote: > Dear colleagues, > > I am Professor of Operations Management at IUM, Intl. University of Monaco. > > The language at IUM is English and I want to test R. > > But I'm unable to get an English version (only useless French). > > Please help me.

[R] Hi Friends

2009-07-10 Thread deepak m r
Hi, Can u please help me to cleaning my R History. I will be very greatful to u if u r helping in this regards. best regards, Deepak.M.R PhD Student Department of Computer Science University of Bologna Italy __ R-help@r-project.org mailing list https

Re: [R] Computer Modern

2009-07-10 Thread Mr Derik
Thank you for your help. I've read all the documentation I can find and I still can't get this to work. postscriptFonts() in my console produces a list of fonts already mapped yes? one of which is: $ComputerModernItalic $family [1] "ComputerModernItalic" $metrics [1] "CM_regular_10.afm" "CM_

[R] Colour in banner/silhouette plot

2009-07-10 Thread Graham Leask
Dear List How do you change the colour settings for the banner/silhouette plot? I am trying to produce a black and white plot of publication quality. Is there a way to set black and white plots as the default for R graphics? Any help greatly appreciated. Graham Leask Economics & S

Re: [R] X-axis labels not displayed when changing ylim

2009-07-10 Thread Sarah Bonnin
That made the deal, i tried to change a bunch of parameters before but i am not yet familiar enough with the par("usr") one... Thank you very much! -Mensaje original- De: Patrick Connolly [mailto:p_conno...@slingshot.co.nz] Enviado el: jue 09/07/2009 22:36 Para: Sarah Bonnin CC: r-help@r

[R] Bayesian logistic regression for 85.000 variables

2009-07-10 Thread nikolay12
Dear all, I want to build a text classification model with about 85.000 features (variables) on about 10.000 observations (words that have been manually classified). I want to use multivariate logistic regression (known also as maximum entropy) with Gaussian priors. So in essence it is Bayesian l

[R] how can I download an english version of R ?

2009-07-10 Thread Casimir de Rham
Dear colleagues, I am Professor of Operations Management at IUM, Intl. University of Monaco. The language at IUM is English and I want to test R. But I'm unable to get an English version (only useless French). Please help me. Thanks, Casimir SYSTEMS CONSULT, Pr Dr C. de RHAM 17 av de

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread tradenet
Thanks Marc! I just found that the ~500 char limitation via an online search for the specs for the formula class The rmetrics library I'm using get's it's character array of assets by parsing a formula passed as an input parameter to the portfolioBacktest function. Can I copy the portfolioBackte

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Renaud Gaujoux
Nice, I'll see which methods suits better my use. It's just that I was expecting the initialize-callNextMethod-validity workflow to work automatically in such a situation. Thanks so much Martin. Martin Morgan wrote: Renaud Gaujoux wrote: Hi, The technique of writing constructors prevent

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Martin Morgan
Renaud Gaujoux wrote: > Hi, > > The technique of writing constructors prevent from using simply the > 'new' function (which I find nice as it takes the class to construct as > a character string (useful in my project) and provides a single > interface for object creation). > So doesn't the built-i

Re: [R] How to number a subset consecutively from 1 to n?

2009-07-10 Thread Jorge Ivan Velez
Dear Jens, Here is one way: x$sequ <- ave(x$dv, paste(x$block, x$trial, sep=""), FUN = function(x) seq(length(x)) ) x where x is your data. HTH, Jorge On Fri, Jul 10, 2009 at 9:27 AM, Jens Bölte wrote: > Hello, > > I have a data frame of the following form > > block trial dv > 1 1 10 > 1 1 1

Re: [R] How to number a subset consecutively from 1 to n?

2009-07-10 Thread Henrique Dallazuanna
Try this: transform(d, sequ = ave(seq(trial), trial, FUN=seq)) On Fri, Jul 10, 2009 at 10:27 AM, Jens Bölte wrote: > Hello, > > I have a data frame of the following form > > block trial dv > 1 1 10 > 1 1 11 > 1 1 9 > 1 2 12 > 1 2 9 > 1 3 12 > 1 3 13 > 1 3 14 > 1 3 15 > 1 4 12 > 1 4 11 > 1 4 1

Re: [R] A question about digest mode

2009-07-10 Thread Duncan Murdoch
On 10/07/2009 9:13 AM, Peter Flom wrote: Good morning I recently shifted to digest mode; I get the digest each day (sometimes two in a day) and when I open the first file it opens as a text file with a list of topics; but then it is hard to find the right message. In a list of 100 or so links

[R] How to number a subset consecutively from 1 to n?

2009-07-10 Thread Jens Bölte
Hello, I have a data frame of the following form block trial dv 1 1 10 1 1 11 1 1 9 1 2 12 1 2 9 1 3 12 1 3 13 1 3 14 1 3 15 1 4 12 1 4 11 1 4 10 1 4 9 1 4 11 and need to number the rows consecutively in the following manner block trial dv sequ 1 1 10 1 1 1 11 2 1 1 9 3 1 2 12 1 1 2 9 2 1

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-10 Thread Martin Morgan
Renaud Gaujoux wrote: > Thanks Martin, > > I'll try that. One question about memory though, just to be sure. When > one does: > > # create new instance of A > a <- new('A', ...) > # create new instance of B based on a > b <- new('B', a, b=...) > > Will two instances of A be created (using twice

[R] problems with contrast matrix

2009-07-10 Thread doris gomez
Dear lme and lmer -ers, I have some problems using "home-made" contrast matrix in lme and lmer. I did an experiment to investigate the relationship between the response of an animal and some factors, namely the light wavelength (WA), the light intensity to which this animal was exposed and the s

[R] A question about digest mode

2009-07-10 Thread Peter Flom
Good morning I recently shifted to digest mode; I get the digest each day (sometimes two in a day) and when I open the first file it opens as a text file with a list of topics; but then it is hard to find the right message. In a list of 100 or so links, counting to find link number 53 or whatev

Re: [R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread Marc Schwartz
On Jul 10, 2009, at 7:18 AM, tradenet wrote: I was working with the rmetrics portfolioBacktesting function and dug into the code to try to find why my formula with 113 items, i.e. A1 thru A113, was being truncated and I only get 85 items, not 113. Is it due to a string length limitation i

[R] strange strsplit gsub problem 0 is this a bug or a string length limitation?

2009-07-10 Thread tradenet
I was working with the rmetrics portfolioBacktesting function and dug into the code to try to find why my formula with 113 items, i.e. A1 thru A113, was being truncated and I only get 85 items, not 113. Is it due to a string length limitation in R or is it a bug in the strsplit or gsub functions,

Re: [R] Counting the number of cycles in a temperature test

2009-07-10 Thread Arien Lam
Hi Antje, Say, if a cycle consists of an episode of high temperature and an episode of low temperature, you could count the end of these episodes, i.e. check how often your timeseries crosses an intermediate temperature. try: temperature <- sin(1:1000/10) # replace with your own previoustemp

[R] raw object into mysql blob column

2009-07-10 Thread Christian Schulz
Hi, exist a possibility write a raw object into a mysql blob column? My first trial and a second with a rawToChar after .jserialize didn't work. mobj <- .jserialize(model) > str(mobj) raw [1:203761] ac ed 00 05 ... sqlstring=paste("Insert into testtable (varname,number,model) values(",modelNa

Re: [R] how to export image (TIF, BMP or JPG) from SpatialGridDataFrame or SpatialPixelDataFrame

2009-07-10 Thread Paulo E. Cardoso
I'm trying to export a SPDF to a image. The original file, when imported into R (JPG with rGDAL) have dimension = 997x997. When I save as bmp the image(spdf), i get a 672x672 image. Paulo E. Cardoso __ R-help@r-project.org mailing list htt

Re: [R] 'scan' in a script?

2009-07-10 Thread jim holtman
I have no problem running a script that uses readline when the script is 'source'd in. If you are going a cut/paste to the console, then it is using the standard input and readline (or any other input that you would expect to be able to enter from the console) will start reading your source. Here

[R] GLM for Probit for Panel Data

2009-07-10 Thread saurav pathak
Hello I am working on a panel data, my panel variable is the variable "yearctry", let me explain what I mean, yearctry is calculated based on the year and the ISD phone code of a country, eg, for the year 2000 say and for country USA say (code = 001), my yearctry variable will then be 201, ther

[R] Odp: while( ) to get a vector until the sum of elements are <= X ?

2009-07-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.07.2009 12:07:03: > I have a vector of values > > > > X = seq(1:10) > > > > I want to get another vector V of with sample (with replacement) of X but > with a constrain: V will have as much elements as those necessary to V sum > exactly 10. >

Re: [R] drawing hmms

2009-07-10 Thread rajesh j
Hi, I need to draw a finite state machine and each state in it is associated with a scatter plot. So beside/above/below each state, I need to include a tiny box which has the scatterplot. I can draw the FSM with the diagram package, but how do I include a plot within it? On Fri, Jul 10, 2009 at

Re: [R] Hi Friends

2009-07-10 Thread Jim Lemon
deepak m r wrote: Hi, Can u please help me to cleaning my R History. I will be very greatful to u if u r helping in this regards. Hi Deepak, Do you mean deleting the .Rhistory file in the directory in which you run R? Jim __ R-help@r-project.

Re: [R] changing point style in xyplots depending on groups

2009-07-10 Thread Gabor Grothendieck
Try this: xyplot(y ~ x, df, groups = gr, pch = c(1, 6, 16)) On Fri, Jul 10, 2009 at 6:03 AM, Thomas von Känel wrote: > hi, > i've got the following and would like to set the point style for A, B and C > myself (eg pch=1, 6 and 16) > > library(lattice) > df <- data.frame(x  = log(c(1, 0.5 ,0.2 ,0

Re: [R] ' R ' - General Question (newbie)

2009-07-10 Thread Gabor Grothendieck
Go the R home page and click on Manuals, click on Books and click on Download in the left hand column. google for R Contributed Documentation and take the first hit. (To those who maintain the R home page -- this should be listed in the left hand column as well.) Also read the posting guide refer

Re: [R] changing point style in xyplots depending on groups

2009-07-10 Thread Paul Hiemstra
Thomas von Känel wrote: hi, i've got the following and would like to set the point style for A, B and C myself (eg pch=1, 6 and 16) library(lattice) df <- data.frame(x = log(c(1, 0.5 ,0.2 ,0.12 ,0.06, 1, 0.5 ,0.2, 0.12,0.06, 1, 0.5 ,0.2 ,0.12,0.06)), y = c(1, 2, 5, 14, 24, 51, 50, 50

Re: [R] Executing an error prone function without stopping a script

2009-07-10 Thread Tolga I Uzuner
Many thanks ! Tolga -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: 09 July 2009 23:49 To: Tolga I Uzuner Cc: r-help@r-project.org Subject: Re: [R] Executing an error prone function without stopping a script Tolga I Uzuner wrote: > Dear R Users, > > I've used

Re: [R] how to create 3d graph w/ spherical coordinates?

2009-07-10 Thread Duncan Murdoch
Buzz Buzzerr wrote: Are there any R-routines/packages that will do 3d graphics for data in spherical coordinates? I have had no luck with Google searches. Thanks in advance for your reply. Buz I don't know of one, but you can certainly write a function to translate your version of sphe

Re: [R] drawing hmms

2009-07-10 Thread milton ruser
Hi Rajesh, It is starting to be better... tell us more... telll us more...Don't hesitate to state to us what you really need (in details, so we can realize..). Meanwhile, take a look ate http://research.stowers-institute.org/efg/R/ http://addictedtor.free.fr/graphiques/ bests milton On Fri, Jul

[R] ' R ' - General Question (newbie)

2009-07-10 Thread Jay Mistry
Hi, First-off, I apologize if this is the wrong list to post to, but I would like to install and try out 'R', as an alternative to 'SAS' . As a newbie, could you pl let me know about the following (in terms of online resources and print books) I have previously used SAS/BASE in a Biostatistics/ E

Re: [R] Hi Friends

2009-07-10 Thread deepak m r
Hi,   Can u please help me to cleaning my R History.  I will be very greatful to u if u r helping in this regards. best regards, Deepak.M.R PhD Student Department of Computer Science University of Bologna Italy __ R-help@r-project.org mailing lis

Re: [R] Hi Friends

2009-07-10 Thread deepak m r
Hi, Can u please help me to cleaning my R History. I will be very greatful to u if u r helping in this regards. best regards, Deepak.M.R PhD Student Department of Computer Science University of Bologna Italy __ R-help@r-project.org mailing list https:

[R] while( ) to get a vector until the sum of elements are <= X ?

2009-07-10 Thread Paulo E. Cardoso
I have a vector of values X = seq(1:10) I want to get another vector V of with sample (with replacement) of X but with a constrain: V will have as much elements as those necessary to V sum exactly 10. If the N-th value of V make the sum greater than 10, it's is subtracted with the diff

[R] arr.lcol in plotmat from diagram package

2009-07-10 Thread rajesh j
Hi, I wish to use different colours for different arrows. Is this possible? -- Rajesh.J [[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 htt

[R] changing point style in xyplots depending on groups

2009-07-10 Thread Thomas von Känel
hi, i've got the following and would like to set the point style for A, B and C myself (eg pch=1, 6 and 16) library(lattice) df <- data.frame(x = log(c(1, 0.5 ,0.2 ,0.12 ,0.06, 1, 0.5 ,0.2, 0.12,0.06, 1, 0.5 ,0.2 ,0.12,0.06)), y = c(1, 2, 5, 14, 24, 51, 50, 50, 49, 54, 100, 101, 103,

Re: [R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-10 Thread Petr PIKAL
Hi you have to look to your data when I used your function to some artificial data I got expected result > myfun(visko,"konc") Levels = 2 [[1]] [1] NA [[2]] Welch Two Sample t-test data: data[[nam[v]]] by data[[g]] t = -1.7778, df = 4.541, p-value = 0.1415 alternative hypothesis:

Re: [R] X-axis labels not displayed when changing ylim

2009-07-10 Thread Jim Lemon
Sarah Bonnin wrote: Dear R users, I am encountering a x axis labeling problem on quite basic plots... I use the following code which displays the labels on the x-axis with a 45 degrees angle: p <- plot(myobject1, type="b", col="red",cex=1, lwd=2, axes=FALSE, ann=FALSE, ylim=c(0,70)) title(m

Re: [R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-10 Thread Tymek W
Thanks for your hints, but I'm still stuck... In dataset I mentioned (N=134) there are only 3 NA's in variable, and 41% : 59% distribution of the two values. It doesn't look like it was because of the data... I changed and simplified my function, now it prints levels before doing the rest. Here's

  1   2   >