[R] Greek letter included in a character vector

2010-09-10 Thread Judith Flores
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

[R] Adding a table to a plot area

2007-09-21 Thread Judith Flores
Is there a command to insert a table into the plot area other that using text? Thank you. Luggage? GPS? Comic books? __ R-help@r-project.org mailing list

[R] caTools package

2007-10-10 Thread Judith Flores
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

[R] Changing the text in the strips of lattice plots and y axis

2007-11-14 Thread Judith Flores
Dear R-helpers, I am sorry for asking something I know has been asked before, I have tried different combinations in the strip function without success... I am using version 2.5.1 and work on a PC. I have barcharts generated from the following formula: barchart(y1+y2+y3~x | g) I

[R] Sampling

2008-02-05 Thread Judith Flores
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 As and 12 Bs? Thank you, Judith Be a better

[R] Replacing a character string when finding substring match

2008-02-14 Thread Judith Flores
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,

[R] Retrieving data frames from a for loop

2008-02-14 Thread Judith Flores
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

[R] R console closes on its own

2008-02-20 Thread Judith Flores
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

[R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread Judith Flores
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

[R] Add a rectangle behind a plot

2008-02-26 Thread Judith Flores
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

[R] How to add 'specific length' segments to lattice plots

2008-08-08 Thread Judith Flores
Hello, I would like to add a horizontal line to each individual panel panel, the length of the segment is given by a vector. If you run the following lines (a very simplified version of my script and data): group-c('A','A','A','A','B','B','B','B','C','C','C','C')

[R] Open directory within a menu in tcltk

2008-08-18 Thread Judith Flores
Hello, I am trying to setup a menu to open files and directories. I have the following code: opendir-function() { dirname-tclvalue(tkchooseDirectory()) } openfile-function() { filename-tclvalue(tkgetOpenFile()) } require(tcltk) t1-tktoplevel() topMenu-tkmenu(t1)

[R] grep, gsub and metacharacters

2008-08-22 Thread Judith Flores
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

[R] What package to use to create a GUI

2008-07-15 Thread Judith Flores
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

[R] Function to verify existence of an R object

2008-07-16 Thread Judith Flores
Hello, is there a function to check if an object exists? Thank you, Judith __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Retrieving data from a tcl /tk function

2008-07-18 Thread Judith Flores
Hello, I am sorry if this is an answered question, but I did my homework for a long while and couldn't figure out a way to retrieve data entry from a model dialog. In one of the examples compiled by James Wettenhall: odalDialog - function(title, question, entryInit, entryWidth = 20,

[R] tklistbox and extracting selection to R

2008-07-22 Thread Judith Flores
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 ))

[R] Combining many csv files into one and adding a column with an id of each csv file read

2008-04-08 Thread Judith Flores
Dear R experts, I have been looking into the help-pages and old questions from the R-Help site, but the options offered there don't seem to work in my case. First of all, I am working on Windows XP, using R version 2.6.2. I am attaching two csv files as an example of how the data I am

[R] Using the 'by' function withing a 'for' loop

2008-04-21 Thread Judith Flores
Dear R experts, I am trying to optimize my script, because right now it requires a lot of memory. The goal is to generate four plots in one page. Every plot corresponds to the means and sem's calculated for a given variable at different days. In order to obtain the means and sem's I apply the

[R] Using the 'by' function within a 'for' loop

2008-04-22 Thread Judith Flores
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

[R] (no subject)

2008-04-23 Thread Judith Flores
Hello, I have been trying to apply some of the different ways suggested in the past to replace empty values in a vector for a letter, without success. Actually, I have a data frame that might contain empty values, I need to replace all those empty values for the letter 'N'. This was my

[R] Arranging multiple lattice plots in one page

2007-11-16 Thread Judith Flores
Hi, I am trying to arrange 3 different lattice plots in one page. I tried defining par and layout without success. What I wrote looks something like this: par(mfrow=c(3,1)) barplot(...) xyplot(...) barplot(...)

[R] Manipulating x axis in stripchart

