search for: seqn

Displaying 8 results from an estimated 8 matches for "seqn".

Did you mean: seq
1999 Nov 30
2
seqN
I have been using a function seqN <- function(N) {if (0==length(N)) NULL else if (N<=0) NULL else seq(N)} in for loops when I want no looping in the case of a zero value: for (i in seqN(m) ) ... Since seqN(0) returns NULL this results in for doing no loops (which is much more convenient than always checking for m==0). It s...
2009 Aug 12
2
10x slower merge in mac 2.9.1 vs. 2.9.0 (PR#13890)
...n. I do this each time because (a) R is fast. why not? and b) the datasets occasionally get updated by CDC and it's easier to swap in new files that way. One such merge is two data.frames with 10 variables and 10,000 rows each. The command in question is: temp = merge (demo.2,ph,by="seqn",all.x=TRUE) in 2.9.0, this command took 3.3 seconds. in 2.9.1, it took 35.8 seconds. I have reverted back to 2.9.0. Additional packages loaded are: library(Hmisc) library(alr3) library(epicalc) library(ggplot2) library(lattice) library(reshape) library(survey) library(car) thanks very m...
2007 Dec 09
1
List comprehensions for R
...for two shapes of f: ## ## (1) (`<-` (`~` expr ## var) ## seq) ## and ## ## (2) (`~` expr ## (`{` (`<-` var1 seq1) ## (`<-` var2 seq2) ## ... ## (`<-` varN <- seqN))) ## ## In the former case, we set gens <- list(var <- seq), unifying the ## treatment of both shapes under the latter, more general one. syntax.error <- "Comprehension expects 'expr ~ {x1 <- seq1; ... ; xN <- seqN}'." if(!is.call(f) || (f[[1]]!='&lt...
2012 Aug 10
1
Direct Method Age-Adjustment to Complex Survey Data
...nload.file( " ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/nhanes/2009-2010/TCHOL_F.xpt" , tf , mode = "wb" ) NHANES.0910.TCHOL_F.df <- read.xport( tf ) ############# merge them together, keeping only a few columns ################## DemoKeepVars <- c( "SEQN" , "WTMEC2YR" , "RIDSTATR" , "SDMVPSU" , "SDMVSTRA" , "RIDAGEYR" , "RIAGENDR" , "RIDRETH1" ) TCHOLKeepVars <- c( "SEQN" , "LBXTC" ) x <- merge( NHANES.0910.demographics.df[ , DemoKeepVa...
2018 Apr 14
1
Fwd: Re: Reading xpt files into R
...**DSCRPTR HEADER RECORD!!!!!!!000000000000000000000000000000 SAS DEMO SASDATA 9.2 XP_PRO 16SEP09:09:39:2516SEP09:09:39:25 HEADER RECORD*******NAMESTR HEADER RECORD!!!!!!!000000014400000000000000000000 SEQN Respondent sequence number So the header is text, but it is text with a particular structure. If your file doesn't have that structure, then it's not a SAS xport file. The .xpt extension is also used for Mozilla Firefox plugins. > > Nick > > > > On 14 April...
2018 Apr 13
0
Reading xpt files into R
...**DSCRPTR HEADER RECORD!!!!!!!000000000000000000000000000000 SAS DEMO SASDATA 9.2 XP_PRO 16SEP09:09:39:2516SEP09:09:39:25 HEADER RECORD*******NAMESTR HEADER RECORD!!!!!!!000000014400000000000000000000 SEQN Respondent sequence number You can look at the file with a text editor. There is a read.xport function in the foreign package and I think most people would have chosen that one as a first attemp. It's part of the standard R distribution. It refers you to https...
2018 Apr 13
5
Reading xpt files into R
Hello R folk I have an xpt file which I have been trying to open into R in R studio On the net I found guidance which says that I need packages Hmisc and SASxport which I have successfully loaded. I had also found some code which says that this would allow me to read the xpt file into R: library(SASxport) data(Alfalfa) lookup.xport("test.xpt")
2018 Apr 14
0
Fwd: Re: Reading xpt files into R
-------- Original Message ---------- From: WRAY NICHOLAS <nicholas.wray at ntlworld.com> To: peter dalgaard <pdalgd at gmail.com> Date: 14 April 2018 at 20:18 Subject: Re: [R] Reading xpt files into R Well yesterday I'd downloaded the "foreign" package and tried to open the xpt file using that: library(foreign) read.xport("test.xpt") I got the following