Displaying 20 results from an estimated 200 matches similar to: "code rows depending on the value of other rows in multilevel dataframe"
2010 Jun 21
2
Return value associated with a factor
I am using the code below to extract census tract information.
save.tract$state, save.tract$county and save.tract$tract are returned as
factors. In the last three statements, I need to save the actual value of
the factor, but, instead, the code is yielding the position of the factor.
How do I instead return the value of the factor?
By way of example, for Lon=-82.49574 and Lat=29.71495, the code
2010 Nov 02
1
Using data( ) in a loop
I'm trying to generate 50+ graphs using the UScensus2000tract data. I
need to access the data for just about all of the states, so I was
hoping to create a simple loop that will take the relevant state from my
data and load the associated census data from the UScensus2000tract
package. Below is a sample of what I'm trying to do. Any suggestions
are much appreciated.
2018 Mar 19
1
Labelling a fortified GADM map plotted with ggplot and geom_map
I am having trouble getting data labels to display over the provinces in a GADM map of Canada.
Specifically, I need the variable "Number" from the data set "by_province", grouped by "region", to appear on the corresponding regions of the map.
The data set "by_province" looks like this:
long lat order hole piece region
2005 Apr 05
5
Help with three-way anova
Hi
I have data from 12 subjects. The measurement is log(expression) of a
particular gene and can be assumed to be normally distributed. The 12
subjects are divided into the following groups:
Infected, Vaccinated, Lesions - 3 measurements
Infected, Vaccintaed, No Lesions - 2 measurements
Infected, Not Vaccinated, Lesions - 4 measurements
Uninfected, Not Vaccinated, No Lesions - 3 measurements
2023 Oct 14
2
Create new data frame with conditional sums
Well, here's one way to do it:
(dat is your example data frame)
Cutoff <- seq(0, .15, .01)
Pop <- with(dat, sapply(Cutoff, \(p)sum(Totpop[Pct >= p])))
I think there must be a more efficient way to do it with cumsum(), though.
Cheers,
Bert
On Sat, Oct 14, 2023 at 12:53?AM Jason Stout, M.D. <jason.stout at duke.edu> wrote:
>
> This seems like it should be simple but I
2023 Oct 13
1
Create new data frame with conditional sums
This seems like it should be simple but I can't get it to work properly. I'm starting with a data frame like this:
Tract Pct Totpop
1 0.05 4000
2 0.03 3500
3 0.01 4500
4 0.12 4100
5 0.21 3900
6 0.04 4250
7 0.07 5100
8 0.09
2012 Aug 15
1
Obtaining census tract data from addresses
Hello,
I have a bunch of street addresses that I want to obtain the census
tract data for. Is there any way I can do this in R?
Thank you,
--
Michael Leitson
Michael.Leitson at gmail.com
2005 Jan 18
1
Interpretation of randomForest results
> From: luk
>
> I got the following results when I run radomForest with below
> commands:
>
> qair <- read.table("train10.dat", header = T)
> oz.rf <- randomForest(LESION ~ ., data = qair, ntree = 220,
> importance = TRUE)
> print(oz.rf)
>
> Call:
> randomForest.formula(x = LESION ~ ., data = qair, ntree =
> 220, importance =
2012 Sep 14
1
USCensus2000 package
Does anyone know the appropriate R code to obtain census tracts (tract
and block level) from addresses by using Zack Almquist's USCensus2000
package?
Thank you,
--
Michael Leitson
Michael.Leitson at gmail.com
2013 Jan 29
1
points rejected as lying outside the specified window
Hello,
I am using the following code to create ppp files from csv data and map shape files, but I am getting some errors which I have been unable to fix by searching them online:
library(spatstat)
library(maps)
library(maptools)
NYC2<-readShapePoly("nybb.shp") # this is a map of the NYC boroughs without waterways and no census tract divisions (but it does include lines separating
2004 Aug 06
1
Query r/e multiple decoder reset...
Hello! I should have asked this earlier, but... :)
We're returning to voice processing in our app now, in which we're trying
to achieve n-way full duplex voice in a 3d environment. Since Speex is a
single voice stream CODEC, we've been looking at having each client upload
its stream to the servers, which multiplex several spatially nearby active
channels back down to the
2015 Feb 07
2
lost at 'repository' entry installing centos7
On Sat, Feb 07, 2015 at 01:05:58PM -0600, g wrote:
> so much for all that.
>
> i just thought it was working. :-(
>
> only way i can get system clock to show correct CST is to set bios
> clock to CST.
I suggest reading the man page for 'hwclock'. Namely, the --utc
option. If you don't tell your system that the BIOS is stored as UTC,
then it will assume it's
2023 Oct 14
1
Create new data frame with conditional sums
That's very helpful and instructive, thank you!
Jason Stout, MD, MHS
Box 102359-DUMC
Durham, NC 27710
FAX 919-681-7494
________________________________
From: John Fox <jfox at mcmaster.ca>
Sent: Saturday, October 14, 2023 10:13 AM
To: Jason Stout, M.D. <jason.stout at duke.edu>
Cc: r-help at r-project.org <r-help at r-project.org>
Subject: Re: [R] Create new data frame with
2023 Oct 15
2
Create new data frame with conditional sums
Under the hood, sapply() is also a loop (at the interpreted level). As
is lapply(), etc.
-- Bert
On Sun, Oct 15, 2023 at 2:34?AM Jason Stout, M.D. <jason.stout at duke.edu> wrote:
>
> That's very helpful and instructive, thank you!
>
> Jason Stout, MD, MHS
> Box 102359-DUMC
> Durham, NC 27710
> FAX 919-681-7494
> ________________________________
> From: John
2006 Mar 30
1
Random Coefficients using coxme
Hello, I was hoping someone could answer a question for me that may
either be statistical or script related. I don't come from a statistics
background, so I am not positive if I am using the correct nomenclature
or even the correct procedure. Is it possible to model "random
coefficients" in a mixed effects cox-regression using coxme from the
Kinship package? For example, using
2007 Jun 29
4
Dominant eigenvector displayed as third (Marco Visser)
Dear R users & Experts,
This is just a curiousity, I was wondering why the dominant eigenvetor and eigenvalue
of the following matrix is given as the third. I guess this could complicate automatic selection
procedures.
0 0 0 0 0 5
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
Please
2023 Oct 16
1
Create new data frame with conditional sums
Dear Jason,
The code could look something like:
dummyData = data.frame(Tract=seq(1, 10, by=1),
?? ?Pct = c(0.05,0.03,0.01,0.12,0.21,0.04,0.07,0.09,0.06,0.03),
?? ?Totpop = c(4000,3500,4500,4100,3900,4250,5100,4700,4950,4800))
# Define the cutoffs
# - allow for duplicate entries;
by = 0.03; # by = 0.01;
cutoffs <- seq(0, 0.20, by = by)
# Create a new column with cutoffs
dummyData$Cutoff
2010 Aug 27
0
how to use glm for a time course data set
Dear list,
I used glm to analyze the effect of treatment, measurement-methods etc. on lesion size in a time course experiments. Could anyone points me out how to extract detailed comparisons of interest? For example:
Measurement.T2.M6 vs. Measurement.T2.Baseline, Or even
Measurement.T2.M6.Treatment vs. Measurement.T2.M6.placebo (I did not include Treatment as a factor in the query below yet).
2023 Oct 16
1
Create new data frame with conditional sums
If one makes the reasonable assumption that Pct is much larger than
Cutoff, sorting Cutoff is the expensive part e.g O(nlog2(n) for
Quicksort (n = length Cutoff). I believe looping is O(n^2). Jeff's
approach using findInterval may be faster. Of course implementation
details matter.
-- Bert
On Mon, Oct 16, 2023 at 4:41?AM Leonard Mada <leo.mada at syonic.eu> wrote:
>
> Dear
2009 Jul 25
1
regex expression to select row or column
I have a multidimensional data which looks like the following:
"S1-a" "S2-b" "S3-c" "S4-d" "S5-a" "S6-b" "S7-c" "S8-d"
"T1-A"
"T1-B"
"T1-C"
"T1-D"
"T2-A"
"T2-B"
"T2-C"
"T2-D"
I read it from csv file and would like to have 16