similar to: Integer / floating point question

Displaying 20 results from an estimated 2000 matches similar to: "Integer / floating point question"

2008 Aug 15
6
Saving environment object
Hi, When I create an environment object with new.env() and populate it with values then how can I save it into an .RData file properly, so it can be loaded later on in a new session? Saving an environment object with save() or save.image() results in an error message when loading again: Error: protect(): protection stack overflow Regards, benjamin ======================================
2007 Nov 08
2
mapply, coxph, and model formula
Hello - I am wanting to create some Cox PH models with coxph (in package survival) using different datasets. The code below illustrates my current approach and problem with completing this. ### BEGIN R SAMPLE CODE ############################## library(survival) #Define a function to make test data makeTestDF <- function(n) { times <- sample(1:200, n, replace = TRUE) event
2008 Oct 10
2
Fatal error: unable to restore saved data in .RData
Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message "Fatal error: unable to restore saved data in .RData", and I notice in the R Console the last few lines are: "Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43)" I tried starting
2008 Jul 02
1
Hmisc latex function with longtable option
Hello - I'm trying to use Hmisc's latex function to produce a postscript file of a data.frame, using the longtable = TRUE option. When I run, for example, ## sample R code dvips(latex(data.frame(a = rnorm(100), b = rnorm(100)), longtable = TRUE), file = "test.ps") latex runs successfully and a test.ps file is produced. However, I see the following in the
2009 Jan 01
1
Wireless network connection problem
hi all , i just met a strange problem about my wireless network , i installed ipw3945 driver and it can detect the wireless network lists around my laptop ,but , i can't connect to the wireless network even under the right authority my centos 5.2 dectected my wirless network card as eth1 , it's really strange , i think any help ? thx and wish you a happy new year :) -- Keep It Simple
2006 Apr 04
1
Indexing a vector by a list of vectors
Hello R-help - I have vec <- c("string1", "string2", "string3") ind <- list(c(1,2),c(1,2,3)) I want "vec" indexed by each vector in the list "ind". The first element of the list I want would be vec[c(1,2)], the second element would be vec[c(1,2,3)], like the following. [[1]] [1] "string1" "string2" [[2]] [1]
2009 Jul 16
2
quoting expressions in a list
Dear R-help, I am having quite a difficult time coming up with what I want to do involving named lists. I have a list of logical expressions, and I would really like it if the "names" of the components of the list were identical to the corresponding logical expression. So, as an example: df.example <- data.frame(a = 1:10, b = rnorm(10, 5)) list.example <- list(df.example$a
2012 Jun 28
2
R help, using R to build choropleth
Hi guys i need some help to build choropleth. Basically i am trying to colour regions on the map by population. I possess the shape file of the country, and also the population data, however, i am having trouble to create the plot, below is my code: population=read.csv("nz2.csv") population names(population) nz=readShapeSpatial((sprintf('nz-geodetic-marks',tmp_dir)))
2007 Nov 09
2
wrapper for coxph with a subset argument
Dear R-help - Thanks to those who replied yesterday (Christos H. and Thomas L.) regarding my question on coxph and model formula, the answers worked perfectly. My new question involves the following. I want to run several coxph models (package survival) with the same dataset, but different subsets of that dataset. I have found a way to do this, described below in functions subwrap1 and
2008 Feb 26
1
wrapper for save function
Hello - I would like to create a wrapper to the 'save' function in the base package, but have a small problem with the name of the object that is getting saved in the file. Below is a simple example illustrating my problem. ## BEGIN SAMPLE R CODE ################################################## ## Here is the wrapper for the save function
2010 Mar 22
1
summary.formula and continuous variables
Hello, I am using the summary.formula function in the Hmisc package to produce tables. With the "method" argument set to "response", the help says, "Continuous independent variables (see the ?continuous? parameter below) are automatically stratified into ?g? (see below) quantile groups". By my reading, this makes it impossible to summarize a continuous variable
2009 Aug 31
4
Offtopic, HT vs. HH in coin flips
Dear R-help, Could someone please try to explain this paradox to me? What is more likely to show up first in a string of coin tosses, "Heads then Tails", or "Heads then Heads"? ##generate 2500 strings of random coin flips ht <- replicate(2500, paste(sample(c("H", "T"), 100, replace = TRUE), collapse =
2010 Feb 02
1
R's X11 Device Properties
Hello, This is an issue that is at the interface of R, X, and my window manager (either icewm or openbox, both latest versions). I am running R 2.10.1 on Ubuntu 9.10. My goal: When an X11 device is started in R (e.g., by simply calling plot), I would like for the resulting window to be in the "always on top" state, and for focus not to switch to it. Configuring this behavior is
2008 Oct 09
1
YALAQ - Yet Another LApply Question
Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str() output rather than before as does the second (preferred) form? # command1 version1 invisible(lapply(ls(pattern='bn'), function(y) cat(y, "\n", str(get(y)), "\n") )) # command1 version2 (preferred output)
2008 May 22
2
grid error message when resizing graphics window after tcltk loaded
Dear R-devel / Dr. Murrell - This is similar but ultimately unrelated (I think) to something I posted about in February. See my original post here: https://stat.ethz.ch/pipermail/r-devel/2008-February/048278.html I start R with the --vanilla option, and run the following code. ## BEGIN SAMPLE R CODE library(grid) for(i in seq(0, 1, by = .1)) { for(j in seq(0, 1, by = .1)) { angle
2007 Dec 12
3
lm/model.matrix confusion (? bug)
Dear List-members, Hopefully someone will help through my confusion: In order to get the same coefficients as we get from the following ## require (MASS) summary ( lm(Gas ~ Insul/Temp - 1, data = whiteside) ) ...................... we need to do the following (if we use model.matrix to specify the model) ## summary ( lm(Gas ~ model.matrix(~ Insul/Temp - 1) - 1, data = whiteside) )
2008 Apr 07
0
Translating NLMIXED in nlme
Dear All, reading an article by Rodolphe Thiebaut and Helene Jacqmin-Gadda ("Mixed models for longitudinal left-censored repeated measures") I have found this program in SAS proc nlmixed data=TEST QTOL=1E-6; parms sigsq1=0.44 ro=0.09 sigsq2=0.07 sigsqe=0.18 alpha=3.08 beta=0.43; bounds $B!](B1< ro < 1, sigsq1 sigsq2 sigsqe >= 0; pi=2*arsin(1); mu=alpha+beta*TIME+a i+b i*TIME;
2010 Jun 29
1
read.table / type.convert with NA values
Hello, While assisting a fellow R-helper off list, I narrowed down an issue he was having to the following behavior of type.convert, called through read.table. This is using R 2.10.1, if newer versions don't exhibit this behavior, apologies. # generates numeric vector > type.convert(c("123.42", "NA")) [1] 123.42 NA # generates a numeric vector, notice the
2006 Oct 03
1
developing a package with a name space
Hello - I'm currently maintaining an R package that uses a name space, and am also starting a new R package that will use a name space. According the the R News June 2003 issue, "Adding a name space to a package may complicate debugging code ... it is a good idea not to add a name space to a package until it is completely debugged, and to remove the name space if further debugging
2009 Sep 29
3
creating Surv object from character vector
Hello, I have srv <- Surv(sample(1:10), sample(0:1, 10, replace = TRUE)) srv [1] 1 10 2+ 8 6+ 7+ 3 5+ 4+ 9+ srv.char <- as.character(srv) srv.char [1] " 1 " "10 " " 2+" " 8 " " 6+" " 7+" " 3 " " 5+" " 4+" " 9+" Is there an inverse to as.character(srv). That is, I would