[R] Fwd: Categorial Response Questions

2008-10-18 Thread andyer weng
hi all, For my question in the first email below, I found I made a mistake on my coding in the previous email, the one I was trying to type should be grouped.titanic.df-data.frame(group.age.group=sort(unique(titanic.df$age.group)), +

Re: [R] Fwd: Categorial Response Questions

2008-10-18 Thread Simon Knapp
Not the same data your using but... # get something like a reasonable # age dist for dummy data: data('mw.ages', package='UsingR') mw.age - mw.ages[2:80,] # size of dummy dataset n.obs - 1000 #pr of survival pr.s - 0.80 # dummy data dat - data.frame( pclass=sample(c('1st', '2nd', '3rd'),

[R] Plot table of counts

2008-10-18 Thread pofigster
I have a data set which is comprised of counts, that is, the number of times a mass spectrometer measured a particular mass at a particular time (the rows and columns of the table). Is there a way to make a plot so that it draws a square at the mass/time spot on the graphic if there is a count

[R] sorting matrix output alphabetically

2008-10-18 Thread Bob Green
Hello, I have been using the TM package to create a TermDocMatrix, which I have saved as a matrix so that I can view word frequencies. Below is a section of the code that I have used and an excerpt of the output: What I wanted to be able to do is to view the output alphabetically - rather

Re: [R] Fwd: Categorial Response Questions

2008-10-18 Thread Frank E Harrell Jr
andyer weng wrote: Sorry Guys, i press the wrong button to send out the uncompleted message. let me do it again. I have a data set containing : pclass: A factor giving the class of the passenger: one of 1st, 2nd, 3rd. age: The age of the passenger in years. sex: Passenger's

Re: [R] sorting matrix output alphabetically

2008-10-18 Thread Prof Brian Ripley
Do you mean sort by the *names* of a *vector* alphabetically? (tot is a vector)? In which case tot[sort.list(names(tot))] If you want to sort new.matrix by its *colnames* of new.matrix, new.matrix[, sort.list(colnames(new.matrix))] See 'An Introduction to R' for the ideas involved, and the

[R] Several problems with hmisc latex function

2008-10-18 Thread Erich Studerus, Psychiatrische Uni-Klinik
Hi, I'm having several problems with the Hmisc latex function. First, there seems to be a conflict between the cellTexCmds and the cgroupTexComds. When I'm using both at the same time, I get an error message. Here's an example. I just added cellTexComds to the example on page 10 of this

[R] ARIMA - h-step ahead errors

2008-10-18 Thread Nuno Prista
Dear colleagues, “arima” returns directly the 1-step ahead errors but I am interested in obtaining other h-step ahead errors for several ARIMA models I have fitted. Is there any way I can obtain this with R? Any help would be appreciated. Sincerely, Nuno Prista

Re: [R] Plot table of counts

2008-10-18 Thread Greg Snow
The image function will plot a rectangle for each cell of a table with the color of the rectangle determined by the value of the rectangle. Any cells in the table that are NA will not produce a rectangle in the image plot. Can you make that work for your plot? -- Gregory (Greg) L. Snow Ph.D.

Re: [R] sorting matrix output alphabetically

2008-10-18 Thread Greg Snow
Prof Ripley referred you to the help pages for sort and order for the sorting part of your question. For viewing large data objects look at View (note capitol V), head, tail, page, and write.csv/write.table. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

[R] recovering value of scalar from false color map and image

2008-10-18 Thread Jan Theodore Galkowski
I have a JPEG map of temperature data, coded using a given legend where blues are cooler and reds hotter. Is there any preexisting R magic or package which might let me recover the value of the scalar quantity so represented given the RGB values at each point in the picture? After processing,

Re: [R] ARIMA - h-step ahead errors

2008-10-18 Thread Prof Brian Ripley
On Sat, 18 Oct 2008, Nuno Prista wrote: Dear colleagues, “arima” returns directly the 1-step ahead errors but I am interested in obtaining other h-step ahead errors for several ARIMA models I have fitted. Is there any way I can obtain this with R? Any help would be appreciated. See

Re: [R] ARIMA - h-step ahead errors

2008-10-18 Thread Nuno Prista
I have looked at the predict.Arima and its a fact that it returns the s.e. for several steps ahead. What I was wondering was if there was a way to access to the h-step ahead fitted innovations that underlie them. Nuno Prof Brian Ripley wrote: On Sat, 18 Oct 2008, Nuno Prista wrote: Dear

Re: [R] recovering value of scalar from false color map and image

2008-10-18 Thread Barry Rowlingson
2008/10/18 Jan Theodore Galkowski [EMAIL PROTECTED]: I have a JPEG map of temperature data, coded using a given legend where blues are cooler and reds hotter. Is there any preexisting R magic or package which might let me recover the value of the scalar quantity so represented given the RGB

[R] Error: could not find function readMat

2008-10-18 Thread Atul Kulkarni
Hi All, I installed this R.matlab package and tried using the sample code path - system.file(mat-files, package=R.matlab) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Reading all example files # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[R] R 2.7.2 missing something in the install packages menu functions...

2008-10-18 Thread Brian Lunergan
Hi folks: Puzzled about something. Is it just my imagination or has the dep = TRUE been dropped from the install packages menu function with this edition? As recently as 2.7.1 the choice seemed to hunt dependencies automatically, but now I'm having to enter the function manually to get that

Re: [R] Error: could not find function readMat

2008-10-18 Thread Jorge Ivan Velez
Dear Atul, See http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/R.matlab/html/readMAT.html I think that the function is readMAT rather than readMat. HTH, Jorge On Sat, Oct 18, 2008 at 1:35 PM, Atul Kulkarni [EMAIL PROTECTED]wrote: Hi All, I installed this R.matlab package and tried

Re: [R] Error: could not find function readMat

2008-10-18 Thread Atul Kulkarni
Hi Jorge, I just copied and pasted that code from here... http://bm2.genes.nig.ac.jp/RGM2/R_current/library/R.matlab/man/readMat.html after changing it to readMAT I get the following error. Loading all MAT v4 example files in /home/atul/R/x86_64-pc-linux-gnu-library/2.6/R.matlab/mat-files...

[R] Fehler in x$terms : $ operator is invalid for atomic vectors

2008-10-18 Thread Boriss
Dear All I try to use your R package MCMCpack and I have encountered the following problem: The following code works fine: library(MCMCpack) line - list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5)) posterior1 - MCMCregress(X~Y, data=line) summary(posterior1) But as long as I try the

