similar to: Looping and paste

Displaying 20 results from an estimated 6000 matches similar to: "Looping and paste"

2000 Apr 24
2
paste ?
Dear friends. I've made a very simple procedure to make Bland-Altman plots and it works OK except for the inability to take a variate as argument in annotation. I'm sure it is a very simple error, so if you have 5 seconds please tell me. Best wishes Troels bland <- function (x) #accepts two columns { mn <- 0.5*(x[,1]+x[,2]) diff <- x[,1]-x[,2]
2011 Aug 19
2
Auto key legend does not match plot
Dear R-help members. I am an 'R-learner' (about 6 hours so far) using the lattice library to create a ranked dotplot and am colour coding the dots by a variable called "Commodity". However when i use autokey to make a legend the size (cex) and symbol (pch) do not match what is on the dotplot. Code is below and image attached library("lattice") Cal_dat <-
2003 May 21
1
Code Help
I am trying to analyse some data and was given R code to do this with but there seem to be errors in the code. My level of knowledge is improving but still limited. The details are; Data on clover lines; Lines.txt attached. Comma seperations Code: options(digits=3) clover <- read.table("Lines.txt",header=T,sep=",") vnames <- names(clover);nv <- length(vnames)
2011 Sep 15
1
Move the main titel to the left of the plot
Dear R helpers I wish to move the main title, which appears on a dotplot to be right aligned with the left axis. Is there are parameter associated with dotplot 'main' that allows the title to be placed where I want it? Code snippet relating to dotplot is below. with(Cal_dat, dotplot(reorder(paste(Mine,Company), Resc_Gt) ~ Resc_Gt, fill_var = Commodity,
2011 Oct 04
1
Plotting a polygon with xyplot
Dear R helpers I would like to plot a string of points as a polygon in xyplot. I'm a bit lost as to how to get the points plotting in the correct order. I would also like some hints on how to render or fill the polygon. Scrpt below and data file attached Thanks Markm library("lattice") # set size of the window windows(height=7, width=10,rescale=c("fixed"))
2005 Jul 05
1
by (tapply) and for loop differences
I am getting a difference in results when running some analysis using by and tapply compare to using a for loop. I've tried searching the web but had no luck with the keywords I used. I've attached a simple example below to illustrates my problem. I get a difference in the mean of yvar, diff and the p-value using tapply & by compared to a for loop. I cannot see what I am doing wrong.
2011 Sep 15
1
Move the x-axis labels to the top of the dotplot
Dear R helpers I would like to move the x-axis labels, which plot automatically at the base of a dot plot to the top of the plot. Is there a way to do this? Code snippet below with(Cal_dat, dotplot(reorder(paste(Mine,Company), Resc_Gt) ~ Resc_Gt, fill_var = Commodity, pch_var = factor(Year), xlab_var = factor(Company), pch = c(21, 22, 23),
2006 Nov 09
3
function
R-help, I am trying to create a function that i pass a data set to and have the function return some calculations based on data. Allow me to illustrate: myfunc <- function(lst,mn,sd){ lst <- sort(lst) mn <- mean(lst) sd <- sqrt(var(lst)) return(lst,mn,sd) } data1 <-c (1,2,3,4,5) data2 <- c(6,7,8,9,10) myfunc(data1,data1mn,data1sd) myfunc(data2,data2mn,data2sd)
2017 Sep 27
2
after hard reboot, split-brain happened, but nothing showed in gluster voluem heal info command !
HI gluster experts, I meet a tough problem about ?split-brain? issue. Sometimes, after hard reboot, we will find some files in split-brain, however its parent directory or anything could be shown in command ?gluster volume heal <volume-name> info?, also, no entry in .glusterfs/indices/xattrop directory, can you help to shed some lights on this issue? Thanks! Following is some info from
2011 Aug 25
1
Sorting order of reorder with multiple variables
I've been building a ranked dot plot for several days now and am sorting the data using the reorder command. What I don't understand is how reorder works when mutiple varibles are plotted by grouping. In the example below I'm using re-order to sort by a variable name Resv_Prop, but I'm plotting up to three different values of Resv_prop (different Year values) for each factor.
2007 Jun 29
2
regexpr
Hi, I 'd like to match each member of a list to a target string, e.g. ------------------------------ mylist=c("MN","NY","FL") g=regexpr(mylist[1], "Those from MN:") if (g>0) { "On list" } ------------------------------ My question is: How to add an end-of-string symbol '$' to the to-match string? so that 'M' won't
2017 Jun 06
1
integrating 2 lists and a data frame in R
Here's another approach: N <- data.frame(N=c("n1","n2","n3","n4")) M <- data.frame(M=c("m1","m2","m3","m4","m5")) C <- data.frame(n=c("n1","n2","n3"), m=c("m1","m1","m3"), I=c(100,300,400)) # Rebuild the factors using M and N C$m <-
2007 Jun 19
1
Linear model predictions, differences in class
Hi, I am using R to fit statistical models to data were the observations are means of the original data. R is used to calculate the mean before fitting the model. My problem is: When R calculates the means using tapply, the class of the means differs from the class of the original data, which gives me trouble when I want to use the original data to calculate model predictions. Here is a simple
2012 Oct 26
1
matrix algebra for constructing a special matrix?
Dear R-users, would it be a better way to construct the matrix below without using any for-loop or model.matrix? preferably with some matrix algebra? Thanks in advance, Carlo Giovanni Camarda ## dimensions m <- 3 n <- 4 mn <- m*n k <- m+n-1 ## with a for-loop X <- matrix(0, mn, k) for(i in 1:n){ wr <- 1:m+(i-1)*m wc <- rev(1:m+(i-1)) where <- cbind(wr,wc)
2017 Sep 28
0
after hard reboot, split-brain happened, but nothing showed in gluster voluem heal info command !
Hi, To resolve the gfid split-brain you can follow the steps at [1]. Since we don't have the pending markers set on the files, it is not showing in the heal info. To debug this issue, need some more data from you. Could you provide these things? 1. volume info 2. mount log 3. brick logs 4. shd log May I also know which version of gluster you are running. From the info you have provided it
2009 Jun 29
1
Printing output together
Hi!   I want to print the output all together with a single column name   s21<-c(1:1000); var21<-lapply(s21,function(x){    ns<-rnorm(78,8,9);    n<-length(ns);    Mn<-mean(ns)    Sn2<-var(ns)    return(cbind(x,Mn,Sn2)); }); var21 but my code is giving me somewhat like the following [[1]] x   Mn          Sn2   [1,] 1 7.86 10.56540 [[2]] x   Mn          Sn2  
2017 Sep 28
2
after hard reboot, split-brain happened, but nothing showed in gluster voluem heal info command !
Hi, Thanks for reply! I?ve checked [1]. But the problem is that there is nothing shown in command ?gluster volume heal <volume-name> info?. So these split-entry files could only be detected when app try to visit them. I can find gfid mismatch for those in-split-brain entries from mount log, however, nothing show in shd log, the shd log does not know those split-brain entries. Because there
2008 Apr 22
3
Using the 'by' function within a 'for' loop
Dear R experts, I am sorry for sending this email again. I would imagine yesterday and maybe today, have been very busy days with the release of R v 2.7.0. I join all the R users who are very gratful for your contant work and efforts, specially knowing that you are doing this for the sake of science, without gettig any compensation for that. Having written that, I decided to send the
2017 Sep 28
0
after hard reboot, split-brain happened, but nothing showed in gluster voluem heal info command !
On Thu, Sep 28, 2017 at 11:41 AM, Zhou, Cynthia (NSB - CN/Hangzhou) < cynthia.zhou at nokia-sbell.com> wrote: > Hi, > > Thanks for reply! > > I?ve checked [1]. But the problem is that there is nothing shown in > command ?gluster volume heal <volume-name> info?. So these split-entry > files could only be detected when app try to visit them. > > I can find
2018 Jan 30
0
Simulation based on runif to get mean
On 1/29/2018 9:03 PM, smart hendsome via R-help wrote: > Hello everyone, > I have a question regarding simulating based on runif.? Let say I have generated matrix A and B based on runif. Then I find mean for each matrix A and matrix B.? I want this process to be done let say 10 times. Anyone can help me.? Actually I want make the function that I can play around with the number of simulation