Displaying 20 results from an estimated 1400 matches similar to: "[Fwd: Re: evaluation question]"
2009 Jan 14
1
referring to calls in functions
The first program generates an error message and does not execute the
regression of y on x.
x<-1:10;
y<-rnorm(10) + x;
prac <- function( model, wghts ){ lm(model, weights = wghts) }
prac(model = y~x, wghts = rep(1, 10))
But the next program works:
x<-1:10;
y<-rnorm(10) + x;
prac <- function( y, x, wghts ){ lm(y~x,
2010 Jul 12
3
How to mean, min lists and numbers
I would like to sum/mean/min a list of lists and numbers to return the
related lists.
-1+2*c(1,1,0)+2+c(-1,10,-1) returns c(2,13,0) but
sum(1,2*c(1,1,0),2,c(-1,10,-1)) returns 15 not a list.
Using the suggestions of Gabor Grothendieck,
Reduce('+',list(-1,2*c(1,1,0),2,c(-1,10,-1))) returns what we want,
c(2,13,0).
However, it seems that this way does not work to mean/min.
So, how to
2011 Jan 01
3
Plot symbols: How to plot (and save) a graphic symbols originating from a table
Dear all,
Please, I have a doubt regarding symbol plotting
with data originating from a table.
Please, see below:
I have a tab delimited file called table1.txt with 4 columns:
ypos animal var1 var2
5 cat gina <= lady gina \u2264 lady
7 dog bill >= tony bill \u2265 tony
9 fish dude <= bro dude \u2264 bro
#I then load in the data to R:
table1<-read.table("table1.txt",
2004 Jan 19
2
small bug on qchisq (PR#6442)
Full_Name: Drouilhet R?my
Version: 1.8.1
OS: Linux
Submission from: (NULL) (195.221.43.136)
qchisq(1,10) works well but qchisq(1,10,ncp=0) does not work whereas ncp=0 is
the default value of the function qchisq(1,10). (of course, 10 will be replaced
by any integer value).
Let us notice that this bug occurs only when applying probability one.
(qchisq(seq(0,.9,.1),10,ncp=0) works very well).
2000 Feb 04
2
terminating plot
This script (in Version 0.90.1 [Solaris]):
postscript (file="test.eps",onefile=F)
par (mfrow=c(3,1))
plot (1:10,rep(1,10))
plot (1:10,rep(1,10))
plot (1:10,rep(1,10))
frame()
does not terminate the plot. Rather it gives the message:
Warning message:
multiple pages used in postscript() with onefile=FALSE
and the plot is only complete after quitting R.
Is there some
2016 Aug 03
2
seq.int does not return a sequence of integers sometimes
I have a script that goes wrong because I assumed that seq.int would
return integers.
Below please see it does not unless user is super cautious about
inserting "L" with inputs. I think seq.int should do coercion for me
before returning the sequence.
> xx <- seq.int(1,10)
> class(xx)
[1] "integer"
> is.integer(xx)
[1] TRUE
> xx <- seq.int(1,10, 2)
>
2004 May 18
3
Help : trellis.device
Hi, R members.
I want to save plots. So I use the R as fallows :
--------------------------------
a <- c(1,10)
b <- c(1,10)
c <- c(2,20)
d <- c(2,20)
require(lattice)
trellis.device("bmp", file = "test.bmp", bg = "white")
print(plot(a,b))
print(plot(c,d))
dev.off()
--------------------------------
However, I got a image of plot(c,d).
I want to get a
2009 May 27
2
boxplot
Hi gues,
Is there any function in R for boxplot with different time points?
t1 <- c(rep(1,20),rep(2,20))
t2 <- c(rep(1,10),rep(2,10),rep(1,10),rep(2,10))
x <- rnorm(40,5,1)
dat <- data.frame(t1,t2,x)
boxplot(x~t1,t2)
Many thanks,
Amor
[[alternative HTML version deleted]]
2018 Apr 29
1
Result of 'seq' doesn't use compact internal representation
Thanks -- I'll commit a fix after some testing.
Best,
luke
On 04/29/2018 06:22 AM, Duncan Murdoch wrote:
> On 28/04/2018 11:11 PM, Suharto Anggono Suharto Anggono via R-devel wrote:
>>> .Internal(inspect(1:10))
>> @300e4e8 13 INTSXP g0c0 [NAM(3)]? 1 : 10 (compact)
>>> .Internal(inspect(seq(1,10)))
>> @3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
2010 Sep 07
1
average columns of data frame corresponding to replicates
Hi Group,
I have a data frame below. Within this data frame there are samples
(columns) that are measured more than once. Samples are indicated by
"idx". So "id1" is present in columns 1, 3, and 5. Not every id is
repeated. I would like to create a new data frame so that the repeated
ids are averaged. For example, in the new data frame, columns 1, 3,
and 5 of the original
2007 Jul 04
2
Adding data to existing plot with new=TRUE does not appear to work
Dear all,
I am trying to shove a number of cmdscale() results into a single plot
(k=1 so I'm trying to get multiple columns in the plot). From ?par I
learned that I can/should set new=TRUE in either par() or the plot
function itself. However with the following reduced code, I get only a
plot with a column of data points with x==2.
plot(1,10, xlim=range(0,3), ylim=range(0,10),
2018 Apr 29
2
Result of 'seq' doesn't use compact internal representation
> .Internal(inspect(1:10))
@300e4e8 13 INTSXP g0c0 [NAM(3)] 1 : 10 (compact)
> .Internal(inspect(seq(1,10)))
@3b6e1f8 13 INTSXP g0c4 [] (len=10, tl=0) 1,2,3,4,5,...
> system.time(1:1e7)
user system elapsed
0 0 0
> system.time(seq(1,1e7))
user system elapsed
0.05 0.00 0.04
It seems that result of function 'seq' doesn't use compact
2011 Sep 22
1
negative binomial GAMM with variance structures
Hello,
I am having some difficulty converting my gam code to a correct gamm code, and I'm really hoping someone will be able to help me.
I was previously using this script for my overdispersed gam data:
M30 <-gam(efuscus~s(mic, k=7) +temp +s(date)+s(For3k, k=7) + pressure+ humidity, family=negbin(c(1,10)), data=efuscus)
My gam.check gave me the attached result. In order to
2011 Jan 01
1
problem with postscript command
please, when i use the command postscript, the symbol "<="(less than or
equal to) is replaced by "..." (ellipsis)
how can I fix that?
postscript("plot1.ps", width = 22, height =
11.5,pointsize=24,paper="special",bg="transparent")
plot(NULL,xlim=c(1,10),ylim=c(1,10))
text(5,5,"\u2264")
dev.off()
I'm using
2004 Nov 08
2
Converting strings to date
Hello,
I have the following problem:
test is a data frame with 9 fields. The field test$Date is factorized with dates. The format is dd-mm-yyyy (using Oracle notation). I want to convert this to Date in '%Y-%m-%d format.
What I am doing is:
for (i in 1:nrow(test))
{
test[i,]$Data<-strptime(substring(test[i,]$Data,1,10),"%d-%m-%Y")
}
test is a data frame.
The error is:
2004 Apr 27
1
legend(1,1,expression(a<-"10^-6"))
hi all,
I have a problem with showing properly formated mathematical expressions
in a plot.
The following works:
plot(1:10)
legend(1,10, expression(10^-6))
Howver, if my expression is kept in a char variable, I don't know how to
show it in the legend.
# I have
st_"10^-6"
# I try to do this
plot(1:10)
legend(1,10, expression(st))
# which doesn't turn out as expected
Is it
2006 Oct 27
2
Question: xyplot panel configurations for Trellis package
Hi,
I am new to R community and I have a question on panel configurations in
the Trellis package.
Particularly, I have the following code:
require(lattice)
plotTable <- NULL
Date <- seq(as.Date("2006-11-01"), as.Date("2009-12-01"), by = 1)
nYear <- length(unique(format(Date,"%Y")))
plotTable$Date <- as.Date(paste(unique(format(Date, "%Y-%m")),
2013 Mar 28
2
how to search a list that contains multiple dissimilar vectors?
Dear All,
This is a simple question, but I'm stumped about the simplest way to search a list object such as the following:
This randomish snippet:
n <- c(round(runif(round(runif(1,1,10),0),1,10),0))
alist <- new("list")
for (i in seq_along(n)) {
alist[[i]] <- c(round(runif(round(runif(1,1,10),0),1,10),0))
}
names(alist) <- sample(letters[1:length(n)])
rm(n);c(alist)
2008 Oct 10
1
Asterisk CDR Analyser
Hi All,
I'm stuck and need some help. I have installed the Asterisk CDR
Analyser Version 2.0.1. It mostly works except for the CDR Report. I
get the following error even though it lists the CDR details.
Database error: Invalid SQL: SELECT substring(calldate,1,10) AS day,
sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE
UNIX_TIMESTAMP(calldate) >=
2016 Oct 08
1
[PATCH] drm/virtio: kconfig: Fixup white space.
Use tabs instead of spaces.
Signed-off-by: Peter Griffin <peter.griffin at linaro.org>
Acked-by: Lee Jones <lee.jones at linaro.org>
---
drivers/gpu/drm/virtio/Kconfig | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/virtio/Kconfig b/drivers/gpu/drm/virtio/Kconfig
index e1afc3d..81d1807 100644
--- a/drivers/gpu/drm/virtio/Kconfig
+++