[R] Rscript on Mac : specify R64 over R (32-bit version)

2013-01-16 Thread Matthew Pettis
Hi, I have both R and R64 installed on Mac OSX 10.8 Mountain Lion (64-bit). When I run the command sessionInfo() from within Rscript, I get: R version 2.15.2 (2012-10-26) Platform: i386-apple-darwin9.8.0/i386 (32-bit) Is there a way to make Rscript point at the R64 rather than R (32-bit)? Th

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Matthew Pettis
do apt-key adv --recv-key --keyserver keyserver.ubuntu.comB725097B3ACC3965 > sudo apt-get update > sudo apt-get install sun-java6-jdk sun-java6-plugin > > Then run: > > > sudo apt-get install r-base r-base-dev > sudo R CMD javareconf > > Cheers, > > Gavin. > >

[R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Matthew Pettis
Hi, I'm trying to install R from an rpm locally to my account (the reason I'm not doing it through yast/yast2/zypper is that the sys admin isn't yet willing to install it, and doesn't want to support it, but will help me support it if I install it locally -- in short, policy problems rather than t

Re: [R] Converting data.frame from long to wide format

2010-12-08 Thread Matthew Pettis
ames='z',direction='wide') >> > y z.A z.B z.C > 1 D a b c > 4 E d e f > 7 F g h i > >- Phil Spector > Statistical Computing Facility > Departmen

Re: [R] Converting data.frame from long to wide format

2010-12-08 Thread Matthew Pettis
att, > > library(reshape2) > wide.df <- dcast(df, y ~ x) > > Works great for me. > > Jonathan > > > On Wed, Dec 8, 2010 at 7:26 PM, Matthew Pettis > wrote: > > Hi, > > > > I was wondering if there is an easy way that I am missing for turning a > lo

[R] Converting data.frame from long to wide format

2010-12-08 Thread Matthew Pettis
Hi, I was wondering if there is an easy way that I am missing for turning a long dataframe into a wide one. Below is sample code that will make what I have and, in comments, the form of what I want: # Have: dataframe like 'df' df <- expand.grid( x=LETTERS[1:3], y=LETTERS[4:6]) df$z <- lett

Re: [R] Controlling print width settings for 'print' on command line

2010-12-06 Thread Matthew Pettis
ment of options() see: > > ?options > > I believe it is 80 by default, so something like: > > options(width = 160) > > might be about right. > > Cheers, > > Josh > > On Mon, Dec 6, 2010 at 9:48 PM, Matthew Pettis > wrote: > > Hi, > > > &

[R] Controlling print width settings for 'print' on command line

2010-12-06 Thread Matthew Pettis
Hi, I'm using R interactively from a PuTTy command line, and when I print a dataframe (default, but just entering the name of the data frame), the display is using only half of the available horizontal width in which to print columns. How to I tell R how many columns it can/should use for printin

Re: [R] Need help Upgrading to R version >=v2.11 on Ubuntu Hardy Heron (8.04 LTS)

2010-12-06 Thread Matthew Pettis
Sorry, solved by me RTFM... The directions pertaining to what I needed to do are found here: http://cran.r-project.org/bin/linux/ubuntu/ Sorry to bother y'all, Matt On Mon, Dec 6, 2010 at 10:57 PM, Matthew Pettis wrote: > Hi, > > I'd like to use ggplot2, which I think w

[R] Need help Upgrading to R version >=v2.11 on Ubuntu Hardy Heron (8.04 LTS)

2010-12-06 Thread Matthew Pettis
Hi, I'd like to use ggplot2, which I think works best on some R release >=v2.11 or so. However, with Ubuntu Hardy Heron 8.04 LTS, 'aptitude' packages show me only a version for 2.6. Can I install more recent version on this Ubuntu version, and if so, what is the most painless way to do this (is

Re: [R] Printing data.frame data: alternatives to print?

2010-10-29 Thread Matthew Pettis
inor B > 7 Maj III Minor B > 8 Maj III Minor C > 9 Maj III Minor C >> df[!duplicated(df),] >       f1      f2 > 1   Maj I Minor A > 4  Maj II Minor A > 5  Maj II Minor B > 7 Maj III Minor B > 8 Maj III Minor C >> > > > On Fri, Oct 29, 2010 at 9:53 AM,

[R] Printing data.frame data: alternatives to print?

