similar to: Me again, about the horrible documentation of tcltk

Displaying 20 results from an estimated 1000 matches similar to: "Me again, about the horrible documentation of tcltk"

2002 Sep 26
3
tcltk - command=function()
hi, just having the idea create a simple tcl/tk gui-dialog for different data-file formats i get starting problems and it would be nice get some tips/tricks from experienced tcl/tk user in R ! tt <- tktoplevel() label.widget <- tklabel(tt,text="Decision Tree GUI") button.widget <- tkbutton(tt,text="Select SPSSFile", command=function()
2003 Jan 20
1
curious code mistakes
hi, know anybody why this happen ? I''m using winedt , the old code saved in an .R call syntax error''s. Curious is, when i''m type below the same code , it works ??? ...imho a print type problem, what i''m never before observed and can''t recognize with my eyes ? P.S. R.1.6.1 /w2k thanks for advance & regards,christian >>getfile <-
2008 Sep 17
1
trouble with tkgetOpenFile
I'm trying to use the following loop to open a window multiple times to select files, but only the last window shows up. What am I missing? library(tcltk) nWin <- 6 fn <- vector('list', nWin) for (ii in nWin) { fn[[ii]] <- tclvalue( tkgetOpenFile( filetypes = "{{Files} {.1D}} {{All files} *}", title = paste('Choose number', ii, 'time
2008 Apr 29
4
XML write?
Is there any function to write a XML structure, after it was read using xmlTreeParse? Ex: library(XML) x <- xmlTreeParse("Irpf2008/aplicacao/dados/12345678901/12345678901.xml") # write it... Alberto Monteiro PS: please, brazilians, don't be offended by my foul language!
2006 Oct 07
3
ifelse(logical, function1, function2) does not work
Why this kind of assignment does not work? n <- 1 f <- ifelse(n == 1, sin, cos) f(pi) this must be rewritten as: n <- 1 f <- cos if (n == 1) f <- sin f(pi) [oops. 1.224606e-16 instead of zero. Damn floating point errors :-/] Alberto Monteiro
2008 Aug 18
2
A doubt about "lm" and the meaning of its summary
I have a conceptual problem (sort of). Maybe there's a simple solution, maybe not. First, let me explain the test case that goes ok. Let x be a (fixed) n-dimensional vector. I simulate a lot of linear models, y = m x + c + error, then I do a lot of regressions. As expected, the estimated values of m (let's call them m.bar) are distributed according to a Student's t distribution.
2007 Sep 17
3
Histogram with colors
Is there a simple way to plot a histogram with colors? For example, suppose I generate random points in the N(2,1) distribution: x <- rnorm(100000, mean = 2, sd = 1) Now I would like to plot the histogram: hist(x) but I would like to show the bars with x < 0 in red, and the bars with x >= 0 in lightgreen. Is there any simple way to do it? I think I can do it in two steps:
2007 Mar 23
5
Get "home" directory and simple I/O
Is there any generic function that gets the "home" directory? This should return /home/<user> in Linux and x:/Documents and Settings/<user> (or whatever) in Windows XP. Another (unrelated) question: what is the _simplest_ way to read and write R variables to/from files such that they are stored in a human-readable but R-like form? For example, if (say), x is a vector
2008 Apr 18
3
Function redefinition - not urgent, but I am curious
This is just my curiousity working. Suppose I write: f1 <- function(x) x + 1 f2 <- function(x) 2 * f1(x) f2(10) # 22 f1 <- function(x) x - 1 f2(10) # 18 This is quite obvious. But is there any way to define f2 in such a way that we "freeze" the definition of f1? f1 <- function(x) x + 1 f2 <- function(x) # put something here 2 * f1(x) # probably put something else here
2003 Aug 15
1
menubutton don´t work
Why the variable archOp does not take the value that be chosen in the menubutton?, therefore always remains as a white one, I intend to charge the direccion of open files in a vector and then to elect with the menubutton with which to work but not functions thanks.Ruben library(tcltk) arch<-tclVar(init=" ") archOp<-tclVar(init=" ") vectPath<-c()
2006 Oct 05
5
[Fwd: Re: Block comments in R?]
Ooops! Sorry, I send it only to Uwe Ligges the first time. Best, Philippe Grosjean This is perhaps another solution, more elegant in the way the block comment is written... but it requires to redefine `!` and slows it a little bit because it tests first its arguments before calling .Primitive(!): It takes advantage of `!` being not defined for character arguments: > !2 [1] FALSE >
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
Hello it wanted to add a boton of checkup in a menu, ?How I do to create so many variables as checkbutton? I try with the code that continues, use a vector that is charged dynamicamente while I open files but the component of vector "b" is associates with a Tcl variable and load 3 components (environment, value and pointer) I wanted alone to charge the value (0 done not select
2007 Apr 18
10
importing excel-file
Dear R-experts, It is a quite stupid question but please help me. I am very confuced. I am able to import normal txt ant mat-files to R but unable to import .xls-file I do not understand the online help. Can please anyone send me the corresponding command lines? The .xls-file is attached. In my file we use commas for the decimal format (example: 0,712), changes might be needed. Thanks, Corinna
2008 Jun 06
2
Plot matrix as many lines
Suppose that I have a matrix like: m <- rbind(c(1,2,3,4), c(2,3,2,1)) Is there any way to efficiently plot the _lines_ as if I was doing: plot(m[1,], type="l") points(m[2,], type="l", col="red") (of course, in the "real world" there much more than just 2 lines and 4 columns...) Alberto Monteiro
2007 Feb 28
2
What is a expression good for?
I mean, I can generate a expression, for example, with: z <- expression(x+y) But then how can I _use_ it? Is it possible to retrieve information from it, for example, that z is a sum, its first argument is x (or expression(x)) and its second argument is y? Alberto Monteiro
2007 Jun 04
2
Abstract plot
I want to make a plot, but instead of showing _numerical_ values, I would like to show _symbolic_ values. For example, I want to plot a function y = a x + b, where x varies between Xmin and Xmax. I would like the plot to show, in the x-axis, the strings Xmin and Xmax, instead of their numeric values. Is it possible? Alberto Monteiro
2007 Mar 16
3
corAR1 in a random effects panel
Hi everyone, I am interested in estimating this type of random effects panel: y_it = x'_it * beta + u_it + e_it u_it = rho * u_it-1 + d_it rho belongs to (-1, 1) where: u and e are independent and normally zero-mean distributed. d is also independently normally zero-mean distributed. So, I want random effects for group i to be correlated in t, following an AR(1) process. I am
2007 Feb 27
2
ts; decompose; plot and title
Is there any way to give a "decent" title after I plot something generated by decompose? For example: # generate something with period 12 x <- rnorm(600) + sin(2 * pi * (1:600) / 12) # transform to a monthy time series y <- ts(x, frequency=12, start=c(1950,1)) # decompose z <- decompose(y) # plot plot(z) Now, the title is the ugly "Decomposition of additive time
2006 Sep 30
1
Simple graphics
Is there any way that I can do something like this: png("file.png", width=200, height=200) polygon(c(50, 50, 150, 150), c(50, 150, 150, 50)) dev.off() and then have a png file with a 100 x 100 pixels rectangle in the middle of it? It seems that when I call "plot", it redefines the image coordinates to some "optimized" value and then I lose any information to
2007 Mar 29
1
Wikibooks
As a big fan of Wikipedia, it's frustrating to see how little there is about R in the correlated project, the Wikibooks: http://en.wikibooks.org/wiki/R_Programming Alberto Monteiro