[R] Getting names of variables without quotes

2008-10-18 Thread Amarjit Singh Sethi
  Dear R-helpers, hello I am seeking your help in somehow getting names of variables without quotes ( ). Let us say, we have a table with 3 variables V1, V2 and V3. After the table is read, I get names of the variables (thro' the following code) as under quotes (like V1 rather than the

Re: [R] Getting names of variables without quotes

2008-10-18 Thread Dieter Menne
Amarjit Singh Sethi set_alt at yahoo.co.in writes: I am seeking your help in somehow getting names of variables without quotes ( ). Let us say, we have a table with 3 variables V1, V2 and V3. After the table is read, I get names of the variables (thro' the following code) as under quotes

Re: [R] R 2.7.2 missing something in the install packages menu functions...

2008-10-18 Thread Prof Brian Ripley
What OS, which 'menu'? Is it my imagination or does the posting guide no lomger ask you for 'at a minimum' the output of sessionInfo() ? Rgui (for Windows) has used dependencies=NA (sic, the default for install.packages) since late 2006. And if you meant the MacOS R.app, that has a separate

Re: [R] Getting names of variables without quotes

2008-10-18 Thread Jorge Ivan Velez
Dear AJSS, Perhaps ?noquote might be useful for you. Here is an example: x=c('V1','V2','V3','V4') x [1] V1 V2 V3 V4 noquote(x) [1] V1 V2 V3 V4 HTH, Jorge On Sat, Oct 18, 2008 at 3:04 PM, Amarjit Singh Sethi [EMAIL PROTECTED]wrote: Â Dear R-helpers, hello I am seeking your help in

Re: [R] R-code in Latex --- $ sign causes error

2008-10-18 Thread erwann rogard
Haven't tried fancyvrb, but meanwhile this fixes it: http://www.latex-community.org/viewtopic.php?f=4t=2783p=10955#p10955 On Sat, Oct 18, 2008 at 12:00 AM, Henrik Bengtsson [EMAIL PROTECTED]wrote: Check out the 'fancyvrb' latex package - that is quite flexible and I wouldn't be surprised if

Re: [R] Fehler in x$terms : $ operator is invalid for atomic vectors

2008-10-18 Thread Ben Bolker
Boriss at gmx.net writes: Dear All I try to use your R package MCMCpack and I have encountered the following problem: You should (a) address this to the maintainers of the MCMCpack package (see help(package=MCMCpack) for contact info) and (b) indicate the results of sessionInfo(),

Re: [R] Plot table of counts

2008-10-18 Thread Michael Friendly
What is the *question* you want to answer from this table of counts? If it is just to see the density at the combinations of mass and time, an image() plot might work, and NAs in the table for 0s will give empty cells. If you want to see whether there is an association between mass and time, or

[R] Eval and parse function applied on file path

2008-10-18 Thread Tomislav Puđa
Hi, I have problem when evaluating string containing file path. path -inputDirectory='d:\\diplomski_rad\\testOutput\\temp' print(eval(parse(text=path))) After executing code, I get [1] d:diplomski_rad\testOutput\temp Warning messages: 1: '\d' is an unrecognized escape in a character string 2:

[R] derivatives and integrals in R

2008-10-18 Thread David Kaplan
__ 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] Please help

2008-10-18 Thread Sonam
Dear R-experts, I am trying to fit my model but I couldn't because of this error. here is the error Error in solve.default(dial(m) -A) : Lapack routine dgesv: system is exactly singular thank you all. sonam __ R-help@r-project.org mailing list

[R] extracting residual variance from glmmPQL

2008-10-18 Thread Jean-Baptiste Ferdy
Dear all, I am trying to simulate data sets from a model fitted with glmmPQL, in order to compute the distribution of a summary statistics. My data are binomial and I have a correlation term in my model. My model is structured in the following way m - glmmPQL( fixed = cbind(sucess,failure) ~ x1

[R] Select only cases with negative values

2008-10-18 Thread Michael Just
Hello, I was wondering if there was a way to only select cases my from data frame that contained a negative value? c-c(1,2,3,4,5,6,7,8,9,10) d- c(-1,2,-3,-4,5,6,-7,8,-9,10) f - cbind(c,d) dat -data.frame(f) dat.lm -lm(c~d) If I wanted to only use the rows that had a negative value in column

Re: [R] Select only cases with negative values

2008-10-18 Thread Henrique Dallazuanna
Try this: dat.lm -lm(c~d, subset=d 0) On Sat, Oct 18, 2008 at 7:03 PM, Michael Just [EMAIL PROTECTED] wrote: Hello, I was wondering if there was a way to only select cases my from data frame that contained a negative value? c-c(1,2,3,4,5,6,7,8,9,10) d- c(-1,2,-3,-4,5,6,-7,8,-9,10) f -

Re: [R] Eval and parse function applied on file path

2008-10-18 Thread Prof Brian Ripley
On Sat, 18 Oct 2008, Tomislav Puđa wrote: Hi, I have problem when evaluating string containing file path. path -inputDirectory='d:\\diplomski_rad\\testOutput\\temp' print(eval(parse(text=path))) After executing code, I get [1] d:diplomski_rad\testOutput\temp Warning messages: 1: '\d' is an

Re: [R] Select only cases with negative values

2008-10-18 Thread Michael Just
Henrique, Thanks for the rapid response. I tried the following to no avail: dat.lm -lm(c~d, dat=dat, subset= d 0) Error in eval(expr, envir, enclos) : invalid 'envir' argument dat.lm -lm(c~d, dat=dat, subset= (d 0)) Error in eval(expr, envir, enclos) : invalid 'envir' argument dat.lm -lm(c~d,

Re: [R] Select only cases with negative values

2008-10-18 Thread Henrique Dallazuanna
Works for me. dat.lm -lm(c~d, data = dat, subset=d 0) Please see if you have dat with d and c columns names. On Sat, Oct 18, 2008 at 7:18 PM, Michael Just [EMAIL PROTECTED] wrote: Henrique, Thanks for the rapid response. I tried the following to no avail: dat.lm -lm(c~d, dat=dat, subset= d

Re: [R] Select only cases with negative values

2008-10-18 Thread Johannes Hüsing
Am 18.10.2008 um 23:03 schrieb Michael Just: Hello, I was wondering if there was a way to only select cases my from data frame that contained a negative value? c-c(1,2,3,4,5,6,7,8,9,10) d- c(-1,2,-3,-4,5,6,-7,8,-9,10) f - cbind(c,d) dat -data.frame(f) dat.lm -lm(c~d) If I wanted to only

Re: [R] Select only cases with negative values

2008-10-18 Thread Michael Just
Johannes, Thanks for the response. However, ... dat.neg - dat[dat$d 0, ] Error in dat[dat$d 0, ] : incorrect number of dimensions In addition: Warning message: $ operator is deprecated for atomic vectors, returning NULL in: dat$d Any other ideas? Thanks, Michael On Sat, Oct 18, 2008 at 5:18

Re: [R] Please help

2008-10-18 Thread stephen sefick
can you give us a reproducible example? On Sat, Oct 18, 2008 at 1:55 PM, Sonam [EMAIL PROTECTED] wrote: Dear R-experts, I am trying to fit my model but I couldn't because of this error. here is the error Error in solve.default(dial(m) -A) : Lapack routine dgesv: system is exactly singular

[R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-18 Thread Andreas Wittmann
Dear R useRs, on ubuntu 8.04 i try to create a shared object out of a c-file this is // add.c #include Rinternals.h SEXP addiere(SEXP a, SEXP b) { int i, n; n = length(a); for (i = 0; i n; i++) REAL(a)[i] += REAL(b)[i]; return(a); } in terminal i type R CMD SHLIB add.c and get gcc

Re: [R] Getting names of variables without quotes

2008-10-18 Thread Charles C. Berry
On Sun, 19 Oct 2008, Amarjit Singh Sethi wrote: ?? Dear R-helpers, hello I am seeking your help in somehow??getting names of variables without quotes ( ). Let us say,??we have a table with 3 variables V1, V2 and V3. After the table is read, I get names of the variables??(thro' the following

[R] factors in dynlm?

2008-10-18 Thread Werner Wernersen
Hello, how can one use factors in dynlm? I would like to add month dummies to the equation. Or is creating 12 vectors the way to do it? Thanks a lot, Werner einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com

[R] Dep setting for install of packages...

2008-10-18 Thread Brian Lunergan
Evening again folks: Bear with me while crow is consumed. I had asserted that 2.7.2 had dep = NA while prior installations had it turned on. Incorrect on my part. Dumped that version and stepped back two iterations to 2.7.0. Tried it with that one and the setting is indeed off for installing

Re: [R] Dep setting for install of packages...

2008-10-18 Thread Gabor Grothendieck
dependencies = NA is only identical to dependencies = FALSE if .libPaths() has multiple components. If it has a single component then its the same as dependencies = c(Depends, Imports). Read the dependencies= entry on the ?install.packages page. Also read ?.libPaths On Sat, Oct 18, 2008 at

Re: [R] factors in dynlm?

2008-10-18 Thread Achim Zeileis
On Sun, 19 Oct 2008, Werner Wernersen wrote: Hello, how can one use factors in dynlm? I would like to add month dummies to the equation. Or is creating 12 vectors the way to do it? You can use y ~ season(y) + ... in the formula. There is a small example on help(dynlm, package = dynlm)

Re: [R] Dep setting for install of packages...

2008-10-18 Thread Brian Lunergan
Gabor Grothendieck wrote: dependencies = NA is only identical to dependencies = FALSE if .libPaths() has multiple components. If it has a single component then its the same as dependencies = c(Depends, Imports). Read the dependencies= entry on the ?install.packages page. Also read

[R] MCMClogit: using weights

2008-10-18 Thread reezwan you
Hi everyone: I am just wondering how can I use weights with MCMClogit function (in MCMCpack package). For example, in case of glm function as given below, there is weights option in the arguments. Aparently there is no option of using weights in MCMClogit. glm(formula, family = gaussian,

Re: [R] R CMD SHLIB: file not recognized: File format not recognized

2008-10-18 Thread Dirk Eddelbuettel
On Sun, Oct 19, 2008 at 01:27:06AM +0200, Andreas Wittmann wrote: Dear R useRs, on ubuntu 8.04 i try to create a shared object out of a c-file this is // add.c #include Rinternals.h SEXP addiere(SEXP a, SEXP b) { int i, n; n = length(a); for (i = 0; i n; i++) REAL(a)[i] +=

Re: [R] Dep setting for install of packages...

2008-10-18 Thread Gabor Grothendieck
Your .libPaths() has a single component. The number of characters in it is not relevant so it should be bringing in the dependenies. Suggest you try this: debug(utils:::menuInstallPkgs) and try using the menu now and see what comes up. On Sat, Oct 18, 2008 at 9:37 PM, Brian Lunergan [EMAIL

Re: [R] variable selection for multiple regression model

2008-10-18 Thread Greg Snow
The leaps package does best subset and returns some of what you asked for, but it does not do press. The DAAG package (and possibly others) has a function to compute PRESS, you may be able to use the models from leaps with the function from DAAG to get what you want there. However, be careful

[R] multivariate integral with ADAPT when the parameter is close to boundary

2008-10-18 Thread Muhtar Osman
Dear All, There is one problem I encountered when I used ADAPT to compute some 2-D integral w.r.t beta density. For example, when I try to run the following comments: fun2-function(theta){return(dbeta(theta[1],0.005,0.005)*dbeta(theta[2],0.005,0.005))} int.fun2-adapt(ndim=2,lo = c(0,0), up =

[R] definition of dffits

2008-10-18 Thread Kunio takezawa
R-users E-mail: r-help@r-project.org Hi! R-users. I am just wondering what the definition of dffits in R language is. Let me show you an simple example. function() { library(MASS) xx - c(1,2,3,4,5) yy - c(1,3,4,2,4) data1 - data.frame(x=xx, y=yy) lm.out - lm(y~., data=data1,

Re: [R] MCMClogit: using weights

2008-10-18 Thread Prof Brian Ripley
On Sat, 18 Oct 2008, reezwan you wrote: Hi everyone: I am just wondering how can I use weights with MCMClogit function (in MCMCpack package). For example, in case of glm function as given below, there is weights option in the arguments. Aparently there is no option of using weights in

Re: [R] multivariate integral with ADAPT when the parameter is close to boundary

2008-10-18 Thread Prof Brian Ripley
1) That integrand is a product, so you can do this a product of integrals, and do those analytically. 2) Do you have any idea how extreme beta(0.005, 0.005) is? See the comment in the help for integrate: Like all numerical integration routines, these evaluate the function on a