2010-10-29 Thread Matthew Pettis
Hi, I have a data frame with two factors (well, more, but 2 for simple consideration), and I want to display the different combinations of the them that actually occur in the data. In reality, there are too many of them to do to do a 'table' call and have one col vertical and one col horizontal (

[R] ggplot2: facet_grid with only one level does not display the graph with the facet_grid level in title

2010-10-28 Thread Matthew Pettis
Hi All, Here is the code that I'll be referring to: p <- ggplot(wastran.data, aes(PER_KEY, EVENTS)) (p <- p + facet_grid( pool.short ~ .) + stat_summary(aes(y=EVENTS), fun.y = sum, geom="line") + opts(axis.text.x = theme_text(angle = 90, hjust=1), title="Events (15min.) vs. Time: Face

Re: [R] dataframe, transform, strsplit

2010-10-25 Thread Matthew Pettis
way I think it should... Thank you both again, Matt On Mon, Oct 25, 2010 at 12:09 PM, Gabor Grothendieck < ggrothendi...@gmail.com> wrote: > On Mon, Oct 25, 2010 at 12:53 PM, Matthew Pettis > wrote: > > Hi, > > > > I have a dataframe that has a column of vectors t

[R] dataframe, transform, strsplit

2010-10-25 Thread Matthew Pettis
Hi, I have a dataframe that has a column of vectors that I need to extract off the character string before the first '.' character and put it into a separate column. I thought I could use 'strsplit' for it within 'transform', but I can't seem to get the right invocation. Here is a sample datafra

Re: [R] POSIXct: Extract the hour for a list of elements

2010-09-24 Thread Matthew Pettis
- Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.b

[R] POSIXct: Extract the hour for a list of elements

2010-09-24 Thread Matthew Pettis
Hi, I have a list/data.frame 'pk' of POSIXct dates, and I'd like to extract the hour for each row. I know that if I have an individual POSIXct object, I can extract the hour by converting to a new object with: new.lt <- as.POSIXlt() new.lt$hour But I can't figure out how to apply this for a lis

[R] Barchart in lattice package: controlling order of bars in plot and color of a selected bar

2009-01-16 Thread Matthew Pettis
Hi, I'm using the lattice function 'barchart' to make a series of 4 histograms. Currently, the y-axis values are graphed in order of the y-axis variable. I'd like to have the y-axis values sorted in ascending order of the x-axis values so that the longest bar horizontally is on top of the graph

Re: [R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
Thank you very much -- this was very helpful for differentiating among the aggregating methods! Matt On Wed, Jan 14, 2009 at 3:42 PM, Marc Schwartz wrote: > on 01/14/2009 02:51 PM Matthew Pettis wrote: >> I have a specific question and a general question. >> >> Specific Q

[R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used to being able to take a data set and have the output of

[R] Casting lists to data.frames, analog to SAS

2009-01-14 Thread Matthew Pettis
I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used to being able to take a data set and have the output of th

[R] How can I easily rbind a list of data frames into one data frame?

2008-09-26 Thread Matthew Pettis
Hi, I have a list output from the 'lapply' function where the value of each element of a list is a data frame (each data frame in the list has the same column types). How can I rbind all of the list entry values into one data frame? Thanks, Matt -- It is from the wellspring of our despair and

Re: [R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread Matthew Pettis
t; x$rank <- ave(x$V3, x$V1, x$V2, FUN=rank) >> x > V1 V2 V3 rank > 1 a w 2002 > 2 a w 1001 > 3 b w 5002 > 4 b w 2001 > 5 b z 3001 > 6 b z 4002 >> > > > On Fri, Sep 26, 2008 at 4:54 PM, Matthew Pettis > <

[R] Newbie: Ranking a data frame, grouped by 2 or more columns

2008-09-26 Thread Matthew Pettis
Hi, I'd like to rank obs in a data frame as subset by 2 or more columns... The example input would look like the following: ++++ x y v -- -- -- a w 200 a w 100 b w 500 b w 200 b z 300 b z 400 ++++ And the data frame I want to create i

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Thanks to Peter and Phil, this was indeed my idea. On Thu, Sep 25, 2008 at 2:26 PM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Matthew Pettis wrote: >> >> Hi, >> >> I want to sort a data frame by multiple columns and then take the >> first record in each u

[R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the "by" group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken th

Re: [R] print.data.frame : row.name = FALSE not having intended effect

2008-09-23 Thread Matthew Pettis
sking Ubuntu questions on the R list, but actually, right now, it looks like ubuntuforums is having website issues...) thanks, Matt On Tue, Sep 23, 2008 at 9:22 PM, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote: > > On 23 September 2008 at 20:55, Matthew Pettis wrote: > | Never mind --

Re: [R] print.data.frame : row.name = FALSE not having intended effect

2008-09-23 Thread Matthew Pettis
.x, otherwise I have to build it from scratch... Unless you know of a repository of binaries that has v2.7.x? Thanks, Matt On Tue, Sep 23, 2008 at 9:08 PM, Rolf Turner <[EMAIL PROTECTED]> wrote: > > On 24/09/2008, at 1:55 PM, Matthew Pettis wrote: > >> Never mind -- the

Re: [R] print.data.frame : row.name = FALSE not having intended effect

2008-09-23 Thread Matthew Pettis
2 just yet? Thanks, Matt On Tue, Sep 23, 2008 at 8:49 PM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Hi, > > Does anybody know if row.name = FALSE actually works in v2.6.2? > Because it isn't working for me... here

[R] print.data.frame : row.name = FALSE not having intended effect

2008-09-23 Thread Matthew Pettis
Hi, Does anybody know if row.name = FALSE actually works in v2.6.2? Because it isn't working for me... here is some sample code and output: ++++++++++ > print(x,row.names = FALSE) party_abbr candidate_name votes_candidate 2 DFLAMY K

[R] Newbie: Formatting numbers with commas

2008-09-22 Thread Matthew Pettis
Hi, Search through the R archives, and couldn't find my answer... how do you format numbers with commas (standard American, one every three digits)? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas _

Re: [R] Hmisc and Ubuntu (aptitude install)

2008-09-22 Thread Matthew Pettis
l have a lot of shared object tweaking. Matt On Mon, Sep 22, 2008 at 1:22 PM, Matthew Pettis <[EMAIL PROTECTED]> wrote: > Thank You All, > > I think all of this may have been due to shared library conflict > headaches. At one point, I inadvertently upgraded my Perl install to >

Re: [R] Hmisc and Ubuntu (aptitude install)

2008-09-22 Thread Matthew Pettis
ely correct on the need for > r-base-dev. > > Dirk > >> >> Vincent >> >> Le lun. 22 sept. à 00:08, Matthew Pettis a écrit : >> >>> Hi, >>> >>> I'm trying to get the Hmisc module on my Ubuntu Hardy Heron install. >>>

[R] Hmisc and Ubuntu (aptitude install)

2008-09-21 Thread Matthew Pettis
Hi, I'm trying to get the Hmisc module on my Ubuntu Hardy Heron install. I tried getting Hmisc from within R by issuing the standard 'install.packages' command, but it said I needed 'gfortran' to compile. I thought I could circumvent this by using 'aptitude' to get the package 'r-cran-hmisc', but

Re: [R] Reporting with down and across variables

2008-09-18 Thread Matthew Pettis
It does, thanks! Did I miss in the documentation that the variable has to be named 'value'? On Thu, Sep 18, 2008 at 10:08 AM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Thu, Sep 18, 2008 at 10:03 AM, Matthew Pettis > <[EMAIL PROTECTED]> wrote: >> [Rep

[R] Reporting with down and across variables

2008-09-18 Thread Matthew Pettis
[Reposting with changed example] Hi, I want to take the dataframe df generated below and reshape the data with column names being w, x, y, and the different levels of z. The values under the different levels of z are the corresponding values of r. I've tried reshape and cast, and I can't seem to

[R] Fwd: Reporting with down and across variables

2008-09-18 Thread Matthew Pettis
[Reposting with changed example and font spec removed] Hi, I want to take the dataframe df generated below and reshape the data with column names being w, x, y, and the different levels of z. The values under the different levels of z are the corresponding values of r. I've tried reshape and cas

[R] Reporting with down and across variables

2008-09-17 Thread Matthew Pettis
Hi, I have a dataframe like the following: xfact yfact zfact response --- --- --- -- x1 y1 z1 r1 x1 y1 z2 r2 ... I want output that looks like: ___ zfac levels___ xfact yfact z1 z2 ... zn ---

[R] Newbie: 'table' output in columns rather than matrix

2008-09-11 Thread Matthew Pettis
Hi, Coming to R from SAS... I have a data.frame A with 2 long factors "x" and "y". I want to get a count of the number of rows with each level of "x" and "y" jointly. 'table' seemed like it would work, but as I have many levels, the matrix output is pretty useless to me (and I don't care about z