Re: [R] R tcl/tk

2006-10-24 Thread JeeBee
. Then, you need to learn the interface between R and Tcl for which there's a nice (easy to find with Google) pdf document. If you really cannot find it, I'll look it up for you. JeeBee. On Mon, 23 Oct 2006 12:11:40 -0200, Alberto Monteiro wrote: This must be dumbest question ever asked

Re: [R] variables with dynamic names?

2006-10-24 Thread JeeBee
You can use list.files to obtain the file names, see ?list.files Read the comma seperated values files with read.cvs, see ?read.csv JeeBee. On Tue, 24 Oct 2006 13:33:42 +0200, Antje wrote: Hello, I have the following problem. I have a set of CSV files and they are named for a special

[R] tcltk: multiple listboxes, selection

2006-10-21 Thread JeeBee
Dear list, I have multiple (BWidget) listboxes in the same toplevel window. The problem is, if I select (by left clicking) on one of those listbox elements, the current selection in the *other* listboxes is cleared! Anybody knows how I can prevent this? Here's my code (sorry not complete): (E.g.

Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee
Sorry, the plot_linetypes[1] is a debugging leftover. It's plot_linetypes[graph_idx] in my actual code ... And plot_linetypes is just the sequence 1,2,3,4... etc plotCI( x = xvals.f[sorted], y = yvals.f[sorted], xlim = c(xmin, xmax), ylim = c(ymin, ymax), pch =

Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee
Thanks, I tried using plotCI in the plotrix library. This, however, gives me the below error. CODE:: cat(x = ); print(xvals.f[sorted]) cat(y = ); print(yvals.f[sorted]) cat(pch = ); print(plot_symbols[graph_idx]) cat(lty = ); print(plot_linetypes[graph_idx]) cat(col

Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee
Great, why didn't I think of that. Thanks :) If you want to add lines as well as points, I think you will have to use lines(x,y,type=b,lty = plot_linetypes[graph_idx]) in addition to plotCI, __ R-help@stat.math.ethz.ch mailing list

Re: [R] What is the matrix version of min()

2006-09-06 Thread JeeBee
see ?apply min.row - apply(X, 1, min) min.col - apply(X, 2, min) JeeBee On Wed, 06 Sep 2006 01:37:22 -0700, Tong Wang wrote: Hi, Is there a function which operates on a matrix and return a vector of min/max of each rol/col ? say, X= 2, 1 3, 4 min.col(X)=c(2,1

Re: [R] winDialog UNIX equivalent?

2006-09-06 Thread JeeBee
Yes, there are many. To give one example, you could consider using tcltk. library(tcltk) tkmessageBox(title=This is terrible, message=What did you do?\nPromise not to do this again!, icon=error, type=ok) On Tue, 05 Sep 2006 23:10:41 +0200, Richard Müller wrote: Hi all,

Re: [R] histogram in the background?

2006-09-06 Thread JeeBee
How about this? http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=78 JeeBee On Wed, 06 Sep 2006 18:19:28 +0800, gallon li wrote: I intend to draw a plot of y against x. In the background of this graph I wish to creat a histogram of the horizontal variable x. Does any expert

Re: [R] plot axises on both sides of a graph

2006-09-06 Thread JeeBee
Look at: ?axis (try the examples) Further, a nice example I found on this mailing lists archive, from somebody who says this has been asked many times already :) x - 1:10 y1 - 1:10 y2 - rev(seq(1,1000, length=10)) plot(x,y1,ann=FALSE) axis(2, at=c(2,4,6,8), labels=as.character(c(2,4,6,8)))

Re: [R] histogram in the background?

2006-09-06 Thread JeeBee
gallon li wrote: I have found this one before. However, my intension is slightly differing from this plot: I wish to plot the histogram in the backgroun instead of in the margin. Thanks anyway! On Wed, 06 Sep 2006 12:29:51 +0200, JeeBee wrote: How about this? http://addictedtor.free.fr

Re: [R] Fwd: plot axises on both sides of a graph

2006-09-06 Thread JeeBee
See these two examples. plot(1:2) axis(4) mtext(right y axis, side=4, line=-1.5) par(mar=c(5,4,4,5)+.1) plot(1:2) axis(4) mtext(right y axis, side=4, line=3) Good luck finding the right combination again ;) On Wed, 06 Sep 2006 20:08:43 +0800, gallon li wrote: -- Forwarded message

Re: [R] tk combobox question

