[R] Controlling the Output from table()

2007-10-06 Thread Öhagen Patrik
Dear All, I would like to have some controll over the output from the function table(). I want to controll the order of the cells and I want to include empty cells (if any). Example: I have ordinal data wich takes the values 1,2,3N but I want the output from table to put the frequencies

Re: [R] list matching

2007-10-06 Thread Adrian Dusa
On Sunday 07 October 2007, Gabor Grothendieck wrote: > zoo's merge can do a multiway intersection. We turn each component > of aa into the times of a dataless zoo object (assuming the elements of > each component are unique) and merge them together using all = FALSE > which will only leave those p

Re: [R] R-2.6.0 and RWinEdt

2007-10-06 Thread Jean-Louis Abitbol
Dear Listers, I have the same problem on vista home premium. > library(RWinEdt) Does not launch R-Winedt > startWinEdt(.gW$InstallRoot, .gW$ApplData) Does nor either launch > sessionInfo() R version 2.6.0 Patched (2007-10-03 r43075) i386-pc-mingw32 locale: LC_COLLATE=French_France.1252;LC_C

Re: [R] help_R2.5 updating

2007-10-06 Thread Prof Brian Ripley
There is no 'R 2.5'! Advice as requested: 1) Study the R posting guide and give the details it asks you for, accurately. 2) Read the rw-FAQ. Very relevant for Windows Vista users. 3) Don't use obsolete versions of R. R 2.6.0 is current, and we do make R better at each release. If you ha

Re: [R] Re-ordering factors

