Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-06 Thread Simon Blomberg
On Mon, 2008-04-07 at 15:13 +0900, Tribo Laboy wrote: > Hello, > > I am new useR, I have written some functions, which I currently use by > "source"-ing them from the files. > That's OK, but when I my functions start counting in the tens and > hundreds I'd be glad to be able to type > "help.search

[R] tweedie model

2008-04-06 Thread Roslina Zakaria
Hi R-users, I have this code below for tweedie inverse, but I don’t understand why it doesn’t give zero for some of r1 values?   r1 <- runif(31,0,1) p0 <- 0.72 ; p <- 1.63; mu <- 1.48; phi <- 9.61   tweedie.inv <- function(rand,p0,p,mu,phi) {  y <- rand    ind <- rand < p0    y[ind] <- 0    y[!ind

Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-06 Thread talepanda
Though R is indeed cross-platform language, how to build depends on the environment. This is case for most cross-platform software, library, etc. Basically cross-platform means cross-platform for users. When you build packages, you are not user but developer. Rtools will help you. http://www.mur

Re: [R] function for between-groups covariance matrix?

2008-04-06 Thread Prof Brian Ripley
If this is a large dataset, you probably do not want the covariance matrix but some decomposition of it. What are you intending to do with it? If you look at the code for MASS:::lda.default you will see how discriminant analysis can be done more stably without ever computing the covarinace mat

[R] How to pack my stuff into a package (library, collection)?

2008-04-06 Thread Tribo Laboy
Hello, I am new useR, I have written some functions, which I currently use by "source"-ing them from the files. That's OK, but when I my functions start counting in the tens and hundreds I'd be glad to be able to type "help.search("my_obscure_fun")" and get a sensible reply. I also want to be able

[R] function for between-groups covariance matrix?

2008-04-06 Thread toby
Hi Is anyone aware if there is a function already available that calculates the between-groups COvariance matrix, say in a discriminant analysis setting, or in a manova setting. Maybe as a helper function to some other major function. Otherwise I would have to program it myself (probably resulti

Re: [R] getting numeric arrays from data frame

2008-04-06 Thread talepanda
try hist(foo[,5]) plot(foo[,c(1,5)]) HTH > Currently I invoke: > > foo <- read.table("foo.data", header=TRUE) > > to read a table into foo > > Then when I try to plot a histogram out of the 5th column of foo: > > hist(foo[5]) > > It fails and it says: > > Error in hist.default(foo[5]) : '

[R] getting numeric arrays from data frame

2008-04-06 Thread Mark Farnell
Currently I invoke: foo <- read.table("foo.data", header=TRUE) to read a table into foo Then when I try to plot a histogram out of the 5th column of foo: hist(foo[5]) It fails and it says: Error in hist.default(foo[5]) : 'x' must be numeric Then I tried: >typeof(foo[5]) [1] "List" So how c

Re: [R] How to include a vignette with my package?

2008-04-06 Thread Duncan Murdoch
François Aucoin wrote: > I want to include a vignette with a package I wrote. I did follow the > "Writting R extentions" document step by step, but went I run "Rcmd build", > an error occurs. It goes like this: > > " > * creating vignettes ... ERROR > . > . > . > . > :7: Emergency stop > L7L ==>

Re: [R] 'URCA' is not a valid package Error

2008-04-06 Thread Peter Dalgaard
Leyla Biondini wrote: > I have installed "Package: r-cran-urca (1.1-6-1) [universe]" from the ubuntu > website for use in Windows. > Whatever made you believe that that would work? If you are using Windows, just install urca via the Packages menu in the Rgui. -- O__ Peter Dalgaard

[R] How to include a vignette with my package?

2008-04-06 Thread François Aucoin
I want to include a vignette with a package I wrote. I did follow the "Writting R extentions" document step by step, but went I run "Rcmd build", an error occurs. It goes like this: " * creating vignettes ... ERROR . . . . :7: Emergency stop L7L ==> Fatal error occurred, no output PDF file prod

Re: [R] Error message "got a real'

2008-04-06 Thread David Kaplan
Thanks, I'm not sure why it wasn't saved as a .csv. I posted it to the R Mac list and the general R list because in the past when I've posted to the R Mac list I was told it wasn't a R question. Because this problem didn't appear with the windows verson of R, I wasn't sure which

Re: [R] Error message "got a real'

2008-04-06 Thread Duncan Murdoch
David Kaplan wrote: >Yea, I checked that, but that wasn't the problem. I'm sending the input > and >a much smaller file. It's in .csv format. The input is for the Mac, and >I'm beginning to think it might be a Mac issue. The program input lines >come from John Fox's program sem

Re: [R] Executing a telnet session from R

2008-04-06 Thread Claus Wilke
Don't use telnet, use rsh or (better) ssh. You can set up your identity on the remote host so that ssh doesn't ask for your password (see ssh documentation), and you can give ssh the command(s) that should be executed on the remote host (again see ssh documentation). Claus On Sunday 06 April

Re: [R] Hex Decimal Convert

2008-04-06 Thread John Fox
Dear Edwin, On Mon, 7 Apr 2008 01:14:35 +0100 Edwin Sendjaja <[EMAIL PROTECTED]> wrote: > > Dear John, > > Thank you. > > Is there any possibility to get original stored number printed. R is a programming language, so you could in principle read an input line as character data, break it into

Re: [R] R, VR, and Debian

2008-04-06 Thread Dirk Eddelbuettel
On 6 April 2008 at 23:58, (Ted Harding) wrote: | Hi Folks, | A while ago (September 2007) I set up an experimental | Debian 4.0 Etch installation, and installed R on it, | along with several packages -- including e1071 and | the "Bundle" VR -- by means of the Debian package | manager. Most of the

[R] mgcv::gam prediction using lpmatrix

2008-04-06 Thread David Katz
The documentation for predict.gam in library mgcv gives an example of using an "lpmatrix" to do approximate prediction via interpolation. However, the code is specific to the example wrt the number of smooth terms, df's for each,etc. (which is entirely appropriate for an example) Has anyone gene

Re: [R] Hex Decimal Convert

2008-04-06 Thread Edwin Sendjaja
Dear John, Thank you. Is there any possibility to get original stored number printed. Because i have another coloum like: Protocol "TCP" This is gonna cause probleme (as you notice before). I dont really understand what you mean with a list. i am new with R. Thanks, Edwin Am Sonntag,

[R] 'URCA' is not a valid package Error

2008-04-06 Thread Leyla Biondini
Thank you Matthieu for your helpful suggestions. Unfortunately I still have problems. I have tried to compile it via your suggestion. " this is strange... you should have the usual summary... I have on my machine library(urca) test2<-ur.df(nottem, type="none", lags=1) summary(test2) " When I type

Re: [R] Error message "got a real'

2008-04-06 Thread Duncan Murdoch
David Kaplan wrote: >Hi all, >I'm running the program sem on a Mac, but I'm getting a message that I > think >is quite general. The error reads >Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, >: > scan() expected 'a real', got '10652)' >The

Re: [R] how to manupute data frame with conditions fill cell with previous value if next cell is zero

2008-04-06 Thread Bill.Venables
There may well be neater ways to do this, but if you have only a limited number of zeros in any run, this is probably as quick as any. Suppose your data frame is 'dat': > fixCol <- function(x) { y <- x n <- length(x) while(any(zx <- x == 0)) { y <- c(NA, y[-n])

Re: [R] Multiset Permutations

2008-04-06 Thread G. Jay Kerns
Dear Steven, The prob package does this, too. (Please see the * fix below). x <- c(0, 0, 1, 2, 2) library(prob) A <- permsn(x, 5) # with repeated columns B <- unique( data.frame( t(A) )) # no repeated rows The data frame B will have 56 rows and 5 columns. If you need the

[R] Executing a telnet session from R

2008-04-06 Thread Dennis Fisher
Colleagues I am working in a Linux OS with R 2.6.2. I need to execute a telnet session to another Linux machine from R, perform some operations, then return to the original computer. When I am in an R session, this is easy to accomplish by typing: system("telnet -l username machinena

[R] R, VR, and Debian

2008-04-06 Thread Ted Harding
Hi Folks, A while ago (September 2007) I set up an experimental Debian 4.0 Etch installation, and installed R on it, along with several packages -- including e1071 and the "Bundle" VR -- by means of the Debian package manager. Most of the time, R works fine. But not always. Just now, I wanted to t

[R] Error message "got a real'

2008-04-06 Thread David Kaplan
Hi all, I'm running the program sem on a Mac, but I'm getting a message that I think is quite general. The error reads Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : scan() expected 'a real', got '10652)' The 10652 is the sample size coming fro

Re: [R] Multiset Permutations

2008-04-06 Thread Gavin Simpson
Hi, If I understand you correctly, there is beta code within the development version of package 'vegan' on R forge to do this. install.packages("vegan", repos="http://R-Forge.R-project.org";) Then: > numPerms(5) [1] 120 > perms <- allPerms(5, observed = TRUE) > perms[1:10,] [,1] [,2] [,3]

Re: [R] [OT] Typesetting / highlighting R code in Latex

2008-04-06 Thread Vincent Goulet
Le dim. 6 avr. à 14:44, Dirk Eddelbuettel a écrit : > > On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote: > | Using Latex and the beamer class, I would like to highlight code > snippets. > | Does anybody know a suitable 'preprocessor' or 'filter' for R (and/ > or C/C++) > | code ? > | > | I hav

Re: [R] summary(object, test=c("Roy", "Wilks", "Pillai", ....) AND ellipse(object, center=....)

2008-04-06 Thread Michael Friendly
You may be interested in the heplots package for multivariate linear models. For a multivariate regression, it plots a data ellipse of the predicted values (H matrix) together with a data ellipse of the residuals (E ellipse). H is scaled so that it protrudes outside the E ellipse iff the hypothe

Re: [R] dots and substitute

2008-04-06 Thread Simon Anders
Hi Charles, Charles C. Berry wrote: > Try this: > > f2 <- function(...) sapply( substitute(list(...)), deparse )[-1] Wow, this works. Thanks a lot! > p.s. Why do you want this as mode "character"? For the usual purpose of 'substitute': to label something. The use case is that I have a

Re: [R] Multiset Permutations

2008-04-06 Thread Johannes Hüsing
You can use the function permutation from the e1071 package, then library(e1071) multisetperm <- function(multiset) { unique(apply(matrix(multiset[permutations(length(multiset))], ncol=length(multiset)), 1, paste, sep="", collapse="")) } multisetperm(c("0", "0", "1", "2", "2")) > The output wo

[R] Multiset Permutations

2008-04-06 Thread Stropharia
Dear R users, I want to perform an exact permutation of multisets. I have looked at the coin package, but it doesn't seem to offer what I am looking for. I want to perform permutations (exact - without duplications) on multisets of scalars (e.g., the multiset 0,0,1,2,2). I want to output all the

Re: [R] Hex Decimal Convert

2008-04-06 Thread John Fox
Dear Edwin, There's a distinction between the way in which a number is stored internally and the way in which it's printed. R is reading the hex numbers correctly but is printing them in decimal. You can assign the class "hexmode" to the vector containing the data and then it will print in hex: >

[R] Hex Decimal Convert

2008-04-06 Thread Edwin Sendjaja
Hello, I have a data with hexdecimal. But GNU R convert it to strange number. How can I get that hexdecimal showing in the R-table? - My Data-Table: Sender_ID Receiver_ID Other_ID 6565 0x477

Re: [R] dots and substitute

2008-04-06 Thread Charles C. Berry
On Sun, 6 Apr 2008, Simon Anders wrote: > Hi, > > is there an elegant way to use 'substitute' with '...' arguments? > > My first try was this: > > > f1 <- function(...) substitute(...) > > f1( 2+7, "foo", 3+5 ) > 2 + 7 > > As you can see, substitute acts only on the first argument. So I tried > >

Re: [R] What to use for assignment, " = " or " <- "?

2008-04-06 Thread Charilaos Skiadas
On Apr 6, 2008, at 10:35 AM, Ben Bolker wrote: > csiro.au> writes: > >> >> I've noticed an increasing tendency for people to use '=' rather than >> the older '<-' symbol. When '=' became available as an assignment >> operator in S-PLUS in the late '90s my first reaction was to >> switch to >>

Re: [R] row by row similarity

2008-04-06 Thread Simon Anders
Hi Grant, Grant Gillis wrote: > My problem is: > > I have a data set for individuals (rows) and values for behaviours > (columns). I would like to know the proportion of shared behaviours for all > possible pairs of individuals. The sum of shared behaviours divided by the > total. There are ze

[R] Hex Decimal Convert

2008-04-06 Thread Edwin Sendjaja
Hello, I have a data with hexdecimal. But GNU R convert it to strange number. How can I get that hexdecimal showing in the R-table? --- -- My Data-Table: Sender_ID Receiver_ID Other_ID 6565 0x47

[R] R code for eta

2008-04-06 Thread dt Excellent
I would greatly appreciate if anybody can tell me if an R code is available for computing the eta measure of association in contingency tables. With regards - [[alternative HTML version deleted]] __ R

Re: [R] [OT] Typesetting / highlighting R code in Latex

2008-04-06 Thread Dirk Eddelbuettel
On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote: | Using Latex and the beamer class, I would like to highlight code snippets. | Does anybody know a suitable 'preprocessor' or 'filter' for R (and/or C/C++) | code ? | | I have been including it in simple \begin{verbatim} ... \end{verbatim} and I

Re: [R] lme cant get parameter estimated correctly

2008-04-06 Thread toby909
csiro.au> writes: > > Here is a demo you may like to consider. (I can see what you are trying > to do with your loops, but I prefer to do it this way.) This is just for pedagogical purpose, so I like to keep the simple-minded 'for' loop. But what I really wonder is why do I not get the right

[R] dots and substitute

2008-04-06 Thread Simon Anders
Hi, is there an elegant way to use 'substitute' with '...' arguments? My first try was this: > f1 <- function(...) substitute(...) > f1( 2+7, "foo", 3+5 ) 2 + 7 As you can see, substitute acts only on the first argument. So I tried > f2 <- function(...) substitute(list(...)) > f2( 2+7, "f

[R] row by row similarity

2008-04-06 Thread Grant Gillis
Hello all and thanks in advance for any advice. I am very new to R and have searched my question but have not come up with anything quite like what I would like to do. My problem is: I have a data set for individuals (rows) and values for behaviours (columns). I would like to know the proportion

Re: [R] [OT] Typesetting / highlighting R code in Latex

2008-04-06 Thread Duncan Murdoch
On 06/04/2008 11:40 AM, Dirk Eddelbuettel wrote: > Using Latex and the beamer class, I would like to highlight code snippets. > Does anybody know a suitable 'preprocessor' or 'filter' for R (and/or C/C++) > code ? > > I have been including it in simple \begin{verbatim} ... \end{verbatim} and I > k

Re: [R] Strange message when plot function used..

2008-04-06 Thread Uwe Ligges
Cristian Carranza wrote: > Hi! > > I am an R beginer, so perhaps this is a quite simple question... > After using the lmer command (under the lme4 package) for fitting a mixed > model, it was impossible to use de command plot(model) for checking model > adequacy. R returns this message: "Erro

Re: [R] how to manupute data frame with conditions fill cell with previous value if next cell is zero

2008-04-06 Thread Gabor Grothendieck
On Sun, Apr 6, 2008 at 9:04 AM, saikat sarkar <[EMAIL PROTECTED]> wrote: > This is the 2nd time in the chat room. Its a great place to get help from R > experts. I assume you are referring to this email list. I am not aware of a chat room but if it exists that is something different from this li

[R] Strange message when plot function used..

2008-04-06 Thread Cristian Carranza
Hi! I am an R beginer, so perhaps this is a quite simple question... After using the lmer command (under the lme4 package) for fitting a mixed model, it was impossible to use de command plot(model) for checking model adequacy. R returns this message: "Error in as.double(y) : cannot type '%s' c

[R] [OT] Typesetting / highlighting R code in Latex

2008-04-06 Thread Dirk Eddelbuettel
Using Latex and the beamer class, I would like to highlight code snippets. Does anybody know a suitable 'preprocessor' or 'filter' for R (and/or C/C++) code ? I have been including it in simple \begin{verbatim} ... \end{verbatim} and I know there is a better way -- in fact I saw it used a while b

[R] Mac install

2008-04-06 Thread BJ Miller
Need idiot's guide to installing R on Mac 10.3.9. Thanks. BJ __ 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,

Re: [R] How to improve the "OPTIM" results

2008-04-06 Thread Zaihra T
try to use method "L-BFGS-B" and give boudary condition to the parameters in use so that the algorithm search is limited to a particular region as it seems u have to many parameters. On Fri, 4 Apr 2008 22:10:20 -0700 (PDT) kathie wrote: > > Dear R users, > > I used to "OPT

Re: [R] What to use for assignment, " = " or " <- "?

2008-04-06 Thread Ben Bolker
csiro.au> writes: > > I've noticed an increasing tendency for people to use '=' rather than > the older '<-' symbol. When '=' became available as an assignment > operator in S-PLUS in the late '90s my first reaction was to switch to > it as well. Brian Ripley warned me that it was not a good

Re: [R] How to improve the "OPTIM" results

2008-04-06 Thread Hans W Borchers
> MORE GENERAL OPTIM ISSUES > > I'm considering creating a package 'optimMLE' that would automate > some of this and package it with common 'methods' that would assume that > sum(fn(...)) was either a log(likelihood) or the negative of a > log(likelihood), etc. However, before I do, I ne

Re: [R] how to manupute data frame with conditions fill cell with previous value if next cell is zero

2008-04-06 Thread Romain Francois
Hi, It's more a vector question. Try this one: > f function( x, test = is.na(x) | x == 0 ){ out <- x[!test][ cumsum(!test) ] if(test[1]) out <- c(NA,out) out } > f( c(1,0,2,1,0) ) [1] 1 1 2 1 1 > f( c(1,0,2,1,0, NA) ) # missing values are also replaced [1] 1 1 2 1 1 1 > f( c(0,1,0,2

[R] how to manupute data frame with conditions fill cell with previous value if next cell is zero

2008-04-06 Thread saikat sarkar
Dear R Experts, This is the 2nd time in the chat room. Its a great place to get help from R experts. I have a data frame problem, it contains thousands of data. part of it, I am giving for explaining the problem date day x yz 82 1989-04-28 Fri 2118.0 2418.80 33713

Re: [R] [R-SIG-Mac] sizing of quartz

2008-04-06 Thread [Ricardo Rodriguez] Your XEN ICT Team
Oops! Sorry! Accept my apologies. I've sent this message to the wrong list. Best regards, Ricardo [Ricardo Rodriguez] Your XEN ICT Team wrote: > Those are good news. > > Prof Brian Ripley wrote: > >> You didn't tell us the version of R. quartz() is different in 2.7.0 >> alpha, and there the

Re: [R] [R-SIG-Mac] sizing of quartz

2008-04-06 Thread [Ricardo Rodriguez] Your XEN ICT Team
Those are good news. Prof Brian Ripley wrote: > You didn't tell us the version of R. quartz() is different in 2.7.0 > alpha, and there the function arguments do work (and the size is > really as advertised and not at a notional 72dpi). In fact, it is a > much more standard device and interfac

Re: [R] How to improve the "OPTIM" results

2008-04-06 Thread kathie
Dear Spencer Graves, Thank you for your comments and suggestions. I knew that the true optimum values are about (0.69, 0.0, 0.0, -0.3, 0.3, 2.3, -3.0 ,-3.0). That's why I used these values as starting values. Nonetheless, the last three estimates are so bad. Regards, Kathryn Lord Spence

Re: [R] summary(object, test=c("Roy", "Wilks", "Pillai", ....) AND ellipse(object, center=....)

2008-04-06 Thread Bill.Venables
Yes, it does mean you can only get one kind of test at a time. If you want more than one kind of test, you have to do it separately. The simplest way to do this is probably something like this: M_obj <- manova(cbind(y1, y2) ~ z1, data = ex7.8) for(test in c("Wilks", "Roy", "Pillai")) pri

[R] What to use for assignment, " = " or " <- "?

2008-04-06 Thread Bill.Venables
I've noticed an increasing tendency for people to use '=' rather than the older '<-' symbol. When '=' became available as an assignment operator in S-PLUS in the late '90s my first reaction was to switch to it as well. Brian Ripley warned me that it was not a good idea. As usual he was right, bu