similar to: Reading SAS data into R

Displaying 20 results from an estimated 20000 matches similar to: "Reading SAS data into R"

2001 Aug 23
3
Reading SAS version 8 data into R
Hi, SAS transport files created with the xport engine in SAS can be read using read.xport. However, the xport engine only works with SAS version 6, and consequently long variable names are not allowed... Can anyone tell me how to get SAS data (ver 8) into R (easily)? Thanks in advance S?ren H?jsgaard sorenh at agrsci.dk http://www.jbs.agrsci.dk/~sorenh
2007 Nov 29
2
sqlQuery of variable of type varchar - confusion with "."
Dear list, I have a rather large dataset in SAS which I export to a SQLite database for subsequent use in R. One of the columns is cowidp 1881501224.2 1881501224.2 and the column is stored as a character in SAS. It becomes a varchar in the database (it should be - it is an identifier; not a number). Reading this into R gives cowidp 1 1881501224 2 1881501224 .... - i.e. the
2009 Jan 31
1
sas.get under Linux
Dear all, I am trying to import a SAS file into R (in fact I only need the value labels from the formats file), using Hmisc package, but I get this error: my.sas <- sas.get("/home/adi/3", "fis1_sgg") sh: sas: not found Error in sas.get("/home/adi/3", "fis1_sgg") : SAS job failed with status 32512 I read some past discussions and I get the impression
2001 Dec 06
2
Contrasts in lm
Dear all, In SAS (GLM and MIXED) estimable functions (linear functions of the parameters) can be specified in the ESTIMATE and CONTRAST statements. Has anyone written a similar "utility" for use in connection with lm? Thanks in advance S?ren H?jsgaard -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2004 May 04
2
Seeing the definition of a function
Dear all, I was trying to see how the function 'confint' is defined. Doing > confint function (object, parm, level = 0.95, ...) UseMethod("confint") <environment: namespace:stats> does not really enlighten me. How can I get to see the implementation (I guess it should be possible according to the general philosophy of the R project)? Thanks in advance S??ren
2005 Jun 20
2
Fwd: How to sample from a linear mixed model
Thanks. I wonder if there is a general way of extracting var(u) and var(e), which would be needed to simulate u and e. Clearly, one can get the estimated parameters, but is there a clever way of 'setting up' the matrices?? Best S??ren On 6/19/05, S??ren H??jsgaard <Soren.Hojsgaard at agrsci.dk> wrote: > I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has
2005 Jul 12
10
Computer algebra in R - would that be an idea??
>From time to time people request symbolic computations beyond what D() and deriv() etc can provide. A brief look at the internet shows that there are many more or less developed computer algebra packages freely available. Therefore, I wondered if it would be an idea to try to 'integrate' one of these packages in R, which I guess can be done in more or less elegant ways... I do not know
2010 Nov 26
3
Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
# The result I am after is the result after a substitution in an expression, such as substitute(expression(a+b+c), list(a=1)) expression(1 + b + c) # However, the way I want to do it is for a an expression "stored as a variable" as (expr <- expression(a+b+c)) expression(a + b + c) # a) The following does not work (expr2 <- substitute(expr, list(a=1))) expr # b) - whereas this
2001 Oct 09
1
PROC MIXED user trying to use (n)lme...
Dear R-users Coming from a proc mixed (SAS) background I am trying to get into the use of (n)lme. In this connection, I have some (presumably stupid) questions which I am sure someone out there can answer: 1) With proc mixed it is easy to get a hold on the estimated variance parameters as they can be put out into a SAS data set. How do I do the same with lme-objects? For example, I can see the
2004 Jun 05
2
'invalid HOMEDRIVE'
Dear all, One of my students have installed R1.9.0 on windows, and gets the fatal error 'invalid HOMEDRIVE' Can anyone help her/me out on that one? Thanks in advance Søren Højsgaard [[alternative HTML version deleted]]
2005 Jul 31
3
Drawing a graph with vertices and edges using tcl/tk
Dear all; I would like to draw a graph with vertices and edges, and I guess tcl/tk would be appropriate. I don't know tcl/tk but have googled for a 10-page (or so) introduction to 'getting started with tcl/tk in R' but without any luck. - Does anyone know of the existence of such a document or any other web-based material on the subject? - Does anyone have an (informative) piece of
2012 Aug 08
2
Having both R-current and R-devel installed on Ubuntu
Dear List, Having used R on Windows for years, I have recently installed Ubuntu as a virtual machine. I admit that I am quite new to the linux world. Installing R (current version = 2.15.1) went smoothly, but I would like to have both the current version of R and R-devel installed. I've searched the net for info on doing this but so far without luck. Can anyone help me getting this up and
2006 Oct 05
3
How to get the function names
I've defined the function getFunNames <- function(FUN){ if (!is.list(FUN)) fun.names <- paste(deparse(substitute(FUN)), collapse = " ") else fun.names <- unlist(lapply(substitute(FUN)[-1], function(a) paste(a))) fun.names } which gives what I want : > getFunNames(mean) [1] "mean" > getFunNames(ff) [1] "ff" >
2006 Feb 22
2
How can I see how %*% is implemented?
I would like to see how the matrix multiplication operator %*% is implemented (because I want to see which external Fortran/C routines are used). How can I do so? Best S??ren
2007 Dec 06
3
$ operator is invalid for atomic vectors, returning NULL - what is the right thing to do then?
Dear all, Starting from a recent version of R, the $ became "unusable" on atomic vectors, e.g. > x <- c(a=1,b=2) > x$a NULL Warning message: In x$a : $ operator is invalid for atomic vectors, returning NULL I can of course do > x['a'] - but that requires more typing (5 characters rather than 2). Apologies if I've missed a an announcement regarding this, but
2006 Apr 04
2
xyplot: getting data into the panel function
In xyplot, I would like to get the "data into the panel function" in the following sense: Consider xyplot(scc~time|cowidp, data=cow.s,type=c("l"), panel=function(x,y,subscripts,...){ panel.xyplot(x,y,...) vvv<-cow.s[which(!is.na(cow.s[subscripts,"mastreat"])),"time"] panel.abline(v=vvv,col="red",lwd=2) } ) If I want to use a
2007 Nov 20
2
Use and misuse of "update" function for non-models. Any views/recommendations??
Dear all, I wonder if it is "bad style" (or something worse) to create an "update" function which does not work on model objects of the lm, glm etc. type. Specifically, I have some graph objects (graphs as mathematical objects, not as displays) which I want to alter and for that purpose I thought of writing an update function. Would doing so violate a "deeper
2006 Aug 14
2
Calculating trace of products
Dear all, I need to calculate tr(A B), tr(A B A B) and similar quantities **fast** where the matrices A, B are symmetrical. I've searched for built-in functions for that purpose, but without luck. Can anyone help? Thanks in advance Søren [[alternative HTML version deleted]]
2006 Sep 29
2
Automatical download of needed packages from CRAN
I write a package foo which requires a package bar (from CRAN) to work. So in the DESCRIPTION file I write Depends: bar. I would like it to be so that when one installs foo, then it is automatically checked whether bar is installed, and if not then bar is also installed at the same time. I remember having seen packages which do so, but I can not figure out the mechanism 'Depends: bar' in
2006 Aug 29
2
lattice/xyplot: plotting 4 variables in two panels - can this be done?
Hi, I would like to create a plot of y1,y2,y3,y4 against x for several subjects such that y1 and y2 are plotted against x in one panel and y3 and y4 against x in another panel. Thus if there are 3 subjects I should end up with 6 panels. Is there a simple way of doing so (i.e. without calling xyplot() several times, and then padding the results together)?? Regards S?ren