Sorry about omitting library(plyr).
It's really thanks to Hadley, of course. His contributions make us all (capable
of being) better.
Eric
- Original message -
From: Michael Friendly
To: rmail...@justemail.net, r-help@r-project.org
Subject: Re: extracting non-NA entries from a two-way f
Perhaps this?
library(reshape2)
library(stringr)
GeisslerLong <- melt (Geissler, id.vars = c("boys"))
GeisslerLong <- transform ( GeisslerLong, girls = as.numeric ( str_replace(
variable, "g", '' )) )
GeisslerLong <- rename ( GeisslerLong, c( value = "Freq"))
GeisslerLong <- arrange ( GeisslerLo
Untested code below
- Original message -
From: ramoss
To: r-help@r-project.org
Subject: [R] Merging data in R compared to SAS
Date: Wed, 22 Aug 2012 07:59:04 -0700 (PDT)
Hello,
I am a SAS user new to R. What is the R equivalent to following SAS
statements:
1) data all;
merge test
This is how I get a whole SPSS data files into R. You specifically asked about
the codebook, so this may not be exactly what you are after.
spssFileInfo <- spss.system.file ( file = "path to my SPSS file" )
spssDataSet <- as.data.set ( spssFileInfo)
spssDataFrame <- as.data.frame ( spssDataSet
Or, you can do it the lazy way...
Download spss errr... pspp at http://www.gnu.org/software/pspp/ and run
the spss code in which somebody else already figured all that out,
to create an spss file. Then use one of the spss importing
libraries. Lately I've become partial to memisc, but there are s
What am I missing about your inquiry: It seems like x[ , colName ] should work:
testDFcols <- function(x = data.df, select=c(1:ncol(x)), bar=TRUE) {
if(bar) cat("##\n");
for (column in select) {
colName <-names(x)[column]
cat("Column Name(", c
I also have a problem using odfWeave on Windows XP with R > R2.11.1. odfWeave
fails, giving mysterious error messages. (Not quite the same as yours, but
similar. I sent the info to Max Kuhn privately, but did not get a response
after two tries.) My odfWeave reporting system worked fine prior to
Is this what you are looking for?
ddply ( .variables = c("grp1", "grp2", "grp3" ), .data = df, .fun =
plyr::summarize, abmin = min(c(a, b, c) ), abmax = max ( c ( a, b, c) ) )
- Original message -
From: "Liviu Andronic"
To: "r-help@r-project.org Help"
Date: Thu, 7 Apr 2011 18:39:30 +
I tried with no spaces in either file name and got the same error.
- Original message -
From: "Max Kuhn"
To: rmail...@justemail.net
Cc: r-help@r-project.org
Date: Mon, 21 Mar 2011 17:04:40 -0400
Subject: Re: [R] odfWeave Error unzipping file in Win 7
I don't think that this is the issu
I have a very similar error that cropped up when I upgraded to R 2.12 and
persists at R 2.12.1. I am running R on Windows XP and OO is at version 3.2. I
did not make any changes to my R code or ODF code or configuration to produce
this error. Only upgraded R.
Many Thanks,
Eric
R session:
>
You may also wish to check out the PMML approach. Check out the PMML package.
eRic
- Original message -
From: "Liaw, Andy"
To: "Larry D'Agostino" , "r-help"
Date: Fri, 9 Apr 2010 15:15:11 -0400
Subject: Re: [R] Question on implementing Random Forests scoring
From: Larry D'Agostino
>
My preferred solution would be to use the select option of the subset function.
> data ( iris )
> names ( iris )
[1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
# KEEP-like way
> iris_subset_by_keep <- subset ( iris, select = c( "Sepal.Length", "Species" )
> )
#
?subset
- Original message -
From: "frenchcr"
To: r-help@r-project.org
Date: Fri, 13 Nov 2009 11:32:35 -0800 (PST)
Subject: [R] cleanse columns and unwanted rows
hello folks,
Im trying to clean out a large file with data i dont need.
The column im manipulating in the file is called
Cedrick is correct. I was referring to the command invoked by entering the
string "screen" at the shell prompt.
- Original message -
From: "Cedrick W. Johnson"
To: "Peng Yu"
Cc: r-help@r-project.org
Date: Tue, 10 Nov 2009 16:38:09 -0500
Subject: Re: [R] R process gets killed spontaneo
This was happening to me on Red Hat Linux when I was running huge jobs within a
screen session. By any chance are your R processes running within a screen
session? (screen is a very nice program that will keep your sessions alive
after you log out, but it was killing off my big memory jobs for u
What you're really saying is that you don't care about the distinction between
"aa", "bb" and "cc". In that case, a different arrangement of the data will be
more useful:
library (reshape )
df.melt <- melt ( df, id.var = "dd")
with ( df.melt, table ( dd, value ) )
Eric
- Original messag
How about:
tst.long <- melt ( tst, id.vars = c("K1", "K2", "K3"), variable_name = "V" )
tst2 <- transform ( tst.long, K23Vx = paste ( K2, K3, V, sep = ".") )
tst.wide <- cast ( tst2 , K1 ~ K23Vx )
tst.wide
> tst.wide
K1 D.a.V1 D.a.V2 D.a.V3 D.b.V1 D.b.V2 D.b.V3 E.a.V1 E.a.V2 E.a.V3 E.b.V1
That you have non-unique rows in your data (as identified by the identifying
variables).
- Original message -
From: "Mark Knecht"
To: "r-help"
Date: Wed, 8 Jul 2009 12:41:28 -0700
Subject: [R] What is cast telling me?
Hi,
What is cast telling me when it says the following?
Aggre
Now that we know what egen is, the answers are one-liners in R:
# Make up some data
vasdat <- matrix ( sample ( 1:100, 3000, replace = TRUE ), ncol = 3 )
# Use apply for each ( MARGIN = 1 means rows, 2 means columns )
anycountresult <- apply ( vasdat, MARGIN = 1, FUN = function ( x ) sum ( x %in%
Another possibility is to transpose and use functions that assume the grouping
is by rows, such as summaryBy in the doBy library. If you can easily work with
your data this way, the code might be more clear.
> library ( doBy )
> databyrows <- rbind ( c ( 2, 2, 3, 4, 4, 4, 5, 5, 6), c(1, 1, 2
Here is a solution using doBy and Gabor's DF2 created below:
library( doBy )
newrows <- summaryBy ( myNum1 + myNum2 + myNum3 ~ myType , DF2, keep.names =
TRUE )
newrows[,"myID"] <- "+"
rbind ( DF2, newrows)
- Original message -
From: "Gabor Grothendieck" <[EMAIL PROTECTED]>
To: "F
Do ?position_jitter
You will see why the error message "unused arguments" is happening in your
example.
- Original message -
From: "Juliet Hannah" <[EMAIL PROTECTED]>
To: r-help@r-project.org
Date: Wed, 19 Nov 2008 18:34:36 -0500
Subject: [R] ggplot2; dot plot, jitter, and error bars
W
I have written some functions that I have now collected into a package. Of
course, there are revisions and additions.
I started by creating a skeleton with package.skeleton. I read and deleted the
read and delete me file. I edited the DESCRIPTION file appropriately. I can use
the package once
In the change log of ggplot2, version 0.7, I find this:
"* scales: any point outside of limits is dropped (this was previously the
behaviour for discrete scales, but not continuous scales)"
and that makes sense for some applications. But what about if I
want to summarize the data with a smooth
It's hard to read your table, but I think this could be your problem:
daylength = "long.day" is always TRUE
Testing for equality uses "==" so
daylength == "long.day" may or may not always be TRUE
- Original message -
From: "Josh B" <[EMAIL PROTECTED]>
To: "R Help"
Date: Mon, 29 Sep 20
Not an answer, but, I hope, more of an almost-the-same question...
I want to divide up the text grobs for the key labels into two
different (text) grobs (each) and put them back into the space occupied
by the original text grob. I've worked with grobs enough to think this
should be easy, but I
I have a more complicated function I am trying to write, but I run in to a
problem when I want to
add something to the plot from more than one data set while simultaneously
controlling the
appearance of the additional layer.
# Toy data:
foo <- data.frame ( x = 1:4, y = 4:1 , membership = c(
27 matches
Mail list logo