search for: 1,10

Displaying 20 results from an estimated 629 matches for "1,10".

Did you mean: 1,102
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,...
2009 Jan 25
1
[Fwd: Re: evaluation question]
...ct my explanations. (i'd like to add that much as i'm happy to receive and answer offline mails, questions related to r are best sent directly to the list, where the real experts are.) -------- Original Message -------- Subject: Re: evaluation question Date: Sun, 25 Jan 2009 20:32:22 +0100 xxx wrote: <snip> > Someone sent in an example a few days ago showing that prac1 ( see > below ) doesn't work. Then someone else sent two different > ways of fixing it. > I'm still slightly confused. <snip> > > > x<-1:10; > y<-rnor...
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", header=TRUE, sep="\t") #if I take a look at the...
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 image of plot...
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 probabi...
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=...
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) > class(xx) [1] "numeric" > is.integer(xx) [1] FALSE > xx <- seq.int(1,10, 2L) > class(xx) [1] "numeric" > is.integer(xx) [1] FALSE > xx <- seq.int(1L,...
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
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...
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
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,...
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 windows vista, my system is in English, R v2.8.1 thanks, Victor
2009 Jan 16
1
Lattice: how to have multiple wireframe nice intersection?
Hello, This code builds a simple example of 2 wireframes : require(lattice) x <- c(1:10) y <- c(1:10) g <- expand.grid(x = 1:10, y = 1:10, gr = 1:2) g$z <- c(as.vector(outer(x,y,"*")), rep(50,100)) wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE)) However, the intersection between the wireframes is not properly drawn. Is there a way...
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 will be replaced by 1 new column that is the mean of these three. Thanks for an...
2011 Sep 22
1
negative binomial GAMM with variance structures
...ving 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 deal with my heterogeneity, I need to switch over to a gamm structure and use at least one, but possibly multiple, variance structures, and I am starting by applying varPower to my temperature covariate. (Efuscus is my...
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: Error in "$<-.data.frame"(`*tmp*`, "Data", value = list(sec = 0, min = 0, : replacement has 9 rows, data has 1 But if I do:...
2012 Feb 23
1
FW: NaN from function
...to standardise variables if they contain more than one value. If the elements of the variable are all identical, then I want the function to return zero. When I submit variables whose elements are all identical to the function, it returns not zero, but NaNs. zt=function(x){if (length(table(x)>1)) y=(x-mean(x))/sd(x) else if (length(table(x)==1)) y=0; return(y)} zt(c(1:10)) #[1] -1.4863011 -1.1560120 -0.8257228 -0.4954337 -0.1651446 0.1651446 0.4954337 0.8257228 1.1560120 1.4863011 zt(rep(1,10)) #[1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN Would you be so kind as to point out what...
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 possible to convert a...
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")), "-01",sep = "")) nDate <- length(plotTable$Date) plotTable$Date <- rep(plotTable$Date, e...
2002 Jun 19
3
unexpected results
Is R behaving correctly in this example? I do not understand why column 2 has any 2s in it (and why column 3 has any 1s) > x<-matrix(0,10,3) > x[seq(1,10,by=2),2:3]<-c(1,2) > x [,1] [,2] [,3] [1,] 0 1 2 [2,] 0 0 0 [3,] 0 2 1 [4,] 0 0 0 [5,] 0 1 2 [6,] 0 0 0 [7,] 0 2 1 [8,] 0 0 0 [9,] 0 1 2 [10,] 0...