Re: [R] Confusion in 'quantile' and getting rolling estimation of sample quantiles

2010-01-18 Thread Gabor Grothendieck
My post was based on the definitions in yours so x had already been defined as a zoo object, x - zoo(rnorm(500,0,1)). On Mon, Jan 18, 2010 at 1:17 AM, Saji Ren saji@gmail.com wrote: sorry for bothering you again, the problem solved. the command should be :

Re: [R] a question about multilevelmodel

2010-01-18 Thread Gabor Grothendieck
This is reshaping the data frame from wide to long form. In particular, MULTDV is as.vector(t(dvs)). Try typing this on a line by itself: make.univ to see the code and clarify your understanding. Also try the examples in ?reshape to familiarize yourself with wide to long transformations. On

[R] Odp: For loops in R

2010-01-18 Thread Petr PIKAL
Hi Definitely not from first I get gBest-floor(runif(popsize,min=1,max=top)) Error in runif(popsize, min = 1, max = top) : object 'popsize' not found and from second for (i in 1:popsize) { + for (j in 1:maxvar) { +gBest-sample(top,size=1) +velocity[i,j]-.4* velocity[i,j] + 1 *

Re: [R] Error: object of type 'closure' is not subsettable

2010-01-18 Thread Romain Francois
On 01/17/2010 09:00 PM, Rolf Turner wrote: I thought it would be possible to make rep() work for functions by writing a method for the function class. I tried: rep.function - function(x,...) { times - as.list(...)[[1]] rslt - vector(list,times) rslt[1:times] - list(x) rslt } But then doing

[R] La.svd of a symmetric matrix

2010-01-18 Thread Stefano Sofia
Thanks to David Winsemius for his help about the use of La.svd. Two more questions. QUESTION 1 Your example works fine, but the one that I propose below does not. Your example: Asymm [,1] [,2] [,3] [1,] 66 101 95 [2,] 101 76 104 [3,] 95 104 26 La.svd(Asymm) $d [1]

Re: [R] Sub-matrixes that are linked to the Base matrix

2010-01-18 Thread Simon Knapp
The following code gives you functionality close to what you are looking for (I think)... but someone more familar with proto might be able to make it sexier. You will need to install the package 'proto' (though with a bit of work you might be able to do this without proto, using environments

[R] A question about build R-2.10.0 on HP-UX ia64 server.

2010-01-18 Thread 亿元五角
Hi R usrs, I want to build R-2.10.0 on HP-UX, but I got following error message: ld: Unsatisfied symbol zgemm in file CHOLMOD.a[cholmod_l_super_numeric.o] ld: Unsatisfied symbol zgemv in file CHOLMOD.a[cholmod_l_super_solve.o] ld: Unsatisfied symbol zherk in file

[R] using tabble

2010-01-18 Thread Fan Dan
Dear Helper: I am using R to finish a project which is near the dealine. Please help me ! I need to construct a table. The name of the table is the sequence from 1 to 7 with some missing values arbitrarily. For example 1 to 7 12 36 7 12 3 45 5 7 I want to add the

Re: [R] Odp: For loops in R

2010-01-18 Thread cjmr
Hello Sorry for the confusion Here are additional details. velocity, popVar, archiveVar,pbestsVar are matrices with dimension of 500 row, 2 col matrix. I want to assign new values for each velocity[i,j] using the formula below: *0.4 * velocity[i,j] + 1 * randomvalue * (pbestsVar[i,j] -

Re: [R] A question about build R-2.10.0 on HP-UX ia64 server.

2010-01-18 Thread Prof Brian Ripley
Please ask about installing on unusual platforms on the R-devel list, with reasonably complete output (we have not got the command that failed, do not know which compilers there are ...). You might want to talk directly to the Matrix authors, since this is a failure to install Matrix right at

Re: [R] using tabble

2010-01-18 Thread Bernardo Rangel Tura
On Mon, 2010-01-18 at 17:17 +0800, Fan Dan wrote: Dear Helper: I am using R to finish a project which is near the dealine. Please help me ! I need to construct a table. The name of the table is the sequence from 1 to 7 with some missing values arbitrarily. For example 1 to 7 1

Re: [R] using tabble

2010-01-18 Thread Jim Lemon
On 01/18/2010 08:17 PM, Fan Dan wrote: Dear Helper: I am using R to finish a project which is near the dealine. Please help me ! I need to construct a table. The name of the table is the sequence from 1 to 7 with some missing values arbitrarily. For example 1 to 7 12 36 7 12 3

[R] does any package have the functionality of ace() from old acepack?

2010-01-18 Thread GlenB
I found the old ace function (from acepack) valuable a couple of years ago in helping to find a transformation of the response to approximate additivity in smooth functions of the predictors. ace used alternating conditional expectations, but I'm not overly fixated on algorithms as long as it

Re: [R] A question about build R-2.10.0 on HP-UX ia64 server.

2010-01-18 Thread 亿元五角
I tried build R-2.10.1 and found this issue can be reproduce. I have sent this mail to R-devel list. Thanks, Xu Jin Date: Mon, 18 Jan 2010 09:44:00 + From: rip...@stats.ox.ac.uk To: dna_...@hotmail.com CC: r-help@r-project.org Subject: Re: [R] A question about build R-2.10.0

[R] Exporting a data.frame to excel using sqlSave - adds a character ' to values

2010-01-18 Thread Tal Galili
Hi all, I am using RODB to export multiple data.frames into one excel file with multiple sheets. One thing I can't seem to unserdatand is way the command adds the character: ' To the beginning of each of my (non numeric) values. Here is an example code: library(RODBC) library(MASS)

Re: [R] A question about build R-2.10.0 on HP-UX ia64 server.

2010-01-18 Thread Prof Brian Ripley
On Mon, 18 Jan 2010, 亿元五角 wrote: I tried build R-2.10.1 and found this issue can be reproduce. I have sent this mail to R-devel list. Without the missing information asked for, so we still will be unable to help. Thanks, Xu Jin Date: Mon, 18 Jan 2010 09:44:00 + From:

Re: [R] advice/opinion on - vs = in teaching R

2010-01-18 Thread S Ellison
Thomas Lumley tlum...@u.washington.edu 15/01/2010 16:07 Which should I use or does it matter, please? I would say to use = if you are teaching people familiar with C or Java, and to use - otherwise. Nothing like an option to induce polarisation! '=' is used in at least two contexts in R,

Re: [R] Odp: For loops in R

2010-01-18 Thread Petr PIKAL
Hi slightly better. However it would be nice if you provided some code which works but not the way you want. Loops are not as problematic but often you achieve far better results by avoiding them and using vectorised code. Still there are some oddities. random values in formula below shall be

Re: [R] does any package have the functionality of ace() from old acepack?

2010-01-18 Thread Jonathan Baron
Acepack is still in the archive section of CRAN: http://cran.r-project.org/src/contrib/Archive/acepack/acepack_1.3-2.2.tar.gz It seems to work despite the warning, but I guess you'd better test it. It is very simple: a few very old fortran scripts and an R wrapper by Thomas Lumley. I'm going

Re: [R] panel.bpplot

2010-01-18 Thread netrunner
Dear Dieter, thank you so much for your help. I have a question yet, sorry. I have as x variable a matrix (14 row,8 columns) containing the numerical ratings of a group of users. I cannot use bwplot in this case. How can do it? thank you so much netrunner Dieter Menne wrote:

[R] density() vs. KernSmooth::bkde

2010-01-18 Thread Mario Valle
Any advice when to use denstity() and when the KernSmooth package bkde() to smooth a histogram? No specific problem to use either one, but I'm curious why there are two so similar implementations. Thanks! mario -- Ing. Mario Valle Data Analysis and Visualization Group

[R] ggplot2 histogramm

2010-01-18 Thread Christian Schulz
Hi, i get no success change the title of the fill (colour) legend and the defintion of levels. Have anybody a hint how i can do this. df - data.frame(variable=sample(c(A,B,C),1000,replace=T,prob=c(0.22,0.28,0.5)),group=gl(2,500)) p - ggplot(df, aes(x = variable)) p + geom_histogram(aes(y=

[R] errors appears in my time Series regression fomula

2010-01-18 Thread snowcat wong
Dear all, I found really difficult with the time series questions, please help me with this monthly airline series! I have run the following r code, and there is an error appeared at the end. The data files was enclosed in the email. I'm sorry the errors message appeared in chinese,

Re: [R] density() vs. KernSmooth::bkde

2010-01-18 Thread Prof Brian Ripley
On Mon, 18 Jan 2010, Mario Valle wrote: Any advice when to use denstity() and when the KernSmooth package bkde() to smooth a histogram? No specific problem to use either one, but I'm curious why there are two so similar implementations. They are fundamentally different. density() uses

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread Steve Sidney
Hi David Thanks for your patience, as well as thanks to Dennis Murphy and James Rome for trying to help. I have tried all your suggestions but still no joy. In order to try and resolve the problem I am attaching the following files, hope the system allows this. 1) Test_data_res.txt (used

[R] new R package. How to hide data file

2010-01-18 Thread james.foadi
Dear R community, I'm in the process of writing a package. One of the functions reads a whole ascii file, full of data: SYMINFO - scan(/file/full/of/data.txt,what=character,sep=\n,quiet=TRUE) SYMINFO is now an array character with roughly 14000 elements. I thought the best way to use this

Re: [R] errors appears in my time Series regression fomula

2010-01-18 Thread jim holtman
That line: lines(yfit1,c=3) does not appear in the code that you sent. I assume that you meant 'col=3'. The message may be saying that there are multiple partial matches for 'c' as a parameter. The code you included worked fine on my system. Do you manually input this line? 2010/1/18 snowcat

Re: [R] ggplot2 histogramm

2010-01-18 Thread ONKELINX, Thierry
I think you need scale_fill_continuous(Your new label) Note that you can simplify scale_y_continuous(formatter = percent) + ylab(Anteil in %) To scale_y_continuous(Anteil in %, formatter = percent) HTH, Thierry

[R] lattice and legend

2010-01-18 Thread robert-mcfadden
I use lattice package to produce a bar chart. I set my.kolor for bars and it displays properly but I have a problem with legend color. It behaves as if I didn't set my.colors - the colors differs. How to work it out? barchart(Counts ~ Purchase | Products , data = my.data, groups = Model,

[R] Shortcut to run script

2010-01-18 Thread Ivan Calandra
Hi Everybody! I have a simple question: I would like to know the keyboard shortcut to run a script in R (Run all). I already know the CTRL+R but it doesn't run the whole script at once. I would like to avoid CTRL+A and then CTRL+R. Is it possible? If yes, how? As is probably now clear, I'm a

Re: [R] enty-wise closest element

2010-01-18 Thread Jason Smith
Here is one approach if I understand your requirements correctly. ind1-c(1,4,10) ind2-c(3,5,11) m - expand.grid(ind2=ind2,ind1=ind1) m$diff - (m$ind2 - m$ind1) f - function(x) { min_idx - which.min(x$diff[x$diff 0 x$diff x$ind2])

Re: [R] Exporting a data.frame to excel using sqlSave - adds a character ' to values

2010-01-18 Thread Dieter Menne
Tal Galili wrote: I am using RODB to export multiple data.frames into one excel file with multiple sheets. One thing I can't seem to unserdatand is way the command adds the character: ' To the beginning of each of my (non numeric) values. This might be a problem of you running in

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 7:58 AM, Steve Sidney wrote: Hi David Thanks for your patience, as well as thanks to Dennis Murphy and James Rome for trying to help. I have tried all your suggestions but still no joy. In order to try and resolve the problem I am attaching the following files, hope

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 8:53 AM, David Winsemius wrote: On Jan 18, 2010, at 7:58 AM, Steve Sidney wrote: Hi David Thanks for your patience, as well as thanks to Dennis Murphy and James Rome for trying to help. I have tried all your suggestions but still no joy. In order to try and resolve

Re: [R] Shortcut to run script

2010-01-18 Thread Duncan Murdoch
On 18/01/2010 8:32 AM, Ivan Calandra wrote: Hi Everybody! I have a simple question: I would like to know the keyboard shortcut to run a script in R (Run all). I already know the CTRL+R but it doesn't run the whole script at once. I would like to avoid CTRL+A and then CTRL+R. Is it possible?

[R] variable name substitution

2010-01-18 Thread Ivan Calandra
Hi everybody! I'm trying to write a script to plot a histogram, a boxplot and a qq-plot (under Windows XP, R2.10 if it matters) What I want to do: define the variables (x and y) to be used at the very beginning, so that I don't have to change all occurrences in the script when I want to plot

Re: [R] density() vs. KernSmooth::bkde

2010-01-18 Thread Mario Valle
Thanks Prof. Ripley! Indeed the correct comparison is between density() and the more modern GenKern::KernSec() and in this case the difference is negligible, so I will use density() for my work. Thanks! mario On 18-Jan-10 13:57, Prof Brian Ripley wrote: On Mon, 18 Jan 2010,

Re: [R] lattice and legend

2010-01-18 Thread Dieter Menne
robert-mcfadden wrote: I use lattice package to produce a bar chart. I set my.kolor for bars and it displays properly but I have a problem with legend color. It behaves as if I didn't set my.colors - the colors differs. How to work it out? barchart(Counts ~ Purchase | Products ,

[R] linking r and C

2010-01-18 Thread Allan Clark
hello i have a few quick questions. i am using a windows platform. how does one include functions from a particular r package in the C code. e.g. rgamma can be included if we include #include R.h #include Rmath.h , and #include math.h in the C code. what should be included if i want to

Re: [R] exporting text output to pdf

2010-01-18 Thread Demyan
... or, as a lightweight solution, use function textplot in package gplots An R newbie experimenting with pdf(), and then with textplot(), I find that each plot or textplot'ted (with default settings) text is displayed on a separate page. How can I get a normal-font-sized 'Hello world'

Re: [R] panel.bpplot

2010-01-18 Thread Frank E Harrell Jr
You ignored my posting about getting Lattice to work for you (bwplot( ... )) before trying to add panel=panel.bpplot to the command. Once you learn how to use lattice you will be able to answer your own question. One of the things you will find out is that only a few lattice functions handle

Re: [R] panel.bpplot

2010-01-18 Thread netrunner
Ok, thank you so much! netrunner Frank E Harrell Jr wrote: You ignored my posting about getting Lattice to work for you (bwplot( ... )) before trying to add panel=panel.bpplot to the command. Once you learn how to use lattice you will be able to answer your own question. One of the

Re: [R] does any package have the functionality of ace() from old acepack?

2010-01-18 Thread GlenB
Thanks very much, it looks to be an implementation the same algorithm with slightly different form of inputs and some useful extras. It should do nicely. Jonathan Baron wrote: A similar function is transace from the Hmisc package: http://finzi.psych.upenn.edu/library/Hmisc/html/transace.html

Re: [R] exporting text output to pdf

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 8:40 AM, Demyan wrote: ... or, as a lightweight solution, use function textplot in package gplots An R newbie experimenting with pdf(), and then with textplot(), I find that each plot or textplot'ted (with default settings) text is displayed on a separate page.

[R] column selection for aggregate()

2010-01-18 Thread Ivan Calandra
Hi everybody! I'm working on R today so I have a lot of questions (you may have noticed that it's the 3rd email today). I'm new on R, so please excuse the spam! I have a dataset ssfa with many rows and the column names are: names(ssfa) [1] SPECSHOR BONE TO_POSMEASUREM FACETTE

Re: [R] Shortcut to run script

2010-01-18 Thread Ivan Calandra
Thank you for your answer. I guess I was too lazy! Ivan Duncan Murdoch a écrit : On 18/01/2010 8:32 AM, Ivan Calandra wrote: Hi Everybody! I have a simple question: I would like to know the keyboard shortcut to run a script in R (Run all). I already know the CTRL+R but it doesn't run the

Re: [R] Comparing dates in dataframes

2010-01-18 Thread James Rome
I finally figured this out with the help of Dave and Dennis. The steps I had to do were 1. Convert dates to POSIXlt 2. Create a column in each frame that was paste(date, quarter) 3. Then %in% worked instantly. gw = c(length(arr)) gw[1:length(arr[,1])]=FALSE arr[gw]=gw # put a column of 0s

Re: [R] lattice and legend

2010-01-18 Thread robert-mcfadden
Thank you very much. In an example given by you it sufficient to add: par.settings = simpleTheme(col = my.col) Maybe someone else find it helpful. library(lattice) my.col= c(red,green) barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), col= my.col,

Re: [R] column selection for aggregate()

2010-01-18 Thread b k
On Mon, Jan 18, 2010 at 9:53 AM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Hi everybody! I'm working on R today so I have a lot of questions (you may have noticed that it's the 3rd email today). I'm new on R, so please excuse the spam! I have a dataset ssfa with many rows and the

[R] unique: factor to string

2010-01-18 Thread Markus Mühlbacher
Hi community, I want to count the occurrence of values within a dataframe. data$names is a list of many names. With namelist - unique(data$names) I get all the existing names. But the result is a factor, not a list of strings. I would then like to go trough all the names in a for-loop and

Re: [R] unique: factor to string

2010-01-18 Thread Dimitris Rizopoulos
do you mean you want: table(data$names) I hope it helps. Best, Dimitris Markus Mühlbacher wrote: Hi community, I want to count the occurrence of values within a dataframe. data$names is a list of many names. With namelist - unique(data$names) I get all the existing names. But the result

Re: [R] column selection for aggregate()

2010-01-18 Thread Ivan Calandra
Thanks for your answer, but it doesn't work... Here is what I get: ssfamean - aggregate(ssfa[[10:24]],ssfa[c(SPECSHOR, BONE, TO_POS, FACETTE, SHEARFAC, ENA_BA)],mean) Error in .subset2(x, i, exact = exact) : recursive indexing failed at level 2 I think I've tried everything that came to my

Re: [R] unique: factor to string

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 10:05 AM, Markus Mühlbacher wrote: Hi community, I want to count the occurrence of values within a dataframe. data$names is a list of many names. It's most likely a vector. With namelist - unique(data$names) I get all the existing names. But the result is a factor,

Re: [R] column selection for aggregate()

2010-01-18 Thread b k
On Mon, Jan 18, 2010 at 10:17 AM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: Thanks for your answer, but it doesn't work... Here is what I get: ssfamean - aggregate(ssfa[[10:24]],ssfa[c(SPECSHOR, BONE, TO_POS, FACETTE, SHEARFAC, ENA_BA)],mean) Error in .subset2(x, i, exact = exact)

Re: [R] variable name substitution

2010-01-18 Thread Duncan Murdoch
On 18/01/2010 9:02 AM, Ivan Calandra wrote: Hi everybody! I'm trying to write a script to plot a histogram, a boxplot and a qq-plot (under Windows XP, R2.10 if it matters) What I want to do: define the variables (x and y) to be used at the very beginning, so that I don't have to change all

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread Steve Sidney
David Excellent ! It its exactly what I was looking for. Two very small questions to conclude 1) I don't understand the significance of the -1 in the sq brackets. 2) Not sure I really understand how function(x)works in this context. If you can point me towards a doc that explains this in

Re: [R] column selection for aggregate()

2010-01-18 Thread Ivan Calandra
I didn't understand from the help what really does the function rowMeans but it looks like it doesn't take into account the categorical variables (I want to calculate the means when the values of all categorical variables are the same, second part of aggregate). Moreover, ssfa_num contains

Re: [R] Exporting a data.frame to excel using sqlSave - adds a character ' to values

2010-01-18 Thread Tal Galili
Thanks Dieter, Reading it back is fine, but still - I wish I could control this behavior. Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

Re: [R] variable name substitution

2010-01-18 Thread Ivan Calandra
Wonderful!! Thanks a lot! Ivan Duncan Murdoch a écrit : On 18/01/2010 9:02 AM, Ivan Calandra wrote: Hi everybody! I'm trying to write a script to plot a histogram, a boxplot and a qq-plot (under Windows XP, R2.10 if it matters) What I want to do: define the variables (x and y) to be used

Re: [R] exporting text output to pdf

2010-01-18 Thread Dimitri Shvorob
Ah, mine was not a helpful example. Text atop a picture is a special scenario, handled by title(); the goal is to produce a proper-looking PDF *document* with text and images - similar to what I could do in HTML with hwriter package. -- View this message in context:

Re: [R] function to set log(0)=0 not working on tables or vectors

2010-01-18 Thread maiya
Peter, you're right about the error - I had R commander open and used the terminal instead - this makes me miss the error messages. Not that I would have known how to solve it had I seen it :) And yes, ifelse does work. Not sure I understand what the difference is, but thanks! David, I had no

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 10:26 AM, Steve Sidney wrote: David Excellent ! It its exactly what I was looking for. Two very small questions to conclude 1) I don't understand the significance of the -1 in the sq brackets. It removes the first column from the object that is offered to apply().

[R] output

2010-01-18 Thread Ashta
Hi all, I am trying to interparete the result of the following output from lm; fit1 =lm(Feed _Intake ~ weight + season + weight*season) Season has three classes(x,y,z) Reults are Estimate (Intercept) 21.51559 weight 2.13051 factor(season)y

Re: [R] column selection for aggregate()

2010-01-18 Thread b k
On Mon, Jan 18, 2010 at 10:33 AM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: I didn't understand from the help what really does the function rowMeans but it looks like it doesn't take into account the categorical variables (I want to calculate the means when the values of all

Re: [R] exporting text output to pdf

2010-01-18 Thread David Winsemius
Perhaps you should look at what Murrell offers: http://www.jstatsoft.org/v30/i04 Or at worked examples in the Wiki: http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:display-images On Jan 18, 2010, at 10:21 AM, Dimitri Shvorob wrote: Ah, mine was not a helpful example. Text

Re: [R] column selection for aggregate()

2010-01-18 Thread Gabor Grothendieck
Try summaryBy in the doBy package. e.g. using the built-in CO2 summarize each numeric variable by each factor except for the factors Plant and Type: library(doBy) summaryBy(. ~ ., data = subset(CO2, select = - c(Plant, Type))) On Mon, Jan 18, 2010 at 9:53 AM, Ivan Calandra

Re: [R] output

2010-01-18 Thread Henrique Dallazuanna
Try this: DF$season - relevel(DF$season, 'y') fit1 - lm(Feed_Intake ~ weight + season + weight*season, data = DF) On Mon, Jan 18, 2010 at 2:00 PM, Ashta sewa...@gmail.com wrote: Hi all, I am trying to interparete  the result of the following output from  lm; fit1 =lm(Feed _Intake ~ weight +

Re: [R] column selection for aggregate()

2010-01-18 Thread Ivan Calandra
Hi! It looks like it works perfectly. However, since I cannot check whether I get the good result or not, can you please let me know if you see any mistakes? Here is the code: ssfamean - summaryBy(.~SPECSHOR+BONE+TO_POS+FACETTE+SHEARFAC+ENA_BA, data = subset(ssfa, select = - c(MEASUREM,

Re: [R] output

2010-01-18 Thread Adaikalavan Ramasamy
Season X is taken as the reference category. So the output factor(season)y 10.59739 means the feed_intake is higher by 10.59 units in Season Y _compared to_ Season X. Change your levels in season. E.g. season - factor(season, levels=c(Z, X, Y) which means that Z will be taken as the

[R] lattice and probem

2010-01-18 Thread robert-mcfadden
I have a simple chart: barchart(Counts ~ Purchase | Products , data = my.data, groups = Model) where Purchase in data has values {0,1,2,3...10}. In a chart xlab begins with 1 not 0. How to change it? Best, Robert __ R-help@r-project.org mailing

Re: [R] Choose every second value

2010-01-18 Thread Greg Snow
In addition to the other suggestions, you can use logical subsetting with autoreplication: x - 1:6 x[ c(T,F) ] [1] 1 3 5 x[ c(F,T) ] [1] 2 4 6 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message-

Re: [R] lattice and probem

2010-01-18 Thread Peter Ehlers
robert-mcfad...@o2.pl wrote: I have a simple chart: barchart(Counts ~ Purchase | Products , data = my.data, groups = Model) where Purchase in data has values {0,1,2,3...10}. In a chart xlab begins with 1 not 0. How to change it? I guess that barchart() will coerce Purchase to be a factor

Re: [R] lattice and probem

2010-01-18 Thread Peter Ehlers
Slight correction below. (Mother always said I needed to learn to count.) Peter Ehlers wrote: robert-mcfad...@o2.pl wrote: I have a simple chart: barchart(Counts ~ Purchase | Products , data = my.data, groups = Model) where Purchase in data has values {0,1,2,3...10}. In a chart xlab

[R] get the ranks for arrays

2010-01-18 Thread rusers.sh
Hello, 'rank' function seems to be only for vectors, but i need to get the ranks for 3-dimensional arrays. See problems below. #Example Data a1-array(1:12,c(2,3,2)); a2-array(2,c(2,3,2)); a3-array(0,c(2,3,2)) a1 , , 1 [,1] [,2] [,3] [1,]135 [2,]246 , , 2

Re: [R] exporting text output to pdf

2010-01-18 Thread Dimitri Shvorob
Nothing relevant, as far as I can tell :( Putting text into a PDF document in R appears to be a cumbersome exercise. -- View this message in context: http://n4.nabble.com/exporting-text-output-to-pdf-tp837699p1016808.html Sent from the R help mailing list archive at Nabble.com.

[R] high precision numbers

2010-01-18 Thread kayj
Hi All, I need to sum a large number of extremely small numbers. These small number are a result of an expression that I wrote using R but the sum of these numbers is incorrect because the numbers perhaps get truncated. How van I make sure that R us summing the numbers without rounding or

Re: [R] exporting text output to pdf

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 11:41 AM, Dimitri Shvorob wrote: Nothing relevant, as far as I can tell :( Putting text into a PDF document in R appears to be a cumbersome exercise. You might get more specific ideas if your were in turn more specific. Offer an example that sends output to a

[R] permutations from vectors out of a matrix

2010-01-18 Thread Etienne Stockhausen
Dear R-Users, I'm relativley new to R and have the following problem. I need all permutations of the vectors created by the collumns of a matrix. I will give a small example: p=3 n=2^p-1 #number of obtainable

Re: [R] exporting text output to pdf

2010-01-18 Thread Ista Zahn
You may as well go all the way and use Sweave. See http://www.stat.umn.edu/~charlie/Sweave/ for examples. -Ista On Mon, Jan 18, 2010 at 4:41 PM, Dimitri Shvorob dimitri.shvo...@gmail.com wrote: Nothing relevant, as far as I can tell :( Putting text into a PDF document in R appears to be a

Re: [R] column selection for aggregate()

2010-01-18 Thread Gabor Grothendieck
It looks ok except you have both specified the wanted factors and removed the undesired factors from the data frame. You only need to do one of these as in the example I gave, not both, so the solution could be simpler. On Mon, Jan 18, 2010 at 11:19 AM, Ivan Calandra ivan.calan...@uni-hamburg.de

[R] problem of data manipulation

2010-01-18 Thread rusers.sh
Hello, See my problem below. a-data.frame(c(s,c,c,n,n,n),c(rep(1,3),rep(2,3)),c(rep(2,3),rep(1,3)),c(01/01/1999,10/02/2000,13/02/2000,11/02/2000,15/02/2000,23/02/2000)) colnames(a)-c(var1,var2,var3,var4) a var1 var2 var3 var4 1s1201/01/1999 2c1210/02/2000

Re: [R] Can an object reference itself?

2010-01-18 Thread Janko Thyson
Hadley, thanks for your comment. What you're saying is true, of course, and possibly I did not really chose the best header to describe the actual issue I was addressing. However, in the help archive I found something that gets me what I want (calling a certain slot function without having to

[R] Rotating pca scores

2010-01-18 Thread francesca . iordan
Dear Folks I need to rotate PCA loadings and scores using R. I have run a pca using princomp and I have rotated PCA results with varimax. Using varimax R gives me back just rotated PC loadings without rotated PC scores. Does anybody know how I can obtain/calculate rotated PC scores with R?

Re: [R] exporting text output to pdf

2010-01-18 Thread Dimitri Shvorob
Let's revisit my fist post How can I get a normal-font-sized 'Hello world' displayed on a page, with a plot underneath, instead of a giant 'Hello world' on one page, and a plot on another? Then The goal is to produce a proper-looking PDF *document* with text and images - similar to what I

Re: [R] advice/opinion on - vs = in teaching R

2010-01-18 Thread Thomas Lumley
On Mon, 18 Jan 2010, S Ellison wrote: Thomas Lumley tlum...@u.washington.edu 15/01/2010 16:07 Which should I use or does it matter, please? I would say to use = if you are teaching people familiar with C or Java, and to use - otherwise. Nothing like an option to induce polarisation!

Re: [R] output

2010-01-18 Thread Ashta
Hi all, I have a data set such that the response variable size binary (Short or Long) Color has two classes (red and green) red=1 ; green=0 Lm1 - glm(size ~color, data =test, family = binomial()) Estimate Std. Errorz value (Intercept) 12.0523.11037-12.273

Re: [R] Help using Cast (Text) Version

2010-01-18 Thread hadley wickham
If you can point me towards a doc that explains this in simple terms I would be obliged. Don't expect you to have to provide the answer. Any of the introductory texts should explain the various forms of indexing and the use of the apply family of functions. They are both central to effective

Re: [R] How to convert character matrix or data.frame to numeric?

2010-01-18 Thread hadley wickham
Ouch!   Hmmm.   From the Value section of the apply docs... If each call to FUN returns a vector of length n, then apply returns an array of dimension c(n, dim(X)[MARGIN]) if n 1.  Since I set MARGIN to 1, then I was operating on rows where n  is 3. c(n, dim(X)[MARGIN]) [1] 3 2 How about

Re: [R] exporting text output to pdf

2010-01-18 Thread Thomas S. Dye
If you use emacs, then another alternative is Org-babel, which allows you to mix and match languages. Using the literate programming paradigm, Org-babel will tangle your hwriter code snippets and expand references to any R-code that you want to embed within them. I use Org-babel to combine

Re: [R] problem of data manipulation

2010-01-18 Thread Bert Gunter
One way to do it: 1. Convert your date column to the Date class using the as.Date() function. This allows you to do the necessary arithmetic on the dates below. dt - as.Date(a[,4],%d/%m/%Y) 2. Create a factor out of your first three columns whose levels are in the same order as the unique rows.

[R] R jobs keep hanging linux server despite mem.limits modifcations

2010-01-18 Thread Nathan Stephens
My group is working with datasets between 100 Mb and 1 GB in size, using multiple log ins. From the documentation, it appears that vsize is limited to 2^30-1, which tends to prove too restrictive for our use. When we drop that restriction (set vsize = NA) we end up hanging the server, which

[R] Rotating pca scores

2010-01-18 Thread francesca iordan
Dear Folks I need to rotate PCA loadings and scores using R. I have run a pca using princomp and I have rotated PCA results with varimax. Using varimax R gives me back just rotated PC loadings without rotated PC scores. Does anybody know how I can obtain/calculate rotated PC scores with R?

Re: [R] exporting text output to pdf

2010-01-18 Thread David Winsemius
On Jan 18, 2010, at 1:33 PM, Dimitri Shvorob wrote: Let's revisit my fist post How can I get a normal-font-sized 'Hello world' displayed on a page, with a plot underneath, instead of a giant 'Hello world' on one page, and a plot on another? I suggested that you look at the wiki and

Re: [R] problem of data manipulation

2010-01-18 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Monday, January 18, 2010 11:54 AM To: 'rusers.sh'; r-help@r-project.org Subject: Re: [R] problem of data manipulation One way to do it: 1. Convert your

[R] An argument processing puzzle.

2010-01-18 Thread Rolf Turner
I have been trying to write a function mv(a,b) to move an object a to object b. It returns no value, but only exists for this side effect. Basically it just does b - a; rm(a). With some checking and prompting about over-writing. The thing is, I'd like to be able to use either call by name or

Re: [R] problem of data manipulation

2010-01-18 Thread Bert Gunter
Absolutely... so long as you assume the dates are in order -- or at least that the earliest date of a group appears first. -- Bert -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap Sent: Monday, January 18, 2010

Re: [R] problem of data manipulation

2010-01-18 Thread William Dunlap
-Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] Sent: Monday, January 18, 2010 12:32 PM To: William Dunlap; 'rusers.sh'; r-help@r-project.org Subject: RE: [R] problem of data manipulation Absolutely... so long as you assume the dates are in order -- or at

[R] Problem extracting from mer objects

2010-01-18 Thread Chris Ramsborg
I am having a problem extracting from mer objects.    I have constructed my problem using existing datasets.   Using the following commands:   require(lme4) fm1 - lmer(Yield ~ 1 + (1 | Batch), Dyestuff) fixef(fm1) I get the following error message: Error in UseMethod(fixef) : no applicable

Re: [R] problem of data manipulation

2010-01-18 Thread rusers.sh
Thank you so much. I got it. 2010/1/18 William Dunlap wdun...@tibco.com -Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] Sent: Monday, January 18, 2010 12:32 PM To: William Dunlap; 'rusers.sh'; r-help@r-project.org Subject: RE: [R] problem of data

[R] RFE: bQuote like sQuote

2010-01-18 Thread Jack Tanner
I'm writing SQL queries, and it's very handy to be able to use sQuote for string parameter values. It makes me wish that I could use an sQuote-like function for enclosing column names and other identifiers in backticks, i.e., select `foo` from `table`. Obviously I can do this with paste(), I'm

  1   2   >