Re: [R] call a function with explicitly not setting an argument

2011-07-23 Thread Joshua Wiley
On Sat, Jul 23, 2011 at 6:31 AM, jeroen00ms wrote: > Is there a way to call a function, and explicitly set an argument to 'not > specified'? My situation is the following. I have a function which passes on > most of its arguments to another function. The second function, myfun2, > serializes all a

Re: [R] An infinite recursion error please explain!

2011-07-23 Thread mousy0815
edit: I fixed it; apparently I needed to change the ceiling(w/q) to w%/%q, though I'm not really sure why that made such a difference. -- View this message in context: http://r.789695.n4.nabble.com/An-infinite-recursion-error-please-explain-tp3688260p3689621.html Sent from the R help mailing list

Re: [R] An infinite recursion error please explain!

2011-07-23 Thread mousy0815
In response to the second question about the placement of D<=t, there are two instances of it: once after the comment "starts inside node" (After the line with the comment "start & end in first node") and one after "starts outside node." Did that answer the question? I don't know if this helps, b

Re: [R] inside p value 'e'

2011-07-23 Thread xy
Thank you :) -- View this message in context: http://r.789695.n4.nabble.com/inside-p-value-e-tp3688961p3689418.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Fit elipse to xy scatter

2011-07-23 Thread Rolf Turner
(1) The ellipse package, according to its DESCRIPTION file, is a package of ``Functions for drawing ellipses and ellipse-like confidence regions''. It has nothing to do with *fitting* ellipses. (2) What on earth do you mean by ``fit an elipse (sic) to two lines of identity''? (3) There are

Re: [R] Trouble getting plot to appear

2011-07-23 Thread cherron
I thought that might have been the case also, but after opening the pdf it's not there either. When I restart R it works again. On Fri, Jul 22, 2011 at 6:32 PM, Daniel Malter [via R] < ml-node+3688227-1927904147-254...@n4.nabble.com> wrote: > Typically not, unless the device has not closed prope

[R] Create a map

2011-07-23 Thread Amy Ruiz
Hello: I'm using the library of maps, however, I need to use a map of Puerto Rico, but apparently does not exist. I wanted to know if there is any way that I can create that map? Thanks, Amy -- *Amy A. Ruiz Goyco* *Universidad de Puerto Rico* *Recinto de Río Piedras* [[alternative HTM

[R] analizing .txt file with R or an other program

2011-07-23 Thread aRe
Hello together I have a .txt file with about 1Mio! rows. Sometimes the rows are in the following order (whereas the number of rows between the rows marked with an x differ): ... *SBLINK R 5261507*x 5261439 516.4 364.3 9148.0 ... 816.0 -1133.048.4 MA.C.TB...BL. 5261441 516.4 36

Re: [R] glmnet with binary logistic regression

2011-07-23 Thread fongchun
Hi Patrick, Thanks for the reply. I am referring to using the cv.glmnet() function with 10-fold cross validation and letting glmnet determine the lambda sequence. The optimal lambda that it is returning fluctuates between different runs of cv.glmnet. Sometimes the model that is return deviates

[R] inside p value 'e'

2011-07-23 Thread xy
Hi could some one please tell me what can identfy my numbers ? I have like 5.075e-12 , 3.207e-05, 7.438e-07 and 9.393e-08 *** , i dont know what number they are correspond to? help pls!! thanks -- View this message in context: http://r.789695.n4.nabble.com/inside-p-value-e-tp3688961p3688961.html

[R] call a function with explicitly not setting an argument