2007-10-06 Thread James Reilly
Using reorder.factor from the stats package seems to work: educ$ed <- reorder(educ$Education, sort(rep(1:4,5))) levels(educ$Education) [1] "CompletedHS" "IncompleteHS" "Uni1-3" "Uni4+" levels(educ$ed) [1] "IncompleteHS" "CompletedHS" "Uni1-3" "Uni4+" xtabs(Count ~ ed + Age_Group, d

[R] Re-ordering factors

2007-10-06 Thread maj
A small example before I begin my query: > educ <- read.table(efile, header=TRUE) > educ Education Age_Group Count 1 IncompleteHS 25-34 5416 2 IncompleteHS 35-44 5030 3 IncompleteHS 45-54 5777 4 IncompleteHS 55-64 7606 5 IncompleteHS >64 13746 6 CompletedHS

Re: [R] help_R2.5 updating

2007-10-06 Thread Gabor Grothendieck
By the way, just to be clear when I wrote %userprofile% I meant that you should replace that with the value of %userprofile% set u at the Windows console will show it. On 10/6/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > I found that installing R into %userprofile%\Documents\R and placing

[R] how to use \Sexpr{} with sweave

2007-10-06 Thread cryan
I'm trying to learn Sweave. So far things are going well with the chunks of code identified by << >>= But I'm having trouble with the in-line text use of \Sexpr. Here is a short example .Rnw file: \documentclass[12pt]{article} \usepackage[margin=1.25in]{geometry} \usepackage{graphicx} \usepack

Re: [R] help_R2.5 updating

2007-10-06 Thread Gabor Grothendieck
I found that installing R into %userprofile%\Documents\R and placing the source packages I was developing there too solved my permissions problems. R automatically created a %userprofile%\Documents\R\win-library\2.6 folder for my library and put packages that I was installing from CRAN in it. I

Re: [R] Tricky vectorization problem

2007-10-06 Thread Mike Lawrence
Seems there were some line break issues when pasting the code, trying again with a different commenting style: #start a timer start = proc.time()[1] #set the true correllation rho = .5 #set the number of Subjects Ns = 100 #for each subject, set a number of observations in A a.No = 1:100 #for

[R] constructing a self-starting non-linear model

2007-10-06 Thread Irene Mantzouni
Dear all, I am trying to define a selfStart function for a non-linear model, which is a log-transformed SSmicmen model with multiplicative errors and so it is required to make them additive: log(y)=log(a)+log(x)-log(1+x/b) Any ideas about how to use the "peeling" method to derive the "ini

[R] a function to compute the cumulative distribution function (cdf) of the gamma

2007-10-06 Thread elodie gillain
Dear Forum, I would need to write a function to calculate the cumulative distribution function (cdf) of the gamma random variable. I am allowed to use the following precoded functions: rgamma, pgamma, and dgamma. I am a little overwhelmed by this project, I am wondering how I should start. Shoul

Re: [R] list matching

2007-10-06 Thread Gabor Grothendieck
zoo's merge can do a multiway intersection. We turn each component of aa into the times of a dataless zoo object (assuming the elements of each component are unique) and merge them together using all = FALSE which will only leave those points at times in all components. Extracting the time and st

[R] Tricky vectorization problem

2007-10-06 Thread Mike Lawrence
Hi all, I'm using the code below within a loop that I run thousands of times and even with the super-computing resources at my disposal this is just too slow. The snippet below takes about 10s on my machines, which is an order of magnitude or two slower than would be preferable; in the end

Re: [R] plot the chi-square distribution for n=1 through 10, on one plot

2007-10-06 Thread Peter Dalgaard
fb wrote: > Dear help list. > > I would like to plot the chi-square distribution for n=1 through 10, on > one plot. > > How do I go about doing that? > > I know how to plot one chi-square (using curve() for example), but > plotting 10 on one plot, that is too difficult for me. > > I greatly appreci

[R] plot the chi-square distribution for n=1 through 10, on one plot

2007-10-06 Thread fb
Dear help list. I would like to plot the chi-square distribution for n=1 through 10, on one plot. How do I go about doing that? I know how to plot one chi-square (using curve() for example), but plotting 10 on one plot, that is too difficult for me. I greatly appreciate your help. -- fb [

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-06 Thread Marc Schwartz
On Sat, 2007-10-06 at 13:42 -0500, Dirk Eddelbuettel wrote: > On 6 October 2007 at 11:01, Scionforbai wrote: > | > What features are you missing in emacs that you wish were there? Are > | > these ESS features or LaTeX related features? > | > | is it only me or has anyone else the problem that run

Re: [R] list matching

2007-10-06 Thread Adrian Dusa
On Saturday 06 October 2007, Marc Schwartz wrote: > [...] > > intersectList <- function(x) > { > res <- table(unlist(sapply(x, unique))) > names(res[res == length(x)]) > } > > > In the first line, I use unique() to ensure that if the same letter > appears more than once in the same list element

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-06 Thread deepayan . sarkar
On 10/6/07, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote: > > On 6 October 2007 at 11:01, Scionforbai wrote: > | > What features are you missing in emacs that you wish were there? Are > | > these ESS features or LaTeX related features? > | > | is it only me or has anyone else the problem that runni

Re: [R] problem installing fields package 3.5 on R 1.8.1 on linux

2007-10-06 Thread Marc Schwartz
On Sat, 2007-10-06 at 14:05 -0600, jpgirard wrote: > I am returning to using R after a little time away. > > Saw some great new functions in the fields package and decided to upgrade. > > Everything seems to go fine until I tried to actually load the package, when > I get an error: > > >library(

Re: [R] list matching

2007-10-06 Thread Marc Schwartz
On Sat, 2007-10-06 at 19:49 +, Adrian Dusa wrote: > Dear list, > > Given a list of elements like: > aa <- list(one=c("o", "n", "e"), >tea=c("t", "e", "a"), >thre=c("t", "h", "r", "e")) > > Is there a function that returns the intersection between all? > Both ma

[R] problem installing fields package 3.5 on R 1.8.1 on linux

2007-10-06 Thread jpgirard
I am returning to using R after a little time away. Saw some great new functions in the fields package and decided to upgrade. Everything seems to go fine until I tried to actually load the package, when I get an error: >library(fields) Error in parse(file, n, text, prompt) : syntax error on lin

[R] list matching

2007-10-06 Thread Adrian Dusa
Dear list, Given a list of elements like: aa <- list(one=c("o", "n", "e"), tea=c("t", "e", "a"), thre=c("t", "h", "r", "e")) Is there a function that returns the intersection between all? Both match() and intersect() only deal with two arguments, but sometimes I ha

[R] Question about Distinguishable Permutation

2007-10-06 Thread house-ball
Hi, How can I list all possilities of Distinguishable Permutation by R? For example, N=6, n1=n2=n3=2, the total possible answers are 6!/(2!2!2!)=90. Please help me. Thank you So much. ___

[R] Simulate data based on correlation coefficient

2007-10-06 Thread Gustavo
Hello all, I have a vector with 1000 values and I would like to generate other correlated vector, but with different correlation coefficient (for example, r = 0.7). Any ideas how can I do this? Regards, Gustavo. ___

[R] help_R2.5 updating

2007-10-06 Thread Thanjavur Bragadeesh
Hi, I run windows vista ultimate in my laptop and run R 2.5 I am trying to update the packages but it comes up with an error message ""Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, : 'lib' is not writable Error in install.packages(update[

[R] Bug or not

2007-10-06 Thread Darius Kasiulevičius
I have this sample from help. I try use command erase.screen() but in split mode sreen dont erase. Why? split.screen(c(2,1)) # split display into two screens split.screen(c(1,2),2) # split bottom half in two plot(1:10) # screen 3 is active, draw plot erase.screen() # forgot label, erase and redra

Re: [R] Tart charts

2007-10-06 Thread Michael Friendly
Try this alternative: # from http://research.microsoft.com/users/lamport/pubs/hair.pdf hairsex <- matrix( c(46, 45, 13, 12, 1, 101, 0, 20), 2, 4, byrow=TRUE) dimnames(hairsex) <- list("Gender"=c("Female", "Male"), "Hair color"=c("Blond", "Brown", "Red", "Other") ) libra

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-06 Thread Dirk Eddelbuettel
On 6 October 2007 at 11:01, Scionforbai wrote: | > What features are you missing in emacs that you wish were there? Are | > these ESS features or LaTeX related features? | | is it only me or has anyone else the problem that running an R process | within emacs is way much slower than in a regular

[R] Rounding of lme coefficients: Mac vs Windows

2007-10-06 Thread David Afshartous
All, I have an lme model estimated in R 2.5.1 on my Mac; when I estimate the same model on Windows, the parameter coefficients are rounded to integers. Below is a similar example for the Orthodont data. Is there some option I need to set in the Windows version to prevent rounding? Didn't see th

[R] factanal: error message

2007-10-06 Thread Steve Friedman
Hi everyone, I'm running a factor analysis on a correlation matrix with 32 rows and columns. I get the following error when I issue the command sequence mich.fac1 <- factanal(michcor, factor=1) Error in solve.default(cv) : system is computationally singular: reciprocal condition number = 3.2472

Re: [R] Mac GUI and .Renviron

2007-10-06 Thread Rob J Goedman
Jacob, As Steven mentioned, [EMAIL PROTECTED] is a list specific for OSX only questions. I think you can achieve something similar by going into the preference settings of R.app, select the Startup section and select 'Source input file', de-select 'Always apply' and make the R history fi

Re: [R] installing Rmpi

2007-10-06 Thread Prof Brian Ripley
On Fri, 5 Oct 2007, Erin Hodgess wrote: > Hi R people: > > I installed R-2.6.0 on a Red Hat Linux system and am now trying > to install the Rmpi package. > > The installation cannot seem to find the mpi.h file, even though it exists. > > Is there a variable that I should be exporting into the proc

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-06 Thread Scionforbai
> kate infact allows you to pipe commands to console (tools->pipe to > console). I have pretty much the same setup as you. But I have defined > a shortcut for piping the commands to console in kate. So I just > have to highlight commands using shift and arrow keys, and press F4 > (my shortcut) and

Re: [R] Tart charts

2007-10-06 Thread Jim Lemon
roger koenker wrote: > It being friday, I would like to call your attention to an innovative > data analysis by Leslie Lamport available from: > > http://research.microsoft.com/users/lamport/pubs/hair.pdf > > I particularly liked the graphics. > > Stone the flamin' crows, why didn't I thi

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-06 Thread Scionforbai
Hi, > What features are you missing in emacs that you wish were there? Are > these ESS features or LaTeX related features? is it only me or has anyone else the problem that running an R process within emacs is way much slower than in a regular terminal/console? (linux here)

[R] R-2.6.0 and RWinEdt

2007-10-06 Thread Patrick Giraudoux
Dear Listers, I have just installed R-2.6.0 and the RWinEdt package 1.7-6 under Windows XP. The R-WinEdt menu well appears at launching (the command library(RWinEdt) is in .Rprofile), but WinEdt is NOT started automatically (this was not the case in the earlier versions of R). When WinEdt is sta