similar to: Replecing empty values with a letter (continuation)

Displaying 20 results from an estimated 4000 matches similar to: "Replecing empty values with a letter (continuation)"

2008 Feb 05
6
Sampling
Hi there, I want to generate different samples using the followindg code: g<-sample(LETTERS[1:2], 24, replace=T) How can I specify that I need 12 "A"s and 12 "B"s? Thank you, Judith ____________________________________________________________________________________ Be a better friend, newshound, and
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
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
2010 Sep 10
1
Greek letter included in a character vector
Hello, In the past I have used "expression" to include greek letters in axis labels, but this time I need to include the greek letter as part of a legend. Basically, I need to create the following vector to rename the levels of a factor: c("Interferon-gamma", "IL-10", "IL-5"), where "gamma" obviously needs to be printed as the greek letter
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 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 ____________________________________________________________________________________
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
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,
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:
2009 Apr 10
2
Stacked density plots
Hello R-community, I want to generate stacked density plots in lattice. My data consist of a numeric variable ('pid') that is measured in different individuals ('id'), which can be divided in two types ('type') and the measurements were repeated a different time points ('day'). I read in the Lattice book that this can be done using the 'flowViz'
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
2008 Feb 14
2
Retrieving data frames from a for loop
Dear R-helpers, I need to retrieve the data frames generated in a for loop. What I have looks something like this: where tab is a pre-existing data frame. for (i in 1:20) { g<-sample(rep(LETTERS[1:2],each=10)) combination<-data.frame(tab,g) } I tried to name every single combination doing this: assign(paste('combination',i), combination) without success. I
2014 Sep 04
2
charset-specific searches, and continuation lines
Hi there, I'm looking into improving IMAP search support for the Gnus Emacs mail client, and trying to add the ability to search non-ascii characters. So far as I know, I start this invocation with something like: . UID SEARCH CHARSET UTF-8 TEXT {NNN} Where NNN is the number of bytes in my search string. Dovecot then responds with: + OK So... what do I do then? I don't actually know
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.
2007 Oct 10
1
caTools package
Hi, I tried to install the caTools package manually from the main R Project website and I get the following error message when typing library('caTools') Error in library("caTools") : 'caTools' is not a valid package -- installed < 2.0.0? What am I doing wrong? Also, why is this package not available in the list of packages for direct installation from the R
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 Oct 03
1
How to mix different font styles in axis label of lattice plot?
Hello, I have a y-axis label that reads: "S. schenckii yeast cells". The part that reads "S. schenckii" needs to be in italic style, the rest of the text is normal style. How can I specify the different font styles for each part of the y-axis label? Thank you, Judith