2011-07-23 Thread jeroen00ms
Is there a way to call a function, and explicitly set an argument to 'not specified'? My situation is the following. I have a function which passes on most of its arguments to another function. The second function, myfun2, serializes all arguments and is out of my control. myfun <- function(...){

[R] FIGARCH

2011-07-23 Thread prashant joshi
I am working on stock market volatility. I now need to apply "FIGARCH" model using R. I need garchOxFit package to support R in applying FIGARCH to my data set. Please help. Looking forward for your reply, With regards, Prashant [[alternative HTML version deleted]] __

[R] Create a map

2011-07-23 Thread Amy Ruiz Goyco
Hello: I'm using the library of maps, however, I need to use a map of Puerto Rico, but apparently does not exist. I wanted to know if there is any way that I can create that map? Thanks, Amy [[alternative HTML version deleted]] __ R-help@r-p

[R] R on Android, at least on DOS

2011-07-23 Thread zcatav
Hello, Is there a version of R running on Android? I wonder R Project ported to Android. If this isn't, a DOS version may be helpfull to run on Android under dosbox. After a little googling i can't find a soluiton. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/R-on-Andro

[R] Extend my code to run several data at once.

2011-07-23 Thread EdBo
Hi I have a code that calculate maximisation using optimx and it is working just fine. I want to extend the code to run several colomns of R_j where j runs from 1 to 200. If I am to run the code in its current state, it means I will have to run it 200 times manually. May you help me adjust it to a

[R] Create a map

2011-07-23 Thread Amy Ruiz
Hello: I'm using the library of maps, however, I need to use a map of Puerto Rico, but apparently does not exist. I wanted to know if there is any way that I can create that map? Thanks, Amy -- *Amy A. Ruiz Goyco* *Universidad de Puerto Rico* *Recinto de Río Piedras* [[alternative HTM

Re: [R] Extracting components from a 'boot' class output in R

2011-07-23 Thread Tim Hesterberg
Do names(bootObj) to find out what the components are, and use $ or [[ to extract components. Do help(boot) for a description of components of the object (look in the Value section). That is general advice in R, applying to all kinds of objects - boot, and many other functions such as lm(), re

Re: [R] squared "pie chart" - is there such a thing?

2011-07-23 Thread Thomas Levine
How about just a stacked bar plot? barplot(matrix(c(3,5,3),3,1),horiz=T,beside=F) Tom On Fri, Jul 22, 2011 at 7:14 AM, Naomi Robbins wrote: > > Hello! > It's a shoot in the dark, but I'll try. If one has a total of 100 > (e.g., %), and three components of the total, e.g., > mytotal=data.frame(x

Re: [R] score test for logistic regression

2011-07-23 Thread peter dalgaard
On Jul 24, 2011, at 00:20 , Thomas Lumley wrote: > On Fri, Jul 22, 2011 at 8:00 PM, peter dalgaard wrote: >> >> On Jul 21, 2011, at 23:11 , David Winsemius wrote: >> >>> >>> On Jul 21, 2011, at 3:38 PM, zlu wrote: >>> Hi Peter, >>> >>> I'm not sure how many people still have 9 month ol

Re: [R] score test for logistic regression

2011-07-23 Thread Thomas Lumley
On Fri, Jul 22, 2011 at 8:00 PM, peter dalgaard wrote: > > On Jul 21, 2011, at 23:11 , David Winsemius wrote: > >> >> On Jul 21, 2011, at 3:38 PM, zlu wrote: >> >>> Hi Peter, >> >> I'm not sure how many people still have 9 month old postings on their mail >> client and will know that Peter Dalgaa

Re: [R] Extend my code to run several data at once.

2011-07-23 Thread Daniel Malter
If you just want to apply the function over successive columns of a data frame use apply(name.of.data.frame, 2 , llik) Daniel EdBo wrote: > > Hi > > I have a code that calculate maximisation using optimx and it is working > just fine. I want to extend the code to run several colomns of R_j wh

Re: [R] An infinite recursion error please explain!

2011-07-23 Thread Carl Witthoft
Not sure, but I played a little with the progression of w and m, and it appears that it doesn't take long for their values to converge (i.e. they don't change any more). Once that happens, D is not going to change. Further, unless I'm misreading the if {...} indents, you appear to be check

Re: [R] analizing .txt file with R or an other program

2011-07-23 Thread Daniel Malter
Hi, The blunt answer is: by learning R. In particular, you will need pattern matching techniques as in ?grep and (somewhat advanced, some would call it basic) knowledge of R. So if you aren't familiar with either, I would suggest an introductory manual or one of the many websites you find online a

[R] Testing two independent samples for null of same skewness and kurtosis?

2011-07-23 Thread Eduardo M. A. M.Mendes
Hello I wonder whether there is an r tool or package available for testing for the null of same skewness or kurtosis of two independent samples. It semes that nsRFA package uses L-moments for soothing similar but I could not get how to use the package for the above test. Any pointers, h

Re: [R] Achieving 'reverse-Vech' of a matrix

2011-07-23 Thread Ted Harding
On 23-Jul-11 17:12:09, Megh Dal wrote: > Let say i have a square matrix and applied the 'vech' operator to stack > the lower triangular elements into a vector: > >> Mat <- matrix(1:25, 5) >> Mat > _ _ _[,1] [,2] [,3] [,4] [,5] > [1,] _ _1 _ _6 _ 11 _ 16 _ 21 > [2,] _ _2 _ _7 _ 12 _ 17 _ 22 > [3,]

Re: [R] Use ks.test() or an alternative in C/C++ application

2011-07-23 Thread Dieter Menne
Jochen1980 wrote: > > > I am looking for an opportunity to make a KS-Test in my C/C++-app. > Unfortunately I am not able to find a lib or function in C or C++ which > does the job. For my other numerical stuff Gnu Scientific Library was > recommended to me. What to do now? > > I read that there

Re: [R] R on Android, at least on DOS

2011-07-23 Thread Dieter Menne
zcatav wrote: > > If this isn't, a DOS version may be helpfull to run on Android under > dosbox. > Wow, a mind boggling bummer! Dieter -- View this message in context: http://r.789695.n4.nabble.com/R-on-Android-at-least-on-DOS-tp3688847p3689176.html Sent from the R help mailing list archiv

Re: [R] determining system time for sequence of commands

2011-07-23 Thread Dieter Menne
jannis-2 wrote: > > I am trying to figure out how much CPU time individual commands inside > one of my functions consume. Is it possible to obtain the CPU times of a > whole sequence of commands inside a function? > See the example under proc.time() Dieter -- View this message in context:

Re: [R] inside p value 'e'

2011-07-23 Thread Dieter Menne
xy wrote: > > I have like 5.075e-12 , 3.207e-05, 7.438e-07 and 9.393e-08 *** , i dont > know what number they are http://en.wikipedia.org/wiki/Floating_point -- View this message in context: http://r.789695.n4.nabble.com/inside-p-value-e-tp3688961p3689167.html Sent from the R help mailing l

[R] Achieving 'reverse-Vech' of a matrix

2011-07-23 Thread Megh Dal
Let say i have a square matrix and applied the 'vech' operator to stack the lower triangular elements into a vector: > Mat <- matrix(1:25, 5) > Mat      [,1] [,2] [,3] [,4] [,5] [1,]    1    6   11   16   21 [2,]    2    7   12   17   22 [3,]    3    8   13   18   23 [4,]    4    9   14   19   24

Re: [R] averaging rows based on string¿?

2011-07-23 Thread Dennis Murphy
Hi: Try this: labs <- c("abcdef","abcgg","tgthefdk","tgtijuel","tgtnjmoi","gbnt","dlift") dat <- c(0.5,0.25,1,2,16,0.250,4) dframe <- data.frame(labs, dat, stringsAsFactors = FALSE) dframe$lab2 <- factor(substr(dframe$lab, 1, 3)) aggregate(dat ~ lab2, data = dframe, FUN = mean) lab2 dat 1

[R] determining system time for sequence of commands

2011-07-23 Thread Jannis
Dear list members, I am trying to figure out how much CPU time individual commands inside one of my functions consume. Is it possible to obtain the CPU times of a whole sequence of commands inside a function? I know how to use system.time() but this would only give me the time consumed by the

[R] graphic problem: transparent window when starting mtrace() from package debug

2011-07-23 Thread Jannis
Deal R , when I use the package debug, mark a function with mtrace() and enter into the browser like mechanism of debug a window displaying the code of the marked function with the current line highlighted usually appears. When I use GUIs other than ess or the standard R console sometimes thi

Re: [R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread Gabor Grothendieck
On Fri, Jul 22, 2011 at 3:37 PM, john nicholas wrote: > >  Hello, > > I would like to implement a "turn-of-the-month' trading strategy in R. > > Given a daily series of stock market return data as a zoo object, the strategy > would go long (buy) four trading days before the end of the month, and s

Re: [R] sum part of a vector

2011-07-23 Thread peter dalgaard
On Jul 23, 2011, at 13:11 , Simon Kiss wrote: > Dear colleagues, I have a data set that looks roughly like this; > mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), > rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15)) > > For each state, I'd like to cumulat

Re: [R] xml2-config issues

2011-07-23 Thread Prof Brian Ripley
On Fri, 22 Jul 2011, Abraham Mathew wrote: I'm trying to install the XML package on Ubuntu 10.10, and I keep getting a warning message the XML could not be found No, that is not the *error* message you quote below. and had non-zero exit status. How can I fix this problem? Install libxml2 .

Re: [R] sum part of a vector

2011-07-23 Thread Weidong Gu
Hi Simon, Is this what you want? mydat$cum.news<-unlist(tapply(mydat$news,mydat$state,FUN=cumsum)) Weidong Gu On Sat, Jul 23, 2011 at 7:11 AM, Simon Kiss wrote: > Dear colleagues, I have a data set that looks roughly like this; > mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5),

