Displaying 20 results from an estimated 10000 matches similar to: "replace"
2008 Aug 11
3
tkentry that exits after RETURN?
I can set up an entry widget (thanks to an old
post by Barry Rowlingson) that gets a password and
exits when the user clicks on the "OK" button.
Anyone have any clever ideas for returning/
destroying the window when the user types a carriage
return/ENTER in the text window? I've messed around
a little with validate, validatecommand, but don't
see any obvious way to do it ...
2009 Oct 15
2
forwarded: bug (?) in cut.POSIXt with "breaks"=integer
From: Vitalie S. <vitosmail <at> rambler.ru>
Subject: Bug in cut.POSIXt
Newsgroups: gmane.comp.lang.r.general
Date: 2009-10-15 15:47:48 GMT (1 hour and 29 minutes ago)
Hello Everyone,
Before reporting decided to post here first:
tt <- structure(c(1254238817, 1254238859, 1254238969, 1254239080), class =
c("POSIXt",
2011 Nov 08
4
Intervals in function cut
When I was studying the function cut I found this example:
> x <- rep(0:8, tx0)
> x
[1] 0 0 0 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 4 4 4 5 5 5 5 5 5
5 5 5 5 6
[39] 6 6 6 6 7 7 7 8 8 8 8 8
> cut(x, b = 8)
[1] (-0.008,0.994] (-0.008,0.994] (-0.008,0.994] (-0.008,0.994]
(-0.008,0.994]
[6] (-0.008,0.994] (-0.008,0.994] (-0.008,0.994] (-0.008,0.994] (0.994,2]
[11] (0.994,2]
2009 Aug 25
1
Filling in empty arrays/lists from using "paste" function
Dear R users,
I am trying to fill in arrays (5 different according to distinct "id")
from objects produced from arbitrary data set below.
a <-
2003 Oct 06
4
Apply and its friends
Hi,
Forgive a very basic question...
I need to take two lists-of-lists, and apply a function to each pair of elements in the lists to return a single list...
For example
l1 <- list(1:5,6:10,2:15)
l2 <- list(1:8,4:12,1:19,4:20)
I could easily do an lapply across each of them, but is there a function that does a sort-of pairwise-apply across both together?
Does anybody know of a good
2009 Jun 08
1
last.warning and Sweave?
Sweave does something clever with warnings, which I have so far been
unable to figure out. There are a couple of threads on the list about
this, but the best in here is a hack to redirect all the output and
stick it back in.
http://www.nabble.com/-R--Sweave-and-warning-messages-td7759353.html#a7759353
2009 Feb 18
3
Barplot with Sorted X-Axis
Hi,
I have a binned data that looks like this.
(8.048,18.05] (-21.95,-11.95] (-31.95,-21.95] (18.05,28.05] (-41.95,-31.95]
81 76 18 18 12
(-132,-122] (-122,-112] (-112,-102] (-162,-152] (-102,-91.95]
6 6 6 5 5
(-91.95,-81.95] (-192,-182]
2005 Mar 02
1
Warning: number of items to replace is not a multiple of replacement length
I feel like a complete dolt, as I know this question has been asked by
others on a fairly regular basis, but I'm going in circles trying to get
the following to work:
id.prob<-function (tt)
{
library(mvtnorm)
#============================
Makeham<-function(tt)
{
a2=0.030386513
a3=0.006688287
b3=0.039047537
t<-tt-20
h.t<-a2+a3*exp(b3*t)
S.t<-exp(-a2*t+a3/b3*(1-exp(b3*t)))
2004 Aug 13
5
simtest for Dunnett's test
Hi!
I use simtest fonction of multcomp package to compile a Dunnett's test.
I have 10 treatments and one control group, so i create a matrix with:
m<-matrix(0,10,11)
m[1,1]<--1
m[1,2]<-1
m[2,1]<--1
m[2,3]<-1
m[3,1]<--1
m[3,4]<-1
m[4,1]<--1
m[4,5]<-1
m[5,1]<--1
m[5,6]<-1
m[6,1]<--1
m[6,7]<-1
m[7,1]<--1
m[7,8]<-1
m[8,1]<--1
m[8,9]<-1
2007 Mar 07
5
How to open more windows to make more graphs at once!
Dear R users,
I have a data frame (test) including five columns of upper (numeric), lower (numeric), observed (numeric), best_sim (numeric) and stname (factor with 80 levels, each level with different length). Now I would like to write a short program to draw one graph as follow for each level of stname but I would like also to draw each time 12 graphs for the 12 levels of stname in the same
2000 May 01
6
including r code in a latex file
Dear R people,
The header practically says it all. I was wanting to include r code in a
Latex file. Since R code using{ and }, which are interpreted by Latex as
control characters, I would expect it to get upset.
I believe that \{ would probably print as {, but I hoping I don't have to
go through the code and add lots of \. I would rather use some global
commannd, along the lines of
2001 Dec 05
3
Histograms per coding variable
Dear all
I have a dataset that looks like:
fr.wt site
1 4400 glen
2 235 glen
3 225 glen
' ' '
' ' '
' ' '
82 550 glen
83 550 kom
84 550 kom
' ' '
' ' '
' ' '
191 820 kom
192 2000 soet
' ' '
' ' '
I need to do a series of histograms for each of the codes, levels or
factors in
2009 Apr 24
4
omit empty cells in crosstab?
Perhaps this is a common question but I haven't been able to find the answer.
I have data with many factors, each taking many values. However, only
relatively few combinations appear in the data, ie have nonzero counts, in
other words the resulting table is sparse. Say we have 10 factors each with
10 levels. The result of table() would exceed the memory space (on a 32bit
machine). Is there
2006 Jan 06
7
Multiplication (PR#8466)
hi - in version 2.1 the command
>-2^2
gives
-4
as the answer. (-2)^2 is evaluated correctly.
Cheers,
George Casella
--
George Casella Phone: (352) 392-1941 Ext. 204
Distinguished Professor and Chair Cell: (352) 682-7210
Department of Statistics Fax: (352) 392-5175
University of Florida Email: casella at stat.ufl.edu
P.O. Box 118545
Gainesville, FL
2006 Jan 06
7
Multiplication (PR#8466)
hi - in version 2.1 the command
>-2^2
gives
-4
as the answer. (-2)^2 is evaluated correctly.
Cheers,
George Casella
--
George Casella Phone: (352) 392-1941 Ext. 204
Distinguished Professor and Chair Cell: (352) 682-7210
Department of Statistics Fax: (352) 392-5175
University of Florida Email: casella at stat.ufl.edu
P.O. Box 118545
Gainesville, FL
2003 Mar 31
2
Does R have an inverse wishart distribution?
If so, I''ve had trouble finding it. Can anyone help?
2001 Mar 30
2
discriminate analysis
Dear List,
I'd like to run a discriminate analysis on a data set, but have no idea
how to go about this in R. I have attempted to locate info in the manuals,
but may not be consulting the right sections or documents.
Can anyone point me to appropriate documentation if such exists.
Many thanks,
David
S. David White
sdavidwhite at bigfoot.com
Columbus, Ohio
2006 Nov 04
0
Free Rails workshop in Malmo, Sweden, Sept. 17
Hi --
I''m going to be giving a free (but limited enrollment) one-day Rails
workshop in Malmo, Sweden, on September 17. The event is presented by
Polar Rose (http://www.polarrose.com).
For more info:
http://www.polarrose.com/about/ruby-on-rails-workshop-by-david-black
Hop on over from London if you''re at RailsConf Europe! (Which
[London] is where I am now.)
David
--
2009 May 22
2
Scope problem?
I've just spent today trying to fix a Heisenbug...
this function returns a linear interpolator function:
interpOne <- function(xl,yl){
f = function(data){
t = (data-min(xl))/(max(xl)-min(xl))
return(min(yl)+t*(max(yl)-min(yl)))
}
return(f)
}
> k=interpOne(c(0,1),c(4,5))
> k(0.5)
[1] 4.5
and this function uses the above to return a function that returns a
piece-wise
2000 Apr 14
2
replacing NA values in an expression
Dear R people,
This is simple, nay trivial question. I do the following. I just want to
know what is the slickest/most elegant method. I have an expression
containing the term
(y)*log(y)
where y can take the value either 0 or 1. If y is 0 then the expression is
undefined, but in this case I want to replace the result by 0 in the
expression. I don't want to write a separate function for