number of unique
parks for each project. If I using the standard table(df$PROJECT) it
reports:
A 3
B 2
C 2
...
where I need it to ignore duplicates and report:
A 2
B 2
C 2
...
Anyone have any suggestions on how to do this within the R paradigm?
Walte
matrix of each project/census block
combination and only providing me a true/false indication. Is there
any way to replicate the process from ArcInfo that I outlined above
within R?
Walter Anderson
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
iQIcBAEBAgAGBQJVFWYWAAoJEHfnxjvhypCiMc8P/2Dsja+h4RK
d you don't
need the dd$ in the arguments to subset().
But those don't explain your result given the information provided.
Please provide more information.
Sarah
On Mon, Jan 6, 2014 at 12:06 PM, Walter Anderson wrote:
I have a data frame that I am extracting some records from and notice
I have a data frame that I am extracting some records from and noticed
the following issue
I originally used tmp <- subset(dd, dd$EVYEAR==2012 & dd$EVMONTH=='02')
and noticed that I wasn't ending up with all of the records I should
have; however, when I used
tmp <- dd[dd$EVYEAR==2012 & dd$EV
Petr,
Thank you for you assistance. Particularly this last bit. It really
helped me understand exactly how your solution worked and why I was
confused by rapply processing rows. It was apply that could process
rows (and/or columns) of a matrix,
Anyway for anyone who wants the version of my
Karen,
Thank you for your reply. That approach makes the code for determining
preference much clearer. Unfortunately, it appears I am still needing
to use a for loop to process each row.
For any who find these posts and may have similar questions, I am
including my current code and sample da
ot;,"Option 2","Option 3"))
>
> Then make the object matrix without first column
>
> sr<-survey.results[,-1]
>
> sr<-as.matrix(sr)
>
> Elaborate evaluation function
>
> fff <- function(x) names(which.max(table(x)))
>
> Apply function to
hing else
}
used as
> q1a.ans(1:3)
[1] 1 2 0
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: Walter Anderson [mailto:wandrso...@gmail.com]
Sent: Friday, December 06, 2013 9:58 AM
To: William Dunlap; r-help@r-project.org
Subject: Re: [R]
On 12/06/2013 10:43 AM, William Dunlap wrote:
I have been researching and it appears that I should be using the sapply
function to apply the evaluate.question function above to each row in
the data frame like this
Read the documentation more closely: sapply(dataFrame, func)
applies func() to eac
Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Walter Anderson
Sent: Friday, December 06, 2013 4:44 PM
To: r-help@r-project.org
Subject: [R] Need help figuring out sapply (and similar functions) with
multiple parameter user defined f
I am having trouble understanding how to use sapply (or similar
functions) with a user defined function with multiple parameters.
I have the following functions defined
q1.ans <- function(x)
{
retVal = 0
if (x == 1) {
retVal = 1
} else if (x ==2) {
I have the following code and data
data.csv
"","Goal","Frequency","Weight","Group"
"1","Move",13,0.245283018867925,"Public"
"2","Create",10,0.188679245283019,"Public"
"3","Strengthen",30,0.566037735849057,"Public"
"4","Move",6,0.6,"Board"
"5","Create",0,0,"Board"
"6","Strengthen",4,0.4,"Board"
"
On 08/13/2013 11:41 AM, Siraaj Khandkar wrote:
On 08/13/2013 12:17 PM, Walter Anderson wrote:
I have to process a set of survey data with questions that are formatted
like this;
1) Pick your top three breeds (pick 3)
1 Rottweiler
2 Pit Bull
3 German Shepard
4 Poodle
5 Border
I have a set of survey data where I have answers to identify preference
of three categories using three questions
1) a or b?
2) b or c?
3) a or c?
and want to obtain weights for each of the preferences
something like X(a) + Y(b) + Z(c) = 100%
I am at a loss how how to calculate this from the
I have to process a set of survey data with questions that are formatted
like this;
1) Pick your top three breeds (pick 3)
1 Rottweiler
2 Pit Bull
3 German Shepard
4 Poodle
5 Border Collie
6 Dalmation
7 Mixed Breed
and the answers are formatted like this:
Respondent, Question1
1,
On 03/17/2012 12:53 AM, Jeff Newmiller wrote:
for(indx in 1:(length(bin.05)-3))
>>> if ((bin.05[indx] == test.pattern[1])&& (bin.05[indx+1] ==
>>> test.pattern[2])&& (bin.05[indx+2] == test.pattern[3]))
>>> return.values$count.match.pattern[1] =
>>> return.values$coun
ives.
Sarah
On Fri, Mar 16, 2012 at 12:59 PM, Walter Anderson wrote:
I am working on a simulation where I need to count the number of matches for
an arbitrary pattern in a large sequence of binomial factors. My current
code is
for(indx in 1:(length(bin.05)-3))
if ((bin.05[indx] == test
age-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Walter Anderson
Sent: Friday, March 16, 2012 10:00 AM
To: R Help
Subject: [R] Faster way to implement this search?
I am working on a simulation where I need to count the number of matches
for an arbitrary
better (more "R" way of achieving the same answer?
Walter Anderson
__
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 provid
I needed to compute a complicated cross tabulation to show weighted means
and standard deviations and the only method I could get that worked uses a
series of nested for next loops. I know that there must be a better way to
do so, but could use some assistance pointing the way.
Here is my working
y suggestions?
Walter Anderson
__
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.
esn't make use of any of the R
features. Does anyone have any suggestions for how they would implement
this analysis in R?
Walter Anderson
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
I have cobbled together the following logic. It works but is very
slow. I'm sure that there must be a better r-specific way to implement
this kind of thing, but have been unable to find/understand one. Any
help would be appreciated.
hh.sub <- households[c("HOUSEID","HHFAMINC")]
for (indx i
Hello,
I need to regress data like the example below. The data points
represent friction factors derived from observed trip length data. The
function used to describe this data is a gamma function of the form,
f(t) = a * t^b * e^(c*t) and I need to regress the data to obtain the
a,b, and
24 matches
Mail list logo