Re: [R] xml2-config issues

2011-07-23 Thread Mike Marchywka
Date: Fri, 22 Jul 2011 20:06:34 -0600 From: abmathe...@gmail.com To: r-help@r-project.org Subject: [R] xml2-config issues I'm trying to install the XML package on Ubuntu 10.10, and I keep getting a warning message the XML could not be found an

Re: [R] [R-sig-Geo] Problem with read.shape in maptools

2011-07-23 Thread Roger Bivand
On Sat, 23 Jul 2011, Axel Urbiz wrote: Hi, I'd like to read a shapefile into a Map object. This is exactly what read.shape{maptools} is suppoed to do, according to the documentation I found in the link below. Do search the archives properly; the second hit on googling "list:R-sig-geo read.sh

[R] sum part of a vector

2011-07-23 Thread Simon Kiss
Dear colleagues, I have a data set that looks roughly like this; mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15)) For each state, I'd like to cumulatively sum the value of "news" and make that put that valu

[R] Problem with read.shape in maptools

2011-07-23 Thread Axel Urbiz
Hi, I'd like to read a shapefile into a Map object. This is exactly what read.shape{maptools} is suppoed to do, according to the documentation I found in the link below. However, this doesn't seem to work library(maptools)x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1])Err

Re: [R] glmnet with binary logistic regression

