hi, this guide to analyzing changes in prevalence rates over time with
complex survey data might also help? thanks
http://asdfree.com/trend-analysis-of-complex-survey-data.html
On Wed, Jan 17, 2024, 9:15 AM John Fox wrote:
> Dear Md Kamruzzaman,
>
> To answer your second question first, you
hi, that error happens before svyglm because the second parameter isn't a
logical test? run `subset(rclus1, as.factor(stype=="E"))` and you'll see
the same error.. if you remove the "as.factor" `subset(rclus1,
(stype=="E"))` then the svyglm simply fails to converge but i think that's
just too ma
hi, check out the news page..
https://cran.r-project.org/web/packages/survey/NEWS
On Tue, Jun 19, 2018 at 5:54 PM, Mackenzie Jones
wrote:
> Dear R Users,
>
> I want to use a multinomial logistic regression model with survey data in
> the “survey” package. The original package did not have a func
hi all, in the past two days, i've found two places in unrelated code where
i needed to substitute something like
`x == y`
with
`isTRUE(all.equal(x,y))`
to fix problems that started occurring in 3.5.0 on windows. the release
news[1] makes one mention of floating points, but i'm not sur
hi, you can export the dataset from an R survey design to stata with
install.packages('survey')
library(survey)
library(foreign)
write.dta( data1$variables , "c:/path/to/file.dta" )
then type "data1" into the R console to look at the weight, id/cluster,
strata, and fpc variables to use for the "
hi, could you create a reproducible example starting from
http://asdfree.com/pesquisa-nacional-de-saude-pns.html ? thanks
On Mon, Dec 4, 2017 at 9:56 AM, Luciane Maria Pilotto via R-help <
r-help@r-project.org> wrote:
> Hi,
> I am trying to run analyzes incorporating sample weight, strata and
>
hi, the sas universal viewer might be a free, non-R way to convert a
sas7bdat file to non-proprietary formats, not sure if it's windows-only.
those other formats should be easier to import only a subset of columns
into R..
https://support.sas.com/downloads/browse.htm?fil=&cat=74
On Thu, Aug 10, 2
## BLAS: /usr/lib/libblas/libblas.so.3.0
>>>> ## LAPACK: /usr/lib/lapack/liblapack.so.3.0
>>>> ##
>>>> ## locale:
>>>> ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
>>>> ## [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>>>&
ine.
>
> I would discourage you from harassing the Brazilian government about their
> RAR file because the RAR file seems fine (no NUL characters appear in the
> text file) when extracted using the file-roller archive tool on Ubuntu.
> --
> Sent from my phone. Please excuse my brevity
that segfaults when presented
> with that corrupt file? Can you please confirm the file name and run md5sum
> on it and share the result so we can tell when the file problem has been
> reproduced?
> --
> Sent from my phone. Please excuse my brevity.
>
> On July 16, 2017 3:21:21 A
7-15 17:19:47 no
On Sun, Jul 16, 2017 at 6:34 AM, Duncan Murdoch
wrote:
> On 16/07/2017 6:17 AM, Anthony Damico wrote:
>
>> thank you for taking the time to write this. i set it running last
>> night and it's still going -- if it doesn't finish by tomorrow, i will
sorry, typo, 80937 not 809367
On Sun, Jul 16, 2017 at 6:21 AM, Anthony Damico wrote:
> hi, thank you for attempting this. it looks like your unix machine
> unzipped the txt file without corruption -- if you copied over the same txt
> file to windows 7, i don't think that would
d):
>> ## [1] compiler_3.4.1
>> tools::md5sum( fn1 )
>> ## /home/jdnewmil/Downloads/Microdados ENEM 2009/Dados Enem
>> 2009/DADOS_ENEM_2009.txt
>> ##
>> "83e61c96092285b60d7bf6b0dbc7072e"
>> dat <- readLines( fn1 )
>> length( dat )
>>
the bother
On Sat, Jul 15, 2017 at 4:14 PM, Duncan Murdoch
wrote:
> On 15/07/2017 11:33 AM, Anthony Damico wrote:
>
>> hi, i realized that the segfault happens on the text file in a new R
>> session. so, creating the segfault-generating text file requires a
>> contri
15, 2017 at 10:32 AM, Anthony Damico wrote:
> hi, thanks Dr. Murdoch
>
>
> i'd appreciate if anyone on r-help could help me narrow this down? i
> believe the segfault occurs because there's a single line with 4GB and also
> embedded nuls, but i am not sure how to
the
embedded nuls have something to do with it--
# WARNING do not run with less than 64GB RAM
tf <- tempfile()
a <- rep( "a" , 10 )
b <- paste( a , collapse = '' )
writeLines( b , tf ) ; rm( b ) ; gc()
d <- readLines( tf )
On Sat, J
hello, the last line of the code below causes a segfault for me on 3.4.1.
i think i should submit to https://bugs.r-project.org/ unless others have
advice? thanks
install.packages( "devtools" )
devtools::install_github("ajdamico/lodown")
devtools::install_github("jimhester/archive")
file_f
try resetting your factor levels and re-run?
q50 <- update( q50 , INCOME = factor( INCOME ) , AGECL = factor( AGECL ) ,
RACECL = factor( RACECL ) )
On Sun, Jul 9, 2017 at 2:59 PM, Orsola Costantini via R-help <
r-help@r-project.org> wrote:
> Hi all,
>
> When I try the following with pkg Surve
hi, i am not hitting an error when i copy and paste your code into a fresh
console. maybe compare your sessionInfo() to mine?
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack
sführung angehalten
> ERROR: loading failed for 'i386', 'x64'
> * removing '\\unetna01/mandersk$/Daten/R/win-library/3.3/lodown'
> Error: Command failed (1)
>
> Am 01.05.2017 18:15 schrieb Anthony Damico:
>
>> did my code work? thanks
>>
&
did my code work? thanks
On Mon, May 1, 2017 at 11:35 AM, wrote:
> hi, thanks for the reply!
> it always worked until 3.4.0. i got warning but they did not stop R
> loading the file ...
>
> Am 01.05.2017 16:10 schrieb Anthony Damico:
>
>> hi, i don't thin
hi, i don't think foreign::read.spss or haven::read_spss have ever worked
with a handful of the ess files, but library(memisc) does. you are better
off loading ess with library(lodown) because the drudge work has already
been done--
library(devtools)
devtools::install_github("ajdamico/lo
hi, i'm curious if anyone else has noticed a change in behavior of
readline()?
i have a function in an R package that calls readline() here:
https://github.com/ajdamico/lodown/blob/master/R/mics.R#L126
after upgrading to 3.3.3, the function appeared to start ignoring that
readline() call. my fu
this one is cute
[damico@rocks010 ~]$ ulimit -v 15
[damico@rocks010 ~]$ R
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with
hi, that setup is not correct. see examples in
https://github.com/ajdamico/asdfree/tree/master/European%20Social%20Survey
On Feb 8, 2017 11:54 PM, "André Grow" wrote:
> Dear all,
>
>
>
> I am using data from the European Social Survey (ESS) and I would like to
> calculate country-level cluster
e of associated email address).
>
> Duncan Murdoch
>
>
>
>> Jim
>>
>>
>> On Sat, Jan 7, 2017 at 8:31 PM, Anthony Damico
>> wrote:
>>
>>> hi, should i file this on https://bugs.r-project.org/ ? thanks
>>>
>>>
>>>
&g
and while I am too lazy to count the characters, you may
> have exceeded the 259 character limit as well. Are there really
> embedded EOLs as well? This is truly a masterpiece of computer
> disobedience.
>
> Jim
>
>
> On Sat, Jan 7, 2017 at 8:31 PM, Anthony Damico wrote:
&g
hi, should i file this on https://bugs.r-project.org/ ? thanks
# crash R with this command
dir.create( "C:/My Directory/PEW/Hispanic Trends/2015/2013 Recontact Survey
of Asian Ame
ricans Field dates: 10/16/13 - 10/31/13 Respondents:
Nationally-rep
resentative sample of 802 Asian A
ey)
>
>
> # load the apistrat data.frame
>
> data(api)
>
>
> # look at the first six records
>
> head(apistrat)
>
>
> # look at the weight column only
>
> apistrat$pw
>
> # calcualet mean using raw data and afetr adjusted
>
>
> svymea
# load the survey library
library(survey)
# load the apistrat data.frame
data(api)
# look at the first six records
head(apistrat)
# look at the weight column only
apistrat$pw
On Sun, Jan 1, 2017 at 9:49 AM, Kristi Glover
wrote:
> Hi R Users,
>
> Happy New Year
>
>
> I wanted to see the da
hi, please revise your minimal reproducible example. the objects `W` and
`bootstrap.results` do not exist. thanks
On Fri, Dec 23, 2016 at 4:56 PM, Kristi Glover
wrote:
> Hi R users,
>
> I got a problem when I was trying to calculate the population mean for
> different groups (classes) in using
hi, your code isn't runnable at
fpc= ~M + Nbar)
On Wed, Dec 7, 2016 at 5:03 PM, Chris Webb wrote:
> To Dr. Lumley or anyone who may know the answer,
>
> I am trying to obtain ratio estimates from Levy and Lemeshow's Sampling of
> Populations 4th ed. page 281. The results in the book
>
> Located at Gault Toyota
>
> Doctoral Candidate-Educational Theory & Practice
>
> State University of New York at Binghamton
>
> cbenj...@btboces.org
>
> 607-763-8633
> --
> *From:* Anthony Damico
> *Sent:* Thursday, No
great minimal reproducible example, thanks. does something like this work?
#Log. Reg. model-all curric. concentrations including F1RTRCC as a predictor
allCC <-
svyglm(formula=F3ATTAINB~F1PARED+BYINCOME+F1RACE+F1SEX+F1RGPP2+F1HIMATH+F1RTRCC,family="binomial",design=elsq1ch_brr,subset=BYSCTRL==1
hi, i think you want
elsq1ch_brr <- update( elsq1ch_brr , F1HIMATH = relevel(F1HIMATH,"PreAlg or
Less") )
On Mon, Oct 31, 2016 at 9:05 PM, Courtney Benjamin
wrote:
> Hello R Users:
>
> I am using the survey package in R for modeling with complex survey data.
> I am trying to reset the basel
hi, great example. i am ccing survey package author/maintainer dr.
lumley. why do you have `na.action=na.exclude`? if you remove it, things
work as expected--
library(RCurl)
library(survey)
data <- getURL("
https://raw.githubusercontent.com/cbenjamin1821/careertech-ed/master/elsq1a
hi could you make this a minimal reproducible example?
On Sep 24, 2016 12:03 PM, "Courtney Benjamin" wrote:
> In attempting to use the svyglm call in the R Survey Package, I am
> receiving the error: Error in pwt[i] : invalid subscript type 'list'
>
> I have not been able to find a lot of inform
# mean
svymean( ~ income_variable , NN )
svyby( ~ income_variable , ~ age + sex , NN , svymean )
# median
svyquantile( ~ income_variable , NN )
svyby( ~ income_variable , ~ age + sex , NN , svyquantile , 0.5 )
On Fri, Sep 2, 2016 at 3:04 PM, Juan Ceccarelli Arias
wrote:
> Hello
> Im analyzin
start at
https://github.com/ajdamico/asdfree/blob/master/European%20Social%20Survey/structural%20equation%20modeling%20examples.R
maybe?
On Thu, Jul 7, 2016 at 6:26 AM, Cristina Cametti wrote:
> Dear all,
>
> I am not able to find a reliable r code to run a multilevel latent class
> model. Indee
t; this case - Asians with diabetes diagnosed in MEPS 2013). Is there a way to
> get this count or ask R to provide this information? Any hints will be
> appreciated.
>
> Acknowledgements: The current R script is a tweaked-version of the code
> originally sent (on this forum) by A
hi pradip, this should give you what you want
library(foreign)
library(survey)
tf <- tempfile()
download.file( "
https://meps.ahrq.gov/mepsweb/data_files/pufs/h163ssp.zip"; , tf , mode =
'wb' )
z <- unzip( tf , exdir = tempdir() )
x <- read.xport( z )
names( x ) <
Maechler
wrote:
> >>>>> Ben Bolker
> >>>>> on Sat, 28 May 2016 15:42:45 + writes:
>
> > Anthony Damico gmail.com> writes:
> >>
> >> hi, here's a minimal reproducible example that crashes my
> >> R 3
hi, here's a minimal reproducible example that crashes my R 3.3.0 console
on a powerful windows server. below the example, i've put the error (not
crash) that occurs on R 3.2.3.
should this be reported to http://bugs.r-project.org/ or am i doing
something silly? thanx
# C:\Users\AnthonyD>"c
ta=imputationList(Imputed_list), nest=TRUE)
> M_mean <- with(des_mult, svymean(make.formula(get('var_name'
> summary(M_mean)
> M_quantile <- with(des_mult, svyquantile(make.formula(get('var_name')),
> quantiles = c(.5)))
> summary(M_quantile)
>
>
> Than
is the `with` not passing make.formula( get( 'var_name' ) ) through to
svyquantile for some reason? does this work?
MIcombine( with(des, svyquantile(~LBXTCD, .5)))
if that's not it, could you make a minimal reproducible example that
includes the data download? code to download and import nhane
hi, probably not.. if your survey dataset has a complex design (like
clusters/strata), you need to include them in the `svydesign` call.
coercing an incorrect survey design into a replicate-weighted design will
not fix the problem of failing to account for the sampling strategy
On Mon, Apr 4, 201
tested this out on 3.2.0, 3.2.1, and 3.2.2 -- only happens on 3.2.3, so i
assume it was an R bug not a DBI bug. submitted here:
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16734
On Sat, Feb 27, 2016 at 6:20 PM, Anthony Damico wrote:
> this happens with both SQLite and MonetDBL
this happens with both SQLite and MonetDBLite, so i assume it is not an
RSQLite bug.
notice the gc() in the no-crash version..
thanks
# initiate R with "C:\Program Files\R\R-3.2.3\bin\x64\Rterm.exe"
--max-mem-size=35M
library(RSQLite)
db <- dbConnect( SQLite() )
for( i in 1:1000
hi eiko, LaF is incompatible with survey data, that road is a dead-end.
this code below will painlessly load brfss into R, review the link douglas
sent for analysis examples and change `years.to.download <- ` to 2006 only
if you just want a single year of microdata. glhf
# install.packages( c("M
e
On Tue, Feb 23, 2016 at 8:22 AM, Duncan Murdoch
wrote:
> On 23/02/2016 7:49 AM, Anthony Damico wrote:
>
>> hi, does anybody have a clue why .Internal(La_rs(x,FALSE)) is getting
>> corrupted (actual detonation occurs within La_solve_cmplx within Lapack.c)
>> on windows b
hi, does anybody have a clue why .Internal(La_rs(x,FALSE)) is getting
corrupted (actual detonation occurs within La_solve_cmplx within Lapack.c)
on windows but not mac/unix?
i have provided two (long) scripts that reproduce the problem and a third
script modified to trigger the crash that unfortun
hi, just throwing this out there. it's not clear to me how to reproduce
the crashes, because they are sporadic (but common)
guessing it's related to the switched default of setInternet2(TRUE) but not
sure
here's a semi-absurd screenshot
http://s17.postimg.org/70omgtmi7/early_crashes.png
i had
could you try this, and then not use factor(age) elsewhere?
sv1 <- update( sv1 , age = factor( age ) )
if that doesn't work, is it possible for you to share a reproducible
example? thanks
On Thu, Sep 10, 2015 at 4:51 PM, Emanuele Mazzola wrote:
> Hello,
>
> I’m having a weird issue with the f
just going to throw this idea out there in case it's something that anyone
wants to pursue: if i have an R script and i'm hitting some unexpected
behavior, there should be some way to remove extraneous objects and
manipulations that never touch the line that i'm trying to reproduce.
automatically s
hi, if i copy and paste this (pretty straightforward) code into R 3.2.2's
32-bit console, the program dies. if i use 64-bit R, the console doesn't
die, but the process ends with a weird line-ending warning. i'm under the
impression that if the console crashes, it's a bug? but i wanted to check
w
hi, ccing the package maintainer. one alternative is to pull the HU100
variable directly from the census bureau's summary files: that variable
starts at position 328 and ends at 336. just modify this loop and you'll
get a table with one-record-per-census-block in every state.
https://github.com/
i don't know the answer to your larger question, but for confidence
intervals around proportions you might look at ?svyciprop. one of the
method= options might yield the same result as your approximation, not sure
On Mon, May 11, 2015 at 12:40 AM, Brown, Tony Nicholas <
tony.n.br...@vanderbilt.ed
com/reubano/1281134.
>
> Thanks again!
>
> Sincerely,
>
> Shouro
>
> On Tue, May 5, 2015 at 5:21 PM, Anthony Damico wrote:
>
>> hi, after running each individual line of code above, check that the
>> object still has the expected number of records and unique
hi, after running each individual line of code above, check that the object
still has the expected number of records and unique county fips codes. it
looks like length( shapes$GEOID ) == 3233 but nrow( merged_data ) == 3109.
the way for you to debug this is for you to go through line by line after
maybe
library(xlsx)
tf <- tempfile()
ami <- "
http://www.ferc.gov/industries/electric/indus-act/demand-response/2008/survey/ami_survey_responses.xls
"
download.file( ami , tf , mode = 'wb' )
ami.data2008 <- read.xlsx( tf , sheetIndex = 1 )
On Wed, Mar 25, 2015 at 5:01 PM, Benjamin Baker wrot
their
> stata files, it seems, as .dta. Further, the .rdata files are not loading
> correctly, either, giving me .Traceback or crashes R when I try to source
> it. I will poke around your link to see if it can provide any insight.
>
> ~n
>
>
>
>
>
>
>
> On Ma
hi nicole, i have published easy to reproduce, well-documented code to
download and then analyze every file from every wave of the world values
survey here. the download automation script should solve your problem, or
at least work around it :)
http://www.asdfree.com/search/label/world%20values%
hello, i am trying to replace non-ASCII characters in a character string
with a single space. the iconv() function works as i expect it to on
windows, but on unix, non-ASCII characters are getting replaced with two
spaces instead of one. i suppose i could write a workaround for my code,
but i'm w
hi anabela, please provide a complete reproducible example. you need to
use ?dput -- we are not able to import "dadosSPSS.sav" so we cannot
recreate your problem in order to help you. thanks!
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
On Tue, Mar 10
hi brennan, survey design objects can be subsetted with the same subset()
syntax as data.frame objects, so following jeff's advice maybe you want
svyglm( formula , design = subset( surveydesign , variable %in% c( 'value
a' , 'value b' ) ) )
for some examples of how to construct a survey design wi
On Mon, Jan 26, 2015 at 2:13 PM, hnlki wrote:
> Thank you for your answers. In fact I am using the HFCS dataset,
cool, so survey data. asdfree.com is a good place for examples. also, if
you can match any officially-published statistics, i would love to
collaborate on a post with you :)
>
hi nate and annelies, the survey of consumer finances and consumer
expenditure survey folders both have examples of how to run a glm on
multiply-imputed survey data.. but these examples are specifically for
complex sample survey data, which might not be what you're working with. :)
https://github
hi pradip hope you're doing well! these two scripts have age adjustment
calculations, but neither are specific to nhis. the nhanes example is
probably closer to what you're trying to do :)
https://github.com/ajdamico/usgsd/blob/master/National%20Health%20and%20Nutrition%20Examination%20Survey/2
the mitools package is compatible with the survey package.. asdfree.com
has complete step-by-step R code examples to work with govt microdata.
here are the ones with multiply imputed survey data. :)
national health interview survey
national survey of children's health
consumer expenditure survey
survey:::svyplot.default with style="grayhex" calls
hexbin:::gplot.hexbin
an internet search turns up lots of people asking the question "how do i
set xlim and ylim on hexbin plots?" but i don't see any easy solutions. :/
On Thu, Nov 20, 2014 at 10:31 AM, Raphael Fraser
wrote:
> Does not w
L, 1L, 2L, NA, 1L, 1L, 6L, 1L,
> 6L, 6L), .Label = c("Soltero", "Casado", "Separado", "Divorciado",
> "Viudo", "Union libre"), class = "factor"), ovt = c(NA, 93.3823547363281,
> NA, NA, NA, NA, 83.8235321044922, NA, NA, NA
try resetting your levels? if that doesn't work, please dput() an example
data set that we can test with :) thanks!
sii.design <- update( sii.design , d6 = factor( d6 ) )
On Wed, Nov 12, 2014 at 7:59 AM, Martin Canon
wrote:
> Hi.
>
>
> I'm trying to calculate the weighted mean score of a
could you provide a minimal reproducible example? perhaps use ?dput.
in general the survey package matches all other languages
http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Damico.pdf
here's an example of a minimal reproducible example that does match
http://www.ats.ucla.edu/stat
it might be slightly different, but i think the result is very close to a
tsl result (which hasn't been implemented).. could you use this?
mns<-svyby(~api00+api99, ~stype, rclus1, svytotal,covmat=TRUE)
vcov(mns)
On Wed, Oct 15, 2014 at 9:27 AM, Daniela Droguett <
daniela.droguett.l...@gmail.c
hi michael, you probably need
options( "survey.replicates.mse" = TRUE )
i also think you don't want type = "Fay" and you do want scale = 4/80 and
rscales = rep( 1 , 80 ) as well, but what you have might be equivalent
(not sure)
regardless, this blog post details how to precisely replicate the
here is a reproducible example, mostly from ?withReplicates. i think
something would have to be done using return.replicates=TRUE to manually
compute survey-adjusted residuals, but i'm not really sure what nor whether
the pseudo r^2 would be meaningful :/
library(survey)
library(quantreg)
data
# build off of david's suggestion
x <-
data.frame(
patient= 1:20 ,
disease =
sapply(
pmin( 2 + rpois( 20 , 2 ) , 6 ) ,
function( n ) paste0( sample( c('A','B','C','D','E','F'),
n), collapse="+" )
)
)
# break the diseas
the loop is 1 thru 9 but the manual is just 1, 2, 3, 4? change the loop
from 1:dim(mydata)[2] to 1:4 and it works :)
On Tue, Jun 24, 2014 at 9:43 AM, Zayd Farah wrote:
> I hope the following script is reproducible enough to highlight my issue,
> which is to automatically (in this case by loop
(1) you hit a memory error, because you are including too many variable
levels. even if you narrowed your 16 variables down to these four, the
`rake` function would need room for matricies containing as much data as a
6-million record table:
nrow( expand.grid( data473t[ , c( 'm11' , 'm12c' , 'm13
could you provide a reproducible example ?dput is your friend
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
On Sat, Jun 7, 2014 at 11:22 AM, Michael Willmorth <
mwillmo...@clearwater-research.com> wrote:
> I'm teaching myself how to use rake() in the R "
it is the survey design-adjusted standard error. you can view what's going
on by typing `survey:::svymean.survey.design` and `survey:::svyCprod` :)
On Fri, Jun 6, 2014 at 10:03 AM, Ryan de Vera
wrote:
> Hello all,
>
> I have been experimenting with svymean() and I am confused on what the
> ou
hi leandro, in case you're already familiar with ibge's pnad, you might
find these examples useful--
http://www.asdfree.com/search/label/pesquisa%20nacional%20por%20amostra%20de%20domicilios%20%28pnad%29
https://github.com/ajdamico/usgsd/tree/master/Pesquisa%20Nacional%20por%20Amostra%20de%20Domi
x.html .
>
> Please update your packages and try again. (This looks very like a bug in
> recently contributed code that has already been fixed.)
>
>
> On 07/11/2013 13:40, Anthony Damico wrote:
>
>> this file
>>
>>
>> http:/
this file
http://www.electionstudies.org/studypages/data/anes_mergedfile_1992to1997/anes_mergedfile_1992to1997_dta.zip
can be downloaded after free registration on this page
http://electionstudies.org/studypages/download/registration_form.php
imports properly in windows R x64 3.0.1 but ca
if you want to use R itself, you could try --
# check your time zone's abbreviation
Sys.time()
# subtract the time you want the program to run from the current time,
# including your time zone..mine is EDT
Sys.sleep( as.POSIXct( "2013-10-11 06:30:00 EDT" ) - Sys.time() )
-- at the very top of
maybe ?cumsum
z <- 1:10
cumsum( z )
z <- sort( z )
cumsum( z )[ cumsum( z ) < 30 ]
On Sat, Sep 14, 2013 at 10:36 PM, wrote:
> I came from Python, newly learning R. is there something like accumulate()
> in R?
>
> Example:
> accumulate([1,2,3,4,5]) --> 1 3 6 10 15
>
> Or perhaps I should sh
the smallest boundary in the 1-year acs files is public use microdata area
(puma), but the 3- and 5-year public use microdata samples (pums) go down
to some counties, i believe..
http://www.census.gov/acs/www/guidance_for_data_users/estimates/
i think you just need to download the census bureau
the
> rm(list = ls())
at the top of your snippet makes me wonder if you had loaded any packages
(like XLConnect) that use Java in a previous part of the session? i
believe you must designate the ram allocation for java prior to loading any
java-related packages, and clearing out your objects wil
hope this helps.. :)
# define an object `x`
x <- list( "any value here" , 10 )
# set `myoption` to that object
options( "myoption" = x )
# retrieve it later (perhaps within a function elsewhere in the package)
( y <- getOption( myoption ) )
it's nice to name your optio
40919 5505 20 10211 1007 32988 30554
> - 81 27897 20411985 54 4494
> NA 81 27897 20411985 54 4494
> 1953 12779 9184686415
> 1953 12779 9184686415
> > temp[ is.na( temp ) ] <- 0
> > temp
> 6478
try adding colTypes = 'numeric' to your readWorkSheetFromFile() call
if that doesn't work, try a few other steps
# view what data types your file is being read in as
sapply( temp , class )
# convert all fields to character if they're factor variables.. but i don't
think you need this, readWo
this might screw up the column classes of some of your columns, but it
could be enough for what you're doing :)
# start with a data frame with duplicate columns
v <- data.frame(id = c(1:6), x = c(15, 21, 14, 21, 14, 38), y = c(36, 38,
55, 11, 5, 18), x.1 = c(15, 21, 14, 21, 14, 38), z = c("D", "B
you can create an empty data frame with
yourdata <- data.frame()
and then add new records to it with another data table called `newdata`
like this..
yourdata <- rbind( yourdata , newdata )
On Mon, Mar 11, 2013 at 9:13 AM, Anup khanal wrote:
>
> Hi Experts, I am newbie in R. Could you pleas
not sure if you meant to use both 0.2 and 0.02, but i believe your
unexpected results are a floating point issue..
start here
http://r.789695.n4.nabble.com/That-dreaded-floating-point-trap-td3418142.html
and here
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-ar
you want to replace all rows where the 4th column is zero.. (data[ , 4 ]
== 0)
and you want to perform that replacement in the first column..
so try
data[ data[ , 4 ] == 0 , 1 ] <- NA
On Sat, Mar 2, 2013 at 5:26 AM, Camilo Mora wrote:
> Hi everyone,
>
> Imagine that I have a data frame with
in the future, please provide R code to re-create some example data :)
read
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-examplefor
more detail..
# create a data table with three unique columns' values..
# treat these values just like letters
x <-
cbind(
another option that i think is easy & intuitive :)
library(sqldf)
mydata <- sqldf( "select Subject , Block , avg( Feature1 ) as Feature1 ,
avg( Feature2 ) as Feature2 , [..keep going..] , avg( Feature10 ) as
Feature10 from yourdata group by Subject , Block" )
On Thu, Feb 21, 2013 at 4:45 PM,
hi catalin, i thought this was a great question and could not find a good
answer on stackoverflow.com, so i have started this thread which asks the
question formally. i have also provided one answer that should be
sufficient for you, but others may weigh in as well
http://stackoverflow.com/questi
it is easy to parse through yourself. if you don't care about the labels
and just want to import fixed-width file data, you can use the SAScii
package. if you do, run this code to get 'em :)
# load the stringr package to trim strings quickly
library(stringr)
# example proc format block--
# s
i think this is what you want.. :)
http://stackoverflow.com/questions/4765936/using-joined-tables-to-exclude-certain-records
library(sqldf)
# use the mtcars example table
mtcars
# keep the first eight records in a second, separate data set
x <- mtcars[ 1:8 , ]
# keep all the records from mtca
1 - 100 of 147 matches
Mail list logo