search for: lrecl

Displaying 6 results from an estimated 6 matches for "lrecl".

2006 Jul 13
1
writeForeignSAS and potential extensions
...es], + FUN = function(x) format(x, "%d%b%Y %H:%M:%S")) write.table(dfn, file = datafile, row = FALSE, col = FALSE, - sep = ",", quote = FALSE, na = ".") + sep = ",", quote = TRUE, na = "") lrecl<-max(sapply(readLines(datafile),nchar))+4 cat("* Written by R;\n", file=codefile) @@ -22,24 +53,50 @@ cat("* ",deparse(sys.call(-2))[1],";\n\n",file=codefile,append=TRUE) if (any(factors)){ cat("PROC FORMAT;\n",file=codefile,append=TRUE) -...
2010 Apr 14
2
Import ASCII data using a .sas program
...le is 2308 columns long so I would certainly prefer to figure out a smart way of converting the data to R. The ASCII data is a long stream of numbers (no field separators or delimiters) while the SAS import file looks like: libname mine 'c:\'; data mine.fh4; infile 'd:\fh4.txt' lrecl=2309; input perstat1 $1-2 linenum $3-4 I_wave1 $5-5 bnocost1 $6-10 bnosta1 $11-12 So SAS uses the position of the ASCII character to determine what variable the data should be in while the SCAN or the READ. FWF function of R uses the width of the column. Does anyway have a s...
2008 Jul 23
1
Calling LISP programs in R
...ping commands in batch mode. Here is a simple program (example) to generate random normal variables from SAS to LISP; of course it's a toy example because there is no need for a LISP routine in this particular case. I hope R has a similar feature. Thanks DATA _NULL_; FILE 'c:\cl.lisp' LRECL=1024; PUT "(defun run (num Mn SD)"; PUT "(setq mix (list nil))"; PUT "(dotimes (n num)"; PUT "(setq u (- (* 2 (random 1.0)) 1)"; PUT "v (- (* 2 (random 1.0)) 1)"; PUT "w (+ (expt u 2) (expt v 2)))"; PUT "(when (<...
2017 Aug 10
4
PROC MIXED RANDOM equivalence in R nlme
...t;vehicle", which are character. Unfortunately, since the data are confidential, I'm unable to provide an example. The original SAS v6.12 code is provided below: ------------------------------------------------------------------ /* READ DATA */ DATA emiss; INFILE 'data.tab' LRECL=8000 FIRSTOBS=2 DLM='09'X MISSOVER DSD; INPUT study $ vehicle $ thc rv t5 t9 ar ol ox su bz; /* CREATE NEW VARIABLES */ ln_thc = log (thc); new = study||vehicle; /* PERFORM ANALYSIS */ PROC MIXED DATA=emiss MAXITER=1000 CONVH=1E-8 METHOD=REML NOCLPRINT NOITPRINT; CLASS new; MODEL...
2017 Aug 11
0
PROC MIXED RANDOM equivalence in R nlme
...r. Unfortunately, since the data are confidential, I'm unable to > provide an example. > > The original SAS v6.12 code is provided below: > > ------------------------------------------------------------------ > /* READ DATA */ > DATA emiss; > INFILE 'data.tab' LRECL=8000 FIRSTOBS=2 DLM='09'X MISSOVER DSD; > INPUT study $ vehicle $ thc rv t5 t9 ar ol ox su bz; > > /* CREATE NEW VARIABLES */ > ln_thc = log (thc); > new = study||vehicle; > > /* PERFORM ANALYSIS */ > PROC MIXED DATA=emiss MAXITER=1000 CONVH=1E-8 METHOD=REML NO...
2023 Mar 30
1
Problems with foreign
Good day My name is Jos? Oscar, I'm from Mexico and I have some questions about foreign in your write.foreig( ) function. We know that this function generates the inputs to be able to run them or execute them in another program like SPSS, SAS or Stata. In these cases, when creating an example file, a matrix and using the function to execute the .sps file directly from SPSS, I don't care or