2006-08-09 Thread JeeBee
I think you want something like this: require(tcltk) || stop(Package tcltk is not available.) version.BWidget - tclvalue(tclRequire(BWidget)) modify_command - function() { print(Hey, I'm modified...) } tt - tktoplevel() values = c(foo, bar, jeebee) combo - tkwidget(tt

[R] Interpretation of call to aov()

2006-08-05 Thread JeeBee
* problem) ? Thanks in advance, JeeBee. __ R-help@stat.math.ethz.ch 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 commented, minimal, self-contained

Re: [R] Interpretation of call to aov()

2006-08-05 Thread JeeBee
Or, perhaps I can use Error(subject/(method * problem)) where subject = paste(method, problem) Because I repeated each simulation several times for different problems of the same problem. This gives me the following output: summary(aov(performance ~ method * problem + Error(subj/(method *

Re: [R] question

2006-08-05 Thread JeeBee
Hi Jessica, I think you want to use names() See: ?names ?colnames (or rownames) If not, it's perhaps a good idea to send us a more complete example. JeeBee. On Fri, 04 Aug 2006 17:12:24 +0200, Jessica G. wrote: How to convert a rowname vector of numbers into a real column of the matrix

Re: [R] Extracting a row number from a matrix

2006-08-01 Thread JeeBee
so in the following example (single column, but my real data has multiple columns) how do I get the row number of the last row of x beyond which there are 10 or more 0's (which in this case is row#100). x - as.matrix(c(rep(seq(1:20),5),rep(0,20))) max( which(x 0) ) JeeBee

Re: [R] How to convert two-dimensional function to matrix?

2006-08-01 Thread JeeBee
- matrix( data = NA, nrow = 5, ncol = 4 ) ) ( m - f(row(m), col(m)) ) JeeBee. __ R-help@stat.math.ethz.ch 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

Re: [R] convert decimals to fractions - sorted

2006-07-28 Thread JeeBee
] # Add the column with the fractions tmp2 - cbind(tmp1, fracs=as.character(as.fractions(as.numeric(as.character(tmp1$V2) # Finally hide that sort colum if you want ( tmp2[-2] ) # Everybody happy? JeeBee __ R-help@stat.math.ethz.ch mailing

Re: [R] convert decimals to fractions - sorted

2006-07-26 Thread JeeBee
Hi Muhammad, How about this? at - read.table(textConnection(a)) at2 - cbind(at, jeebee=as.character(as.fractions(as.numeric(at[,2] sort.order - order(at2$V2) at2[sort.order,] at2[sort.order,c(1,3)] JeeBee. __ R-help@stat.math.ethz.ch mailing

[R] tkbutton command - how to know which button was clicked?

2006-06-30 Thread JeeBee
. Thanks, Jeebee. for(rek in seq(1,nrow(rekeningen))) { arg - rekeningen$rekening[rek] tkgrid(tkbutton(frame.1, text=paste(Saldo historie, arg), command=function() print(arg)), sticky=news) } __ R-help@stat.math.ethz.ch mailing

Re: [R] apply a function to several lists' components

2006-06-30 Thread JeeBee
Maybe this helps ( data1 = list(a=c(1,2), b=c(3,4), c=c(5,6,7)) ) ( data2 = list(a=c(10,11), b=c(30,40), c=c(70,80)) ) cc - NULL for(data in ls(pattern=^data[0-9]+$)) { cc - c(cc, with(get(data), c)) } mean(cc) JeeBee. On Fri, 30 Jun 2006 09:50:51 -0500, Taka Matzmoto wrote: Dear R-user

Re: [R] Basic NA handling problem

2006-06-22 Thread JeeBee
Try this: help.search(interpolate) Then find this: library(zoo) na.approx(x) [1] 1.0 4.0 5.0 8.0 6.0 4.0 4.5 5.0 5.0 1.0 2.0 7.0 8.0 9.0 10.5 [16] 12.0 13.5 15.0 6.0 8.0 Hth, JeeBee. On Thu, 22 Jun 2006 06:54:53 +0100, Sumanta Basak wrote: Hi All, I need your help

[R] Some R-Tcl/Tk-BWidget newbie questions.

2006-06-21 Thread JeeBee
, JeeBee. require(tcltk) || stop(Package tcltk is not available.) # Add path to BWidgets addTclPath(.) version.BWidget - tclvalue(tclRequire(BWidget)) start.gui - function() { # Toplevel tt - tktoplevel() tkwm.title(tt, MyTitle) # Notebook ### -- The following line makes R hang with 100

[R] R with tcl/tk 8.5

2006-06-15 Thread JeeBee
Hi List, Is it possible to tell R to use tcl/tk 8.5? My R package seems to depend on libtcl8.4.so. However, in Windows it seems to be possible to set TCL_LIBRARY and MY_TCLTK. Is there something similar possible in Linux? I have installed: $ rpm -q R R-2.3.1-1.fc5 $ locate libtcl8

Re: [R] Compact sums in functions definitions

2006-06-15 Thread JeeBee
in case length(x) is not a multiple of length(arr). (or the other way around if arr was longer than x) I made a nice one for you: g - function(x) rowSums( t(t(1/x)) %*% arr ) It is likely someone else can do it much nicer (shorter), my R knowledge still has to be increased ... JeeBee. On Thu, 15 Jun

Re: [R] Compact sums in functions definitions

2006-06-15 Thread JeeBee
Slightly better: h - function(x) rowSums( as.matrix(1/x) %*% arr ) On Thu, 15 Jun 2006 19:41:12 +0200, JeeBee wrote: Hi Alessandro, The problem is that arr/x isn't quite doing what you thought it was. arr / x is something like c(arr[1] / x[1], arr[2] / x[2], arr[1] / x[3

[R] case insensitive regular expression

2006-06-05 Thread JeeBee
) works, but it does not match J. TEST. It does match J. Test correctly. I have the feeling I'm not reading the documentation good enough, but cannot seem to figure this out, sorry. Thanks in advance, JeeBee. __ R-help@stat.math.ethz.ch mailing list

Re: [R] case insensitive regular expression

2006-06-05 Thread JeeBee
Found the problem already. Without the 'with' it works, so I know where to look for the problem now. Thanks anyways, JeeBee. On Mon, 05 Jun 2006 15:16:34 +0200, JeeBee wrote: Can anybody fix the following, to match a string disregarding case? I tried: with(my.data.frame, regexpr(pattern

[R] several plots in one

2006-02-01 Thread JeeBee
,] xlim = c(0,100), #ylim = c(0.2,0.5), ylab = System welfare, pch = 7, col = c(red,blue), type = b, uiw = cbind(uiw1,uiw2)) Thanks in advance, JeeBee. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] date handling

2005-12-13 Thread JeeBee
$yday+7)/7)) JeeBee On Mon, 12 Dec 2005 12:59:11 +0100, Richard van Wingerden wrote: Hi, Given a frame with calendar date's: 2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05,etc. I want to extract the following from these dates: week number month number year number Any

Re: [R] How to make a plot?

2005-12-13 Thread JeeBee
if someone will show you an example ;) JeeBee. On Tue, 13 Dec 2005 08:32:15 -0500, Gabor Grothendieck wrote: Does anyone have an idea of how to make a chart in R like the ones here that use a graphic: http://bigpicture.typepad.com/comments/images/slide1.gif

Re: [R] sample matrix as a new object

2005-12-13 Thread JeeBee
') JeeBee. On Tue, 13 Dec 2005 11:31:33 -0300, Carlos Mauricio Cardeal Mendes wrote: Please, I´d like to store this sample matrix as a new object. How can I do this ? pulse - c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 72, 72, 73, 74) m - NULL x - 0 for (i in 1:5) { x

Re: [R] Help on a matrix task

2005-12-06 Thread JeeBee
Here is one possible solution: for(cr in seq(1, dim(combin_mat)[2])) { W = which(input_mat[,combin_mat[1,cr]] == 1 input_mat[,combin_mat[2,cr]] == 1) cat(Combination, cr, (, combin_mat[,cr], ) :, W, \n) } JeeBee. --- Full program: N = 4 input_numbers = seq((2^N)-1, 0, -1

Re: [R] hamming distance

2005-11-24 Thread JeeBee
You could install.packages(e1071) and see help(hamming.distance) JeeBee. hamming.distancepackage:e1071R Documentation Hamming Distances of Vectors Description: If both 'x' and 'y' are vectors, 'hamming.distance' returns the Hamming distance (number of different

[R] write.table read.table with Dates

2005-11-10 Thread JeeBee
I've found several similar issues with write.table/read.table with Dates on this list, but trying to follow this advice I still get an error. First, I read in data from several files, constructing several date/time columns using ISOdatetime str(Tall$Begin) 'POSIXct', format: chr [1:40114]

Re: [R] write.table read.table with Dates

2005-11-10 Thread JeeBee
I see that strptime returns a list of year, mon, mday, hour, min, sec, etc. The following works for me (for each column that is a date/time field in my imported file) cat(Converting date/time fields...\n) Q = strptime(as.character(data$myfield), format=%Y-%m-%d%H:%M:%S) data$myfield =