similar to: Sampling

Displaying 20 results from an estimated 10000 matches similar to: "Sampling"

2008 Apr 23
2
Replecing empty values with a letter (continuation)
Sorry, I hit the send botton by accident. Here is my code so far: dat<-read.csv('myfile.csv', na.strings="") dat[is.na(dat]<-'N' But it doesn't replace the <NA> for the letter 'N'. I am using R v 2/7/0, running it under Windows XP. Thank you, Judith
2008 Feb 26
2
Multiple lines with a different color assigned to each line (corrected code)
Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type="n") for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) } Thank you, Judith ____________________________________________________________________________________
2007 Dec 03
3
Ordering the levels of a vector
Hi, I have a vector in a data frame that looks something like this: day<-c('Day -1','Day 6','Day 10') This vector specifies the order in which several panel will appear in a lattice plots. But the order in which such plots will appear will be the following: Day -1, Day 10, Day 6. Which makes sense, but I cannot name the Days like this: Day -01,Day 10, Day 06,
2009 Aug 25
3
Regular expression to define contents between parentheses
Hello dear R-helpers, I haven't been able to figure out of find a solution in the R-help archives about how to delete all the characters contained in groups of parenthesis. I have a vector that looks more or less like this: myvector<-c("something (80 km/h, sd) & more (6 kg/L,sd)", "somethingelse (48 m/s, sd) & moretoo (50g/L , sd)") I want to extract all
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
2007 Dec 10
2
Viewport and grid.draw
Hi Deepayan and everyone, I need to add a common legend to a group of latice graphs, I have tried different ways using viewport and grid.draw without success. Here is what I have: plot.new() library(grid) library('IDPmisc') print(plot1, split=c(1,1,2,4), more=TRUE) print(plot4, split=c(2,1,2,4), more=TRUE) print(plot2, split=c(1,2,2,4), more=TRUE) print(plot5, split=c(2,2,2,4),
2008 Jul 15
1
What package to use to create a GUI
Hello dead R-experts, I work on x86_64-suse-linux and I am using R 2.7.1. I created several scripts that will be used by several people that are not familiar with R. I would like to create a GUI to call the scripts that the users would choose to run, also, the GUI should allow them to choose the directories where their raw data resides, the scripts will be fed with such raw data. My
2007 Jun 06
1
Removing vertical line in Tinn R editor
Hi, I haven't been able to figure out how to remove a vertical line that appears when I open an r file. How can I do this? Thank you, Judith ____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
2008 Aug 22
1
grep, gsub and metacharacters
Hello, I have an expression that I want to substitute for something else. myvector<-c("ajkhfkiuwe","Variable(kg/min)") if I use the following code to extract "variable(kg/min)" and substitute it for "va" gsub(myvector[grep("var", myvector, ignore=T)], "va", myvector) grep identifies the element of the vector that matches my
2008 Feb 14
1
Replacing a character string when finding substring match
Dear R-experts, I need to replace the values of a vector(tx) with a word ('Vehicle') when the value of the vector contains the word 'vehicle'. Sometimes, the value could be 'MCT vehicle', or 'control-vehicle', etc. I tried gsub like this treatment<-gsub('vehicle','Vehicle', tx, ignore.case=T) But then I end up with values like 'MCT
2008 Jul 22
1
tklistbox and extracting selection to R
Dear experts, I am trying to understand why is it that when I paste (into the R console) the following code to select an option from a list: require(tcltk) tt<-tktoplevel() tl<-tklistbox(tt,height=ntx,selectmode="single",background="white") tkgrid(tklabel(tt,text="Select the legend of" )) tkgrid(tl) treatments<<-levels.tx for(i in
2008 Feb 21
3
R console closes on its own
Dear R-experts, I am running a script that has the following structure: windows(height=5.5,width=8) dat<-read.csv("myfile.csv") names(dat)<-c('a','b','c','d') dat<-dat[,1:4] xyplot(dat$a~dat$b) Then I usually save the plot as a PDF (from the menu in the R console). I can save the PDF twice in a row; but at the third time, right when I
2007 Jun 13
2
Removing Inf and Inf values from a fata frame
Hi, I have a csv file with empty values, when I apply the different functions (mean, std, etc.) I create a new data frame, the empty values generate Inf and -Inf values. How can I remove those Inf and -Inf values from the new data frame? I already specified na.rm in the mean and std functions, but the values are still there. Thank you, Judith
2007 Jul 02
2
Substitution of Variables
Hi, I need to run a script under the variable (that comes from a csv file) that is assigned to another variable. This is very a simplified version of what I want to do: data<-read.csv('name.csv') names(data)<-("VA","VB","VC") v<-VA mn(v) Thank you in advance, Judith
2008 Feb 27
2
Add a rectangle behind a plot
Hi there, I found one reference to add a reactangle behind a plot using plot(...,add=T), I tried this but didn't obtain the desired result. If a I have the following code: plot(x,y) rect(xleft, ybottom, xright,ytop,col='green) The rectangle appear on top of the plot. Any help will be greatly appreciated, Judith
2005 Mar 25
3
Stratified bootstrap question
Dear experts, I am asking for help with a question regarding to stratified bootstrap. My dataset is a longitudinal dataset (3 measurements per person at year 1, 4 and 7) composed of multiple clinic centers and multiple participants within each clinic. It has missing values. I want to do a bootstrap to find the standard errors and confidence intervals for my variance components. My model is a
2007 May 22
4
Legend outside plotting area
Hi, I have been trying many of the suggested options to place a legend outside plotting area, including something like this: par(xpd=T, oma=par()$oma+c(4.5,0,1.5,0),mar=par()$mar+c(1,0,1,0) But the aspect of the four plots gets compromised when I change the margin settings. I cannot use mtext because I need to use colors for the text. I tried layout, but wouldn't let me include
2012 Feb 06
2
Reordering levels of a factor when the factor is part of a data frame
Hello R-users,    I have a data frame whose names of columns I don't know a priori, but the user of my code will know them. The user is supposed to save the name of the column that will need some reordering of the levels of the factor later on. The name of the column will be saved in an object called: variab the data frame is called df. If I try to the do following:
2007 Dec 09
1
Adding text outside lattice plot
Hello, I need to add some text in the upper left position, outside a lattice plot. xyplot(x~y) ltext(locator(1), label='My text') doesn't work. I would appreciate any help. Tahnk you, Judith ____________________________________________________________________________________ Be a better friend, newshound, and
2008 Jan 22
1
Adding a table to a lattice plot
Hi, Is there an analog function of textplot in the lattice package? I need to add a data frame to a lattice plot. I work in a Windows environment and I am using R v 2.6.1 Thank you, Judith ____________________________________________________________________________________ Be a better friend, newshound, and