2011-07-23 Thread Patrick Breheny
On 07/22/2011 07:51 PM, fongchun wrote: I am using the glmnet R package to run LASSO with binary logistic regression. ... What I am finding is that this optimal lambda value fluctuates everytime I run glmnet with LASSO. > ... Does anyone know why there is such a fluctuation in the generation o

Re: [R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread Joshua Ulrich
On Fri, Jul 22, 2011 at 2:37 PM, john nicholas wrote: >  Hello, > > I would like to implement a "turn-of-the-month' trading strategy in R. > > Given a daily series of stock market return data as a zoo object, the strategy > would go long (buy) four trading days before the end of the month, and sel

[R] Use ks.test() or an alternative in C/C++ application

2011-07-23 Thread Jochen1980
Hi, I am looking for an opportunity to make a KS-Test in my C/C++-app. Unfortunately I am not able to find a lib or function in C or C++ which does the job. For my other numerical stuff Gnu Scientific Library was recommended to me. What to do now? I read that there are options to call R in C++-C

Re: [R] help on panel.superpose

2011-07-23 Thread Duncan Mackay
I too am unsure what is required, perhaps xyplot(y~x,data,col=c(3,4),groups=id,pch=c(12,13), type= c("p","r")) a toy dataset would have helped Perhaps a perusal of http://lmdvr.r-forge.r-project.org/figures/figures.html is required Regards Duncan Mackay Department of Agronomy and Soil Scienc

[R] How to solve ergodic density/distribution using R

2011-07-23 Thread Hong Yu
May I have a question on how to solve the following problem by R code? Mainly we want to solve the equation show in the attached image. The equation is a continuous version of Markov process. In the equation, we have been able to achieve two things using R code: [1] From year-2009 sample da

[R] Question about output from twitteR package

2011-07-23 Thread Doug Luke
Dear R-List, I am trying to develop a tutorial on how to analyze network data from Twitter conversations for a network analysis class that I teach. I came across the twitteR package, and saw some examples of it in action on various websites. It is easy to use, and almost as easy to understand.

[R] An infinite recursion error please explain!

2011-07-23 Thread mousy0815
Probability <- function(N, f, w, b, y, t, q) { #N is the number of lymph nodes #f is the fraction of Dendritic cells (in the correct node) that have the antigen #w is time in terms of hours #b is the starting position (somewhere in the node or somewhere in the gap

[R] glmnet with binary logistic regression

2011-07-23 Thread fongchun
Hi all, I am using the glmnet R package to run LASSO with binary logistic regression. I have over 290 samples with outcome data (0 for alive, 1 for dead) and over 230 predictor variables. I currently using LASSO to reduce the number of predictor variables. I am using the cv.glmnet function to d

[R] Fit elipse to xy scatter

2011-07-23 Thread DrCJones
Hi, I know there is a package 'elipse' available but I'm not sure how to use it for my specific implementation. What I would like to do is fit an elipse to two lines of identity (at right angles to each other), as indicated in the following figure: http://imageshack.us/photo/my-images/30/poinca

[R] xml2-config issues

2011-07-23 Thread Abraham Mathew
I'm trying to install the XML package on Ubuntu 10.10, and I keep getting a warning message the XML could not be found and had non-zero exit status. How can I fix this problem? > install.packages() Loading Tcl/Tk interface ... done --- Please select a CRAN mirror for use in this session --- Instal

[R] Trouble getting plot to appear

2011-07-23 Thread cherron
Hello, >I am currently working on a script and I output plots to pdf using pdf(...) plot(...) dev.off() >then later I was trying to plot something and when I run just plot(...) >nothing appears. Is there something about using plot(..) after dev.off() that does not allow the window to pop up?

[R] Store elements in a list in a triple for loop

2011-07-23 Thread katarv
Hi, I have a triple loop that goes through all elements of a list Lst[[k]][[i,j]] and I want to pick only elements of Lst[[k]][[i,j]] > 0.4 or any value. Then I want to store the values of Lst[[k]][[i,j]] together with their i,j,k values in another list. Say I have Lst[[2]][[4,7]] = 0.6, I wan

Re: [R] Lattice: distance of Y-axis label from plot

2011-07-23 Thread marcel
Got it working using "layout.widths = list(ylab.axis.padding = 0.5)))" and adjusting the print position in "print(plot1, position=c(-0.018,0.221,0.741,0.466))". Thx -- View this message in context: http://r.789695.n4.nabble.com/Lattice-distance-of-Y-axis-label-from-plot-tp3686855p3688172.html

[R] help on panel.superpose

2011-07-23 Thread Bharath Kumar
Dear users, I am new to R and have couple of problems with xyplot. A) I am trying to use the xyplot to plot mean concentration vs time across 5 dose groups. When i use the following script xyplot(mean~time,groups=dose,type="b",panel=panel.superpose). R generates the plot, but i have no control o

Re: [R] Lattice: place ticks only on y-axis

2011-07-23 Thread marcel
Working! Many thanks, good solutions -- View this message in context: http://r.789695.n4.nabble.com/Lattice-place-ticks-only-on-y-axis-tp3684094p3688167.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] library 'ts' not available?

2011-07-23 Thread cplusplus programmer
hi, When I type library(ts) (I am working on an ubuntu machine), I get the following error: > library(ts) Error in library(ts) : there is no package called 'ts' I did a few google searches and it seems like ts is no longer availableis that correct? It seemed to me that I would need to downloa

[R] Plotting compound functions--help with defining x-axis as f(x)

2011-07-23 Thread Aimee Jones
Hi all, I'm having trouble locating a script that will allow to me to create graphs that show compound functions as a function of the simple function, rather than just x (or time as it is in my case). Currently I have the following functions defined in my script: > > > T1<-function(t) {27.5-12.5*

Re: [R] matched pairs

2011-07-23 Thread Ellen S.
Thanks everyone! I finally got some code to work (thanks to William Dunlap). -- View this message in context: http://r.789695.n4.nabble.com/matched-pairs-tp3687506p3687864.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

[R] averaging rows based on string¿?

2011-07-23 Thread alfredo
Hi Folks, Ran into something I'd really like to do in R simply/elegantly, but my R - coding skills seem surpassed. This is the thing. Imagine the following data: labs<-c("abcdef","abcgg","tgthefdk","tgtijuel","tgtnjmoi","gbnt","dlift") dat<-c(0.5,0.25,1,2,16,0.250,4) dframe<-data.frame(labs,dat)

Re: [R] summarized data set - how to use an "occurs" field

2011-07-23 Thread mloxton
David, thanks, I think that should work perfectly Much obliged > >  > dfrm <- expand.grid(A=1:3, B=1:3) >  > dfrm$counts <- 1:9 >  > xtabs(counts~A, data=dfrm) > A >   1  2  3 > 12 15 18 > >  >barplot(xtabs(counts~A, data=dfrm), xlab="Counts by A level") > > -- > > David Winsemius, MD > West Har

[R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread john nicholas
Hello, I would like to implement a "turn-of-the-month' trading strategy in R. Given a daily series of stock market return data as a zoo object, the strategy would go long (buy) four trading days before the end of the month, and sell the third trading day of the following month. How can I sel

Re: [R] elimination duplicate elements sampling!

2011-07-23 Thread elephann
Great! The second way really helped me! Thank you so much! -- View this message in context: http://r.789695.n4.nabble.com/elimination-duplicate-elements-sampling-tp3652791p3687613.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

Re: [R] R on Multicore for Linux

2011-07-23 Thread Lei Jiang
Madana, The code below may work (untested though): #above is the same as you wrote require(multicore) read.data.exmple <- function(f) { dat <- read.csv(f, header=FALSE, sep="\t", na.strings="",dec=".", strip.white=TRUE, fill=TRUE) data_1 <- sqldf("SELECT V2, V14, MIN(V16) FROM dat

[R] convert TS dataframe to evenly spaced intervals?

2011-07-23 Thread Derrick Lin
Hi R-help, I have a dataframe consisting of a time-series [t, v]. The timestamps aren't at all evenly spaced. The values are continuous. I've been able to graph this as a step function (which is what it should be) in ggplot2, using the 'step' geom. Now I would like to take the integral of the step

Re: [R] User input(unknown name and number of files)

2011-07-23 Thread Bansal, Vikas
can you please suggest me any book or paper or website which explains this problem because I have started using R before 3 weeks only and i will not be able to understand your whole code.so if i will study about this problem it will be very good for me.I have tried in some books and also on inte