2007-11-20 Thread Judith Flores
Hi all, I I need to manipulate the x axis in a stripchart. I will use one of the data sets included in R to explain what I need to do. attach(ToothGrowth) stripchart(len[supp=='VC']~dose[supp=='VC'], vertical=TRUE, group.names=c('A','A','A')) stripchart(len[supp=='OJ']~dose[supp=='OJ'],

[R] Dismiss previous email

2007-11-30 Thread Judith Flores
Sorry about that, it was sent by accident. I have a data frame that looks something like this: id dayk 56 -1 566 63 -1 680 73 -1 773 56 2 298 63 2 273 Of course, it is a very simplified version of the real data frame I am working on. I need to add another

[R] (no subject)

2007-11-30 Thread Judith Flores
Hi, I have a data frame that looks something like this: id dayk 656 -1 566 663 -1 680 673 -1 773 675 -1 761 704 -1 685 714 -1 636 717 -1 421 719 -1 645 727 -1 761 731 -1 663 11 735 -1 603 12 738 -1 865 13 742 -1 594 14 744

[R] Ordering the levels of a vector

2007-12-03 Thread Judith Flores
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

[R] Adding text outside lattice plot

2007-12-08 Thread Judith Flores
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

[R] Saving lattice plot as a PDF

2007-12-09 Thread Judith Flores
Hi there, I need to save a series of lattice plots as a PDF, this is my code so far: windows(height=8,width=6) plot.new() library('grid') lattice.options(layout.heights=list(top.padding=list(x=0.15, units=inches))) print(plot1, split=c(1,1,2,3), more=TRUE) print(plot2, split=c(1,2,2,3),

[R] Viewport and grid.draw

2007-12-09 Thread Judith Flores
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,

[R] Different display of same graphs on different screens

2007-12-13 Thread Judith Flores
Dear R-experts, I need to run a R code on different computers (MACs and PCs) on different monitos sizes. The code generates graphs that are displayed in the same page. But there are some elements of the graphs that appear at the right position on a PC, but they don't appear at all when I run

[R] Adding a table to a plot

2008-01-18 Thread Judith Flores
Hi R-experts, Is it possible to add a table (text and lines) to the plot area? I have a data frame that looks something like this: mydata Time SD Mean 12.5 30 2a.3 40 I am using R 2.6.1, in Windows. Thank you, Judith Flores

[R] Adding a table to a lattice plot

2008-01-22 Thread Judith Flores
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

[R] Grouping

2008-01-24 Thread Judith Flores
I need to group some subjects according to two variables (var1, var2) I have a data frame that looks something like this: Subject var1 var2 1 400150 2 320100 3 580600 4 145789 Each suject would fall into one of

[R] Histogram with lattice with two 'conditional' variables

2009-04-02 Thread Judith Flores
Hello dear R-community, I have been trying to figure out a way to generate histograms of a numeric variable observed in different entities ('individual' below). Each one of this entities is classified as A or B (according to the pseudo-code below): variable-sample(rep(1:10,10))

[R] Changing the y-axis units of a lattice histogram

2009-04-03 Thread Judith Flores
Hello, I need to multiply the number of counts in the y-axis of a lattice histogram by a constant factor, such that the plot would represent a different type of variable plotted in the y-axis, not counts. Can this be done? Thank you, Judith __

[R] Stacked density plots

2009-04-10 Thread Judith Flores
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

[R] How to mix different font styles in axis label of lattice plot?

2008-10-03 Thread Judith Flores
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

[R] Regular expression to define contents between parentheses

2009-08-25 Thread Judith Flores
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

[R] mgp.axis.labels

2011-04-06 Thread Judith Flores
Hello, I am trying to use mgp.axis labels to locate the x-xis at a different distance from the one specified for the y-axis. I know I could use other functions such as mtext or axis. But I am curious to know about how to use 'mgp'axis.labels' from the Hmisc package. I tried following the

[R] Reordering levels of a factor when the factor is part of a data frame

2012-02-06 Thread Judith Flores
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

[R] Superscripts in strip labels of lattice plot

2011-06-03 Thread Judith Flores
Hello, I need to add superscripts of the strip labels of a xyplot. For example: xyplot(a~b|c) Where c has 3 factor levels: A^2, A^3 and A^4. How can I introduce expressions in the strip labels? Thank you very much! Judith __

[R] Letter with tilde

2012-05-23 Thread Judith Flores
Hi,    I was unable to find documentation about how to include the letter 'n' with tilde above it, like this: ñ.    Is it possible to do that? Thank you, Judith [[alternative HTML version deleted]] __ R-help@r-project.org mailing list