Re: [R] p value in R - beginners question

2011-10-19 Thread Ken Hutchison
The p-value as I understand it, is the probability of seeing a phenomenon at least as extreme as the one which you observed assuming the null hypothesis is true. In other words, if you assume there is no difference (which is the NULL for you here I believe), and there is an 81% chance of seeing

[R] Help Reformatting a Data table

2011-10-19 Thread Michael E. Steiper
Hi, I am a relative newbie to R, so thanks in advance for the patience. I am interesting in changing a table with year data into a format that is friendlier for making bar charts. I currently have a table with the same year appearing a number of times as separate rows. I want to change this so

Re: [R] Ordering of stack in ggplot (package ggplot2)

2011-10-19 Thread swonder03
That worked great thank you. -- View this message in context: http://r.789695.n4.nabble.com/Ordering-of-stack-in-ggplot-package-ggplot2-tp3917159p3917520.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] converting string fractions to numerics

2011-10-19 Thread Erin Hodgess
Dear R People: Suppose I have the following: pi/2 and I would like it to be 1.57. Using as.numeric, here is my result: as.numeric(pi/2) [1] NA Warning message: NAs introduced by coercion Is there a way to produce the numeric result, please? Thanks, Erin -- Erin Hodgess Associate

[R] Using SQL IN with RJDBC or RMySQL

2011-10-19 Thread David Epstein
Hello, The code below works fine up until I try to use the IN statement in the last line. The proper SQL format is: SELECT * FROM this_table WHERE this_column IN (1,2,3,4,5) But, I think I may be getting something like: SELECT * FROM this_table WHERE this_column IN c(1,2,3,4,5) Which makes

[R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-19 Thread beiyu
hi, I have a problem. The R shows that Error in 1/ue : non-numeric argument to binary operator. Here is the code: # simulation of tempered stable processes by compound Poisson approximation tsp-function(n,e,a,c,lema){ x-numeric(n) for (i in 1:n){ repeat{ w-runif(1) v-runif(1)

Re: [R] Using SQL IN with RJDBC or RMySQL

2011-10-19 Thread Jeff Newmiller
You are misusing SQL variable substitution. Just embed the list in the SQL statement itself. paste(SELECT * FROM this_table WHERE this_column IN (, paste(org_table$id, collapse=TRUE),),sep=) Better yet, use a SQL join so you can do this sequence in one SQL statement.

Re: [R] converting string fractions to numerics

2011-10-19 Thread R. Michael Weylandt michael.weyla...@gmail.com
I would imagine that you could parse+evaluate it like you asked about on another thread; this isn't tested though. Does that work in your context? Michael Weylandt On Oct 19, 2011, at 2:30 AM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: Suppose I have the following: pi/2

Re: [R] converting string fractions to numerics

2011-10-19 Thread baptiste auguie
Hi, I believe you want eval(parse(text=pi/2)) a word of warning exemplified in eval(parse(text=library(fortunes) ; fortune(106))) HTH, baptiste On 19 October 2011 19:30, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: Suppose I have the following: pi/2 and I would like

Re: [R] converting string fractions to numerics

2011-10-19 Thread Rolf Turner
On 19/10/11 19:30, Erin Hodgess wrote: Dear R People: Suppose I have the following: pi/2 and I would like it to be 1.57. Using as.numeric, here is my result: as.numeric(pi/2) [1] NA Warning message: NAs introduced by coercion Is there a way to produce the numeric result, please?

Re: [R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-19 Thread R. Michael Weylandt
Short answer since it's late: integrate doesn't return a number (directly): add $value somewhere (either on the integrate() output before assignment or on later use of ue) and you should be fine. Michael On Wed, Oct 19, 2011 at 1:11 AM, beiyu beiyu...@gmail.com wrote: hi, I have a problem. The

Re: [R] converting string fractions to numerics

2011-10-19 Thread Erin Hodgess
Here is another possibility: xxx [1] pi/2 1/2 sapply(strsplit(xxx,split=/), + function(x) { + x - ifelse(x==pi,pi,x) + as.numeric(x[1])/as.numeric(x[2]) + } + ) [1] 1.570796 0.50 Thanks for everyone's help! Sincerely, Erin On Wed, Oct 19, 2011 at 2:06 AM, Rolf Turner

Re: [R] getting p-value and standard error in PLS

2011-10-19 Thread Bjørn-Helge Mevik
arunkumar akpbond...@gmail.com writes: How to get p-value and the standard error in PLS There is (to my knowledge) no theory able to calculate p-values for the regression coefficients in PLS regression. Most practicioners use cross-validation to estimate the Root Mean Squared Error (RMSEP)

Re: [R] Help Reformatting a Data table

2011-10-19 Thread Dennis Murphy
Here's one way to do it using the reshape package: library('reshape') cast(A, YEAR ~ TAX, value = 'NUMBER', fill = 0) YEAR A B 1 2000 2 3 2 2001 2 4 3 2002 3 3 4 2003 1 0 5 2004 0 2 HTH, Dennis On Tue, Oct 18, 2011 at 7:51 PM, Michael E. Steiper michaelstei...@gmail.com wrote: Hi, I am a

[R] Test Case for Package

2011-10-19 Thread Vikram Bahure
Hi, I had a query for writing a test case for a package. If we are testing a function then do we need to call that function for testing; library(mypackage)? Is that any circular logic any way. For eg. if I create a package mypackage, can I have a file mypackagetest in the tests directory whose

[R] R installtion

2011-10-19 Thread Praveen
I have a problem in installation Rattle in my windows 7 platform. I m getting a error like this Cannot convert RGtkBuilder to GType -- View this message in context: http://r.789695.n4.nabble.com/R-installtion-tp3917745p3917745.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-19 Thread beiyu
thx very much -- View this message in context: http://r.789695.n4.nabble.com/Error-in-1-ue-non-numeric-argument-to-binary-operator-tp3917605p3917871.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] using a dictionary in R

2011-10-19 Thread Eran Eidinger
Hi all, Is there a way to create a dictionary in R, such that it has key,value pairs? Something to the effect of: x=dictionary(c(Hi,Why,water) , c(1,5,4)) x[Why]=5 In truth I'm looking two categorial variables function. So that if x=dictionary(c(a,b),c(5,2)) x val 1 a 5 2 b 2 I want to

Re: [R] using a dictionary in R

2011-10-19 Thread p . pagel-lists
On Wed, Oct 19, 2011 at 11:06:21AM +0200, Eran Eidinger wrote: Hi all, Is there a way to create a dictionary in R, such that it has key,value pairs? Something to the effect of: x=dictionary(c(Hi,Why,water) , c(1,5,4)) x[Why]=5 You can do that with named elements of a vector: foo -

[R] listing all occurrences in a vector

2011-10-19 Thread Jonas Fransson
Dear all, I have a dataframe with two columns, where NUMBER is the number of occurrences of DEPTH: DEPTH NUMBER 1 2 1 2 3 2 3 2 3 4 5 1 a-data.frame(c(2,3,2,5),c(1,2,3,1)) colnames(a)=c(DEPTH,NUMBER) I want a column or a vector where all the DEPTHs are

Re: [R] p value in R - beginners question

2011-10-19 Thread niki
Thanks for your help. I was not familiar with this form of notating the p value. -- View this message in context: http://r.789695.n4.nabble.com/p-value-in-R-beginners-question-tp3915873p3918140.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] R-help Digest, Vol 104, Issue 19

2011-10-19 Thread mihalicza . peter
Október 19-től 21-ig irodán kívül vagyok, és az emailjeimet nem érem el. Sürgős esetben kérem forduljon Kárpáti Edithez (karpati.e...@gyemszi.hu). Üdvözlettel, Mihalicza Péter I will be out of the office from 19 till 21 October with no access to my emails. In urgent cases please contact Ms.

[R] Subsetting data by eliminating redundant variables

2011-10-19 Thread aajit75
Dear All, I am new to R, I have one question which might be easy. I have a large data with more than 250 variable, i am reducing number of variables by redun function as in the example below, n - 100 x1 - runif(n) x2 - runif(n) x3 - x1 + x2 + runif(n)/10 x4 - x1 + x2 + x3 + runif(n)/10 x5 -

Re: [R] Foreach (doMC)

2011-10-19 Thread Jay Emerson
P.S. Is there any particular reason why there are so seldom answers to posts regarding foreach and all these doMC/doSMP packages ? Do so few people use these packages or does this have anything to do with the commercial origin of these packages? Jannis, An interesting question. I'm a

Re: [R] listing all occurrences in a vector

2011-10-19 Thread Paul Hiemstra
On 10/19/2011 09:00 AM, Jonas Fransson wrote: Dear all, I have a dataframe with two columns, where NUMBER is the number of occurrences of DEPTH: DEPTH NUMBER 1 2 1 2 3 2 3 2 3 4 5 1 a-data.frame(c(2,3,2,5),c(1,2,3,1)) colnames(a)=c(DEPTH,NUMBER)

Re: [R] R installtion

2011-10-19 Thread Prof Brian Ripley
On Tue, 18 Oct 2011, Praveen wrote: I have a problem in installation Rattle in my windows 7 platform. From sources? From binaries? I m getting a error like this Cannot convert RGtkBuilder to GType So you do not have a suitable version of Gtk+ installed (on which RGtk2 depends, on

Re: [R] listing all occurrences in a vector

2011-10-19 Thread Ben Bolker
Jonas Fransson jf at iva.dk writes: I have a dataframe with two columns, where NUMBER is the number of occurrences of DEPTH: a-data.frame(c(2,3,2,5),c(1,2,3,1)) colnames(a)=c(DEPTH,NUMBER) I want a column or a vector where all the DEPTHs are listed: 2, 3, 3, 2, 2, 2, 5 (NUMBER=1 in

Re: [R] Test Case for Package

2011-10-19 Thread Uwe Ligges
On 19.10.2011 10:13, Vikram Bahure wrote: Hi, I had a query for writing a test case for a package. If we are testing a function then do we need to call that function for testing; library(mypackage)? Is that any circular logic any way. For eg. if I create a package mypackage, can I have a

Re: [R] Using SQL IN with RJDBC or RMySQL

2011-10-19 Thread David Epstein
thank you! I was able to get it to work with collapse=, On Wed, 2011-10-19 at 01:52 -0500, Jeff Newmiller wrote: paste(SELECT * FROM this_table WHERE this_column IN (, paste(org_table$id, collapse=TRUE),),sep=) __ R-help@r-project.org mailing list

Re: [R] Using SQL IN with RJDBC or RMySQL

2011-10-19 Thread Gabor Grothendieck
On Wed, Oct 19, 2011 at 12:35 AM, David Epstein david...@umich.edu wrote: Hello, The code below works fine up until I try to use the IN statement in the last line. The proper SQL format is: SELECT * FROM this_table WHERE this_column IN (1,2,3,4,5) But, I think I may be getting something

Re: [R] Non-linear maximization function in R

2011-10-19 Thread John C Nash
Could the problem be that nlm is for Minimization? In fact in the first line of the manual. JN On 10/19/2011 06:00 AM, r-help-requ...@r-project.org wrote: Message: 62 Date: Tue, 18 Oct 2011 11:12:09 -0700 (PDT) From: aazaff aaz...@uga.edu To: r-help@r-project.org Subject: [R] Non-linear

Re: [R] Using SQL IN with RJDBC or RMySQL

2011-10-19 Thread David Epstein
Gabor, thank you. I just got the script working using paste but your solution looks good as well. I was not familiar with gsubfn. Appears very useful. -david With gsubfn if you preface your function with fn$ as shown below then it turns on a quasi-perl style string interpolation:

Re: [R] Non-linear maximization function in R

2011-10-19 Thread peter dalgaard
On Oct 18, 2011, at 20:12 , aazaff wrote: # My understanding of how this is supposed to work is that the final line of the HOF function: sum(-dbinom(y,M,fv,log=TRUE)) is supposed to give the negative log-odds of that function being a good fit. HOF(p,x=Sample,y=Aequipecten,model=4) [1]

Re: [R] Subsetting data by eliminating redundant variables

2011-10-19 Thread R. Michael Weylandt
Assuming you are talking about redun() from the Hmisc package, it's much easier than you are making it: n - 100 x1 - runif(n) x2 - runif(n) x3 - x1 + x2 + runif(n)/10 x4 - x1 + x2 + x3 + runif(n)/10 x5 - factor(sample(c('a','b','c'),n,replace=TRUE)) x6 - 1*(x5=='a' | x5=='c') data1 -

Re: [R] cut data into sevral group and assign calculated values individually

2011-10-19 Thread Petr PIKAL
Hm Not much of an example. You can cut your m according to breaks cc - cut(m, c(0,331,476, 608, 791, 900)) [1] (0,331] (331,476] (476,608] (608,791] (791,900] NA Levels: (0,331] (331,476] (476,608] (608,791] (791,900] You can add NA as an extra level by factor(cc, exclude=NULL) [1] (0,331]

[R] Simple color strip

2011-10-19 Thread Brian Smith
Hi, I was trying to get an image/pdf of a sequence of colors in the order given. For example: myCols - c('#BF','#BF','#FF','#FF','#BF','#FF') I'd like to make a strip of colors as they appear in the order above and save it as a pdf file. Is there a function in the base

Re: [R] Repeat a loop until...

2011-10-19 Thread Petr PIKAL
Hi I may be completely off track without knowing mnormt package but what about using while loop for counting rows in correct datamat. #first set your matrix datamat - rmnorm(n=1500,mean=c(mean(sanad[,1]),mean(sanad[,2]),mean(sanad[,3])),varcov=covmat) #get rid of out of spec values datamat -

Re: [R] Simple color strip

2011-10-19 Thread Duncan Murdoch
On 19/10/2011 10:32 AM, Brian Smith wrote: Hi, I was trying to get an image/pdf of a sequence of colors in the order given. For example: myCols- c('#BF','#BF','#FF','#FF','#BF','#FF') I'd like to make a strip of colors as they appear in the order above and save it as

Re: [R] Simple color strip

2011-10-19 Thread Brian Smith
Hi Duncan, Yes, I'd like it without any gaps. There are likely to be at least a hundred colors, so something that is not as 'tall' (ideally an inch?) and that would be a mm or two for each color. thanks! On Wed, Oct 19, 2011 at 10:49 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On

Re: [R] Simple color strip

2011-10-19 Thread Duncan Murdoch
On 19/10/2011 11:14 AM, Brian Smith wrote: Hi Duncan, Yes, I'd like it without any gaps. There are likely to be at least a hundred colors, so something that is not as 'tall' (ideally an inch?) and that would be a mm or two for each color. Should be no problem, just follow the instructions in

Re: [R] Repeat a loop until...

2011-10-19 Thread Dénes TÓTH
If you want to generate truncated distributions, package 'tmvtnorm' can help you out. Regards, Denes Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data

[R] Cairo creates italized plots?

2011-10-19 Thread Fong Chun Chan
Hi, Has anyone else run into this weird behaviour where the text in the plots created using Cairo are always italicized. For example, library(Cairo) Cairo(file='cairo_created', type='pdf', dpi=100) plot(1:10) dev.off() This produces the following attached 'cairo_created.pdf' graph. Notice

Re: [R] Best practices for handling very small numbers?

2011-10-19 Thread Seref Arikan
Thanks Duncan, Indeed I have found a problem in my likelihood, and I'll work on the log approach again. Regarding your comment; do you think it would make sense to tackle a data set of few millions for parameter estimation using MCMC? In my case we are talking about Griddy Gibbs sampling. One

Re: [R] Best practices for handling very small numbers?

2011-10-19 Thread Duncan Murdoch
On 19/10/2011 12:02 PM, Seref Arikan wrote: Thanks Duncan, Indeed I have found a problem in my likelihood, and I'll work on the log approach again. Regarding your comment; do you think it would make sense to tackle a data set of few millions for parameter estimation using MCMC? In my case we are

[R] help with glmmADMB ZI; function maximizer failed

2011-10-19 Thread emmarosenfeld
Dear all, I am having some problems trying to run a GLMM model with zero-inflation using the alpha version of glmmADMB (0.6.4) using R (2.13.1) in Windows and I would greatly appreciate some help. My count response variable (number of birds: count) fits a negative binomial distribution and the

[R] basic csv data manip - looking for first help

2011-10-19 Thread Philippe Serruys
Hello, I need to transform an input csv file into two output files, ready to be used. It seems that R is suiting for this action, but I have no single knowledge of the R code (very few scripting experience in two other languages, from 10 years ago...) and I would need to have a script that

[R] Questions regarding R plots

2011-10-19 Thread karena
Hi Dear all, I am making some Venn Diagram plots in R. http://r.789695.n4.nabble.com/file/n3919144/venn.0.001.jpg This is one plot that I generated. What I want to do is to get rid of the black boarder line. Is there any way to do this? Thank you very much, Karena -- View this message in

[R] Estimating bivariate normal density with constrains

2011-10-19 Thread Serguei Kaniovski
Dear R-Users I would like to estimate a constrained bivariate normal density, the constraint being that the means are of equal magnitude but of opposite signs. So I need to estimate four parameters: mu(meanvector (mu,-mu)) sigma_1 and sigma_2 (two sd deviations) rho (correlation

[R] A questions regarding R plots

2011-10-19 Thread karena
Hi Dear all, I am making Venn Diagram plots in R. I attached an example: http://r.789695.n4.nabble.com/file/n3919206/venn.jpeg I want to get rid of the black boarder line, is there any way to do it? Thank you very much, Karena -- View this message in context:

Re: [R] R-help Digest, Vol 104, Issue 19

2011-10-19 Thread peter dalgaard
Argh! Someone please unsubscribe this guy? He did this over Summer too and still hasn't learned that 1 recipients of R-help do not care whether he is out of office! -pd On Oct 19, 2011, at 12:11 , mihalicza.pe...@emki.hu wrote: Október 19-től 21-ig irodán kívül vagyok, és az emailjeimet

Re: [R] A questions regarding R plots

2011-10-19 Thread Sarah Goslee
Hi Karena, On Wed, Oct 19, 2011 at 12:21 PM, karena dr.jz...@gmail.com wrote: Hi Dear all, I am making Venn Diagram plots in R. I attached an example: http://r.789695.n4.nabble.com/file/n3919206/venn.jpeg I want to get rid of the black boarder line, is there any way to do it? Probably.

[R] help with x axis on lattice barchart--R-Beginner

2011-10-19 Thread Lauren Ledesma
Hi all, I am trying to compare catch vs day over a ten year period, and the graph looks great except for the individual dates. there are so many that my x axis labels have become one giant black line. Can I only label some of the days or will I be unable to fix this using a barchart? data is

Re: [R] A questions regarding R plots

2011-10-19 Thread Patrick Connolly
On Wed, 19-Oct-2011 at 09:21AM -0700, karena wrote: | Hi Dear all, | | I am making Venn Diagram plots in R. I attached an example: | http://r.789695.n4.nabble.com/file/n3919206/venn.jpeg | | I want to get rid of the black boarder line, is there any way to do it? Don't draw it in the first

[R] Inputs from vectors in cor.test

2011-10-19 Thread Francisco Flandes
Hello, I have two numeric vectors in R and used cor.test function with them. Is it possible to know the input of a particular row of the vectors to the total correlation value and significance? Of course I just could take out that row from the vectors and run the test again to see how the results

Re: [R] A questions regarding R plots

2011-10-19 Thread Jackie Jia Zhou
Thanks for this email, Sarah. I used the package 'Vennerable'. Here is the sample code I used to generate the plot. -- set1 - ('snp1', 'snp2', 'snp3') set2 - ('snp2', 'snp5', 'snp6') set3 -

Re: [R] Simple color strip

2011-10-19 Thread baptiste auguie
Hi, Perhaps the easiest way is with grid.raster, library(grid) pdf(colorstrip.pdf, height=1, width=10) grid.raster( t(myCols), width=unit(1,npc), height=unit(1,npc), interpolate=FALSE) dev.off() HTH, baptiste On 20 October 2011 03:32, Brian Smith bsmith030...@gmail.com wrote: Hi, I was

Re: [R] R2HTML giving NULL in output

2011-10-19 Thread L.A.
Hey Guys, I'm having this same problem! I have searched and can't find anything. I'm guessing that it must be simple as nobody replied here, but I'm at a loss, Any help? L.A. R-2.13.2 XP 3 Ubuntu 11.10 -- View this message in context:

[R] tim.cond

2011-10-19 Thread Amina Shahzadi
Hi Sir Would you please tell the interpretation or meaning of tim.cond=10/365 in clust function of POT??? Waiting Regards -- *Amina Shahzadi* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Fwd: Levenshtein

2011-10-19 Thread Agnieszka
I am very new to R, so sorry that I ask stupid things. I want compare a Matrix row by row and at the end I want to a Matrix with the Levenshtein-Distance. Example: The Data (Learningpath in a E-Learning-System): 5 12 24 35 1 24 35 3 35 35 45 35 Now I need a comand, which compare the first line

[R] Square ended segments

2011-10-19 Thread Tyler Rinker
Good Afternoon R Community, I am working on plotting behavior codes over short durations of time (a few seconds at a time over 1-2 hrs). I am utilizing as.POSIXct to store the time. I wanted to make a quasi time line using these time. I utilized the segments function to represent these

Re: [R] Square ended segments

2011-10-19 Thread Sarah Goslee
Hi Tyler, Your code is unreadable, but take a look at ?par and search for lend. ?par is the first place to look for all base graphics settings. Sarah On Wed, Oct 19, 2011 at 5:26 PM, Tyler Rinker tyler_rin...@hotmail.com wrote: Good Afternoon R Community,  I am working on plotting behavior

[R] replacing values in one vector with corresponding index from another vector

2011-10-19 Thread David Epstein
A quick question for the gurus... Given: a=c(58,73,100,40,70) b=c(40,70,73,100,58,70,70,58) How can I replace the elements of b with the corresponding index numbers from a that start at 1? All values in a are unique. So, I end up with: b=c(4,5,2,3,1,5,5,1) I believe I need to use one of the

Re: [R] replacing values in one vector with corresponding index from another vector

2011-10-19 Thread Sarah Goslee
How about a trick? b - as.numeric(factor(b, levels=a)) b [1] 4 5 2 3 1 5 5 1 On Wed, Oct 19, 2011 at 5:38 PM, David Epstein david...@umich.edu wrote: A quick question for the gurus... Given: a=c(58,73,100,40,70) b=c(40,70,73,100,58,70,70,58) How can I replace the elements of b with

[R] new R debugging tool

2011-10-19 Thread Norm Matloff
I've developed a new R debugging tool, debugR, available at http://heather.cs.ucdavis.edu/debugR.html This basically replaces my edtdbg, which I will no longer be supporting. The new tool is now decoupled from one's text editor, and has a lot more features than edtdbg did. Try it! Feedback is

Re: [R] replacing values in one vector with corresponding index from another vector

2011-10-19 Thread William Dunlap
match(b, a) [1] 4 5 2 3 1 5 5 1 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Epstein Sent: Wednesday, October 19, 2011 2:39 PM To: r-help@r-project.org

Re: [R] Estimating bivariate normal density with constrains

2011-10-19 Thread Rolf Turner
On 20/10/11 02:31, Serguei Kaniovski wrote: Dear R-Users I would like to estimate a constrained bivariate normal density, the constraint being that the means are of equal magnitude but of opposite signs. So I need to estimate four parameters: mu(meanvector (mu,-mu)) sigma_1 and sigma_2

Re: [R] replacing values in one vector with corresponding index from another vector

2011-10-19 Thread David Epstein
thank you! that is straight forward. On Wed, 2011-10-19 at 22:37 +, William Dunlap wrote: match(b, a) [1] 4 5 2 3 1 5 5 1 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] ar() - AIC and BIC

2011-10-19 Thread J Toll
Hi, I'm slowly working through Tsay's Analysis of Financial Time Series 3rd ed.  I'm trying to replicate Table 2.1 on p.47, which gives PACF, AIC, and BIC for the monthly simple returns of the CRSP value-weighted index. The data:

[R] replacing percentage of values in data frame

2011-10-19 Thread a217
I've been looking for how to change a certain percentage of values in a data frame, but I've been struggling to find information in R. For example: #example data## data V1V2V3 V4 V5 V6 V7 1 chr1 500 500 CHH 0 0.5 + 2 chr1 550 550 CHH 0

Re: [R] replacing percentage of values in data frame

2011-10-19 Thread Henrique Dallazuanna
Try this: data$V6[sample(nrow(data), ceiling(length(data$V6) * 0.2))] - 1 On Wed, Oct 19, 2011 at 9:38 PM, a217 aj...@case.edu wrote: I've been looking for how to change a certain percentage of values in a data frame, but I've been struggling to find information in R. For example:

Re: [R] help with x axis on lattice barchart--R-Beginner

2011-10-19 Thread Dennis Murphy
Hi: Your example data don't exhibit the types of behavior that you're concerned about if you keep it simple. Here's how you can get the *example* data plotted in both lattice and ggplot2; if the example data are a subset of a much larger data set, then see below. This 'works' on the example data

Re: [R] ar() - AIC and BIC

2011-10-19 Thread Ken Hutchison
Hey, Try the AIC function for your model object. ?AIC Check package fitAR, there are criterion options for BIC. Why use BIC over AIC? I am not sure if it is clear that one is better. Also, if your model is small it shouldn't really make a difference. RegaRds,

[R] Problem installing tweetR on Ubuntu

2011-10-19 Thread Axel Urbiz
Dear List, When I try to install tweetR on Ubuntu, I get the error message below. It is a problem with the dependency RCurl. This package is not available for Windows on CRAN, but I would assume that I should have no problem with linux. Any help is much appreciated. R version: 2.12.1 Platform:

Re: [R] Problem installing tweetR on Ubuntu

2011-10-19 Thread G See
This will help you solve your problem http://www.omegahat.org/RCurl/FAQ.html -Garrett On Wed, Oct 19, 2011 at 8:16 PM, Axel Urbiz axel.ur...@gmail.com wrote: Dear List, When I try to install tweetR on Ubuntu, I get the error message below. It is a problem with the dependency RCurl. This

Re: [R] R2HTML giving NULL in output

2011-10-19 Thread Joshua Wiley
Hi, Can you please post (or send to me directly) a reproducible example? The summary() command is generic, so I am not sure what type of object you are dealing with. Thanks, Josh On Wed, Oct 19, 2011 at 1:18 PM, L.A. ro...@millect.com wrote:  Hey Guys,   I'm having this same problem! I have

Re: [R] help with glmmADMB ZI; function maximizer failed

2011-10-19 Thread Ben Bolker
emmarosenfeld emmarosenfeld at hotmail.co.uk writes: Dear all, I am having some problems trying to run a GLMM model with zero-inflation using the alpha version of glmmADMB (0.6.4) using R (2.13.1) in Windows and I would greatly appreciate some help. My count response variable (number of

[R] Applying function with separate dataframe (calibration file) supplying some inputs

2011-10-19 Thread Nathan Miller
Hello, I am not entirely sure the subject line captures what I am trying to do, but hopefully this description of the problem will help folks to see my challenge and hopefully offer constructive assistance. I have an experimental setup where I measure the decrease in oxygen in small vials as an

[R] Levenshtein-Distance

2011-10-19 Thread Jörg Reuter
I am very new to R, so sorry that I ask stupid things. I want compare a Matrix row by row and at the end I want to a Matrix with the Levenshtein-Distance. Example: The Data (Learningpath in a E-Learning-System): 5 12 24 35 1 24 35 3 35 35 45 35 Now I need a comand, which compare the first line

Re: [R] R-help Digest, Vol 104, Issue 19

2011-10-19 Thread Alex Ruiz Euler
Motion supported. Very. On Wed, 19 Oct 2011 15:40:14 +0200 peter dalgaard pda...@gmail.com wrote: Argh! Someone please unsubscribe this guy? He did this over Summer too and still hasn't learned that 1 recipients of R-help do not care whether he is out of office! -pd On Oct

Re: [R] Square ended segments

2011-10-19 Thread Tyler Rinker
Sarah, Thank you very much. I apoligize for the way the code came through. I'm not sure whay it was formatted that way. You were 100% correct about the lend=2. Thank you. I don't know why i didn't think to look at par. I was thinking the argument had to be from segments. It even

[R] AKIMA color contouring

2011-10-19 Thread James T Metz
R Users, I am using the AKIMA contrib package to generate a 2D colored contour plot. The code generates a contour value color legend adjacent the plot based on the range of Z values in the plot. Is there some way to make the association between Z values and color

Re: [R] AKIMA color contouring

2011-10-19 Thread Robert J Gregg
__ 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, reproducible code.

[R] Strange R behavior for product of two sum of integers

2011-10-19 Thread Lafaye de Micheaux Pierre
Dear gentlemen, Can you explain me why the following happens (any OS I think, and even on 64 bits)? sum(1000:1205)^2 [1] 51581223225 sum(1000:1205)*sum(1000:1205) [1] NA Warning message: In sum(1000:1205) * sum(1000:1205) : NAs produced by integer overflow Best, Pierre -- Pierre Lafaye

Re: [R] R2HTML giving NULL in output

2011-10-19 Thread L.A.
Thanks for the reply. Here is a sample. library(R2HTML) HTMLStart(outdir=Output, file=R2report, extension=html, echo=FALSE, HTMLframe=TRUE) HTML.title(Test Report 2011, HR=1) HTML.title(Test-Title:br Classification, HR=3) HTMLhr() HTMLStop() -- View this message in context:

[R] stop R from rounding

2011-10-19 Thread Alyse
Hello, I have a column in a data frame that need to be 10 digits long. As such: Decimal.Year 1 1994.25997 2 1994.26020 However, R keeps rounding the digits. As such: Decimal.Year 1 1994.260 2 1994.260 *Is there any way to stop this from happening?* Here is how

Re: [R] Applying function with separate dataframe (calibration file) supplying some inputs

2011-10-19 Thread Joshua Wiley
Hi Nathan, I honestly do not think that anything else will be much better than merging the two datasets. If the datasets are not merged, you essentially have to apply your optode function to each vial, store the results, then combine them all together. This is innefficient. Merging the datasets

Re: [R] Strange R behavior for product of two sum of integers

2011-10-19 Thread Lei Jiang
When using power operator ^, both the base and index are coerced to type real. The range of real is larger than integer. However, an ordinary multiplication operator * offers it to two integers (as always). So, to avoid the warning, just add as.real(...) to one or both multipliers (once one

Re: [R] stop R from rounding

2011-10-19 Thread David Winsemius
On Oct 19, 2011, at 11:29 PM, Alyse wrote: Hello, I have a column in a data frame that need to be 10 digits long. As such: Decimal.Year 1 1994.25997 2 1994.26020 However, R keeps rounding the digits. As such: Decimal.Year 1 1994.260 2 1994.260 *Is there any way to stop