Re: [R] pkg reticulate + python3 + MSYS2 (windows)
Hello Ivan Krylov and all users, I think I understand your observation but there is no file named by python37.dll on the computer. It may be as static build inside python3.exe but if so should not give this error? Thank you Cleber Borges Em 15/09/2019 09:04, Ivan Krylov escreveu: On Sat, 14 Sep 2019 15:18:54 -0300 Cleber Borges wrote: python37.dll - N??o foi poss??vel encontrar o m??dulo especificado. This might mean that python37.dll depends on another DLL which could not be found. You might have to add C:/msys64/mingw64/bin/ and/or another directory to the PATH environment variable to make it work. Use Dependency Walker [*] or a similar tool to find out which DLLs python37.dll depends on. Alternatively, use Sysinternals Process Monitor [**] to see which files does it try to open before a `reticulate` call fails. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] Gtk3 into R
hello all, Is there currently any way to use Gtk3 to build GUI on R? Or some more up-to-date graphical toolkit than Gtk2 (via RGtk) or Tcl / Tk (via tcltk) ... best regards Cleber Borges [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] Use of C functions inside the DLL object
hello everybody and good night ... I'm trying to learn how to use a DLL, via "dyn.load" and ".C" inside the R. I did some testing (below is a part of what I tried) and I could not figure out how to do this. If anyone can give a hint on how to do this manipulation, it would be a lot of help! And thanks in advance for any tip. Thank you! Cleber ### In the pdf explaining the SDK, it has function detail: FDwfGetVersion(char szVersion[32]) Description: Retrieves the version string. The version string is composed of major, minor, and build numbers (i.e., “2.0.19”). ## ### In R, I tried: > dwf <- dyn.load("C:\\Windows\\System32\\dwf") > is.loaded("FDwfGetVersion") [1] TRUE > result <- .C("FDwfGetVersion", version=as.character() ) > result $`version` character(0) > str(result) List of 1 $ version: chr(0) # But in Python, I saw that the result is as follows (examples in Python are made available by the manufacturer) # >>> from ctypes import * >>> dwf = cdll.dwf >>> version = create_string_buffer(16) >>> dwf.FDwfGetVersion(version) 1 >>> print("DWF Version: "+str(version.value)) DWF Version: 3.8.22 >>> --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] cubic complete Scheffe mixture models
Hello everyone I'm trying to use Scheffe's complete cubic model (mixture design). In the bibliographies, they indicate that the term is of the type: A * B * (A-B). But I see that trying to adjust the three cubic terms results in singularities. I know this implies not having the inverse matrix: solve (t (X)% *% X) does not exist. The bibliographies show all three cubic terms. So my question: How to circumvent the singularity and estimate the coefficients for these terms in Scheffe's complete cubic model in the modeling of Chemical Blends? Thanks in advance for any help. Thank you so much Cleber Borges MY_DATA: H2O TOL MET Response 1 1.000 0.000 0.000 0.39056923 2 0.000 1.000 0.000 -1.49611856 3 0.000 0.000 1.000 -0.33922649 4 0.500 0.500 0.000 -0.65517683 5 0.500 0.000 0.500 -1.23281158 6 0.000 0.500 0.500 0.51523665 7 0.333 0.333 0.333 -0.93516022 8 0.333 0.333 0.333 -0.84429633 9 0.667 0.167 0.167 0.55931646 10 0.667 0.167 0.167 0.47999083 11 0.167 0.667 0.167 0.07182446 12 0.167 0.667 0.167 -0.01813801 13 0.167 0.167 0.667 1.79895957 14 0.167 0.167 0.667 1.70503083 # my try: reg <- lm( Response ~ -1 + H2O*TOL*MET + I(H2O*TOL*(H2O-TOL)) + I(H2O*MET*(H2O-MET)) + I(TOL*MET*(TOL-MET)), data=MY_DATA ) summary( reg ) ## Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) H2O 0.6279 1.1070 0.567 0.595 TOL -1.2588 1.1070 -1.137 0.307 MET -0.1019 1.1070 -0.092 0.930 I(H2O * TOL * (H2O - TOL)) 11.8720 13.8902 0.855 0.432 I(H2O * MET * (H2O - MET)) -15.7052 13.8902 -1.131 0.309 I(TOL * MET * (TOL - MET)) NA NA NA NA H2O:TOL 0.5398 5.4316 0.099 0.925 H2O:MET -4.0846 5.4316 -0.752 0.486 TOL:MET 6.6810 5.4316 1.230 0.273 H2O:TOL:MET 2.0005 31.3024 0.064 0.952 --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] KK transform - Kramers-kronig relations
Hello everyone Anyone know if there is implementation of Kramers-kronig relations[1] in any package? Thanks in advance for your attention. Cleber Borges [1] - https://en.wikipedia.org/wiki/Kramers%E2%80%93Kronig_relations --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] develop.raw error ( adimpro )
Hello all, I'm trying to use the adimpro package to read RAW files (image). Make readins is OK! > r <- read.raw( '20171218_210956.dng', type='RAW', compress=FALSE ) > summary( r ) > ### cut the many lines... Filter pattern: GR/BG > extract.info( r ) [1] "GR/B" > To next, develop the raw file using the "develop.raw" function. But the function returns the error: > dr <- develop.raw( r ) Error in dim(mat) <- c(4, 3) : dims [product 12] do not match the length of object [0] My suspicion is that the develop.raw function fails to get the correct Bayer's pattern. Within the develop.raw function there is a code (below) that will always return the pattern as a variable of NULL value > bayer <- switch(extract.info( r ), RGGB = 1, GRBG = 2, BGGR = 3, GBRG = 4) > bayer NULL > Is there anything to do to get around the situation? Thank you so much Cleber Borges ps.: below more details ## > r <- read.raw( '20171218_210956.dng', type='RAW', compress=FALSE ) > summary( r ) Image file: 20171218_210956.dng Image dimension: 3024 4032 Color space: RAW Color depth: 16bit Gamma correction: FALSE Type: None White point: D65 Range: 0 65535 EXIF-Information: Filename: 20171218_210956.dng Timestamp: Mon Dec 18 21:09:56 2017 Camera: Samsung SM-G935F DNG Version: 1.4.0.0 ISO speed: 200 Shutter: 1/24.0 sec Aperture: f/1.7 Focal length: 4.2 mm Embedded ICC profile: no Number of raw images: 1 Thumb size: 504 x 376 Full size: 4032 x 3024 Image size: 4032 x 3024 Output size: 3024 x 4032 Raw colors: 3 Filter pattern: GR/BG Daylight multipliers: 2.022219 0.916446 1.101952 Camera multipliers: 1.765517 1.00 1.675941 0.00 > extract.info( r ) [1] "GR/B" > > dr <- develop.raw( r ) Error in dim(mat) <- c(4, 3) : dims [product 12] do not match the length of object [0] > ### my suspection > bayer <- switch(extract.info( r ), RGGB = 1, GRBG = 2, BGGR = 3, GBRG = 4) > bayer NULL > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] fields_9.0 maps_3.2.0 spam_2.1-1 dotCall64_0.9-5 [5] adimpro_0.8.2 awsMethods_1.0-4 loaded via a namespace (and not attached): [1] compiler_3.4.2 tools_3.4.2 > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] dataframe columns class
Why columns classes are function dependents? Like this example: > for( i in 1:5 ) print( class( iris[,i] ) ) [1] "numeric" [1] "numeric" [1] "numeric" [1] "numeric" [1] "factor" > > apply( iris, 2, class ) Sepal.Length Sepal.Width Petal.Length Petal.Width Species "character" "character" "character" "character" "character" > > dat <- data.frame( v1=1:5, v2=letters[1:5] ) > dat v1 v2 1 1 a 2 2 b 3 3 c 4 4 d 5 5 e > > summary( dat ) v1v2 Min. :1 a:1 1st Qu.:2 b:1 Median :3 c:1 Mean :3 d:1 3rd Qu.:4 e:1 Max. :5 > > apply( dat, 2, class ) v1 v2 "character" "character" > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcltk: use of .Tcl.callback
Dear, How to properly use the function: .Tcl.callback( ) to trigger a single R function with different values? Below is my stupid solution ... The expected behavior is this but I would like to know how to do it right. Thanks in advanced cleber ## library( tcltk ) top <- tktoplevel() dummyCopyCutR <- function( optionXXX ){ if( optionXXX=="copy" ) print("Option Copy") if( optionXXX=="cut" ) print("Option Cut" ) } strcmd <- strsplit( .Tcl.callback( dummyCopyCutR ), " %" )[[1]][1] tkbind( top, '', paste( strcmd, 'copy' ) ) tkbind( top, '', paste( strcmd, 'cut' ) ) ## --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcltk: use of .Tcl.callback
Dear, How to properly use the function: .Tcl.callback( ) to trigger a single R function with different values? Below is my stupid solution ... The expected behavior is this but I would like to know how to do it right. Thanks in advanced cleber ## library( tcltk ) top <- tktoplevel() dummyCopyCutR <- function( optionXXX ){ if( optionXXX=="copy" ) print("Option Copy") if( optionXXX=="cut" ) print("Option Cut" ) } strcmd <- strsplit( .Tcl.callback( dummyCopyCutR ), " %" )[[1]][1] tkbind( top, '', paste( strcmd, 'copy' ) ) tkbind( top, '', paste( strcmd, 'cut' ) ) ## --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] [tcltk] tktable: bindings doesn't triggers the ValidationCommand and Command
Dears, I'm trying to create an Data Editor like Rgui.exe's FIX (windows)... The code is below. The problem is that I can not get the binds to trigger the validation commands and the main table command Control-C, Control-V, and Control-X work only in the visual without my R data being changed. Any help, tip or example is welcome and I thank you in advance for your attention. Thank you very much Cleber ### R 3.4 Tcl 8.6 library( tcltk ) tclRequire("Tktable") ncol <- 6 nrow <- 6 x <- matrix( rnorm( nrow*ncol ), nrow, ncol ) rownames(x) <- paste0( "Sam ", 1:nrow ) colnames(x) <- paste0( "Var ", 1:ncol ) ### showdigits <- 6 tablecmd <- function(r,c,S){ r <- as.integer( r ) c <- as.integer( c ) showNA <- is.na( x[ r,c ] ) if( r == 0 && c > 0 ) return( tcl("expr", '{', colnames(x)[c], '}' ) ) if( c == 0 && r > 0 ) return( tcl("expr", '{', rownames(x)[r], '}' ) ) if( r > 0 && c > 0 && showNA ) return( tcl("expr", "{}" ) ) if( r > 0 && c > 0 && !showNA ) return( tcl("expr", round( x[r,c], digits=showdigits ) ) )# signif if( r == 0 && c == 0 ) return( tcl("expr", "{}" ) ) } tablevcmd <- function( S,s,r,c ){ # s : current value # S : potential new value if( grepl("\n", S ) ){ tcl('::tk::table::MoveCell', .Tk.ID( tableData ), 1, 0 ) return( tcl( 'expr', 0 ) ) } r <- as.integer( r ) c <- as.integer( c ) if( r == 0 && c > 0 ) { colnames(x)[c] <<- S return( tcl( 'expr', 1 ) ) } if( c == 0 && r > 0 ) { rownames(x)[r] <<- S return( tcl( 'expr', 1 ) ) } if( grepl(" ", S ) ){ tcl('::tk::table::MoveCell', .Tk.ID( tableData ), 1, 0 ) return( tcl( 'expr', 0 ) ) } if( S == "" ) { x[r,c] <<- NA return( tcl( 'expr', 1 ) ) } if( S != s ){ x[r,c] <<- as.numeric( S ) return( tcl( 'expr', 1 ) ) } } # make the GUI top <- tktoplevel() tcl( 'wm', 'title', top, 'DataFix' ) fmTableData <- ttkframe( top, borderwidth=2 ) tcl( 'pack', fmTableData, fill="both", expand=TRUE, padx=15, pady=15 ) fxscroll <- function(...){ tcl( scrX, 'set', ... ) } fyscroll <- function(...){ tcl( scrY, 'set', ... ) } tableData <- tkwidget( fmTableData, 'table', rows=nrow+1, cols=ncol+1, height=-1, width=-1, ellipsis='', insertofftime=0, flashmode=TRUE, flashtime=1, anchor='e', resizeborders='col', wrap=FALSE, font='{Courier} 10', padx=5, pady=2,# ipadx=3, ipady=1, rowstretchmode='unset', colstretchmode='unset', multiline=FALSE, cache=TRUE, background="white", selectmode="extended", selecttitle=TRUE, relief='groove', borderwidth=c(0,1,0,1), drawmode='compatible', colwidth=12, highlightcolor="gray", highlightbackground="white", highlightthickness=1, xscrollcommand=fxscroll, yscrollcommand=fyscroll, rowseparator='\n', colseparator='\t', validate=TRUE, vcmd=tablevcmd, usecommand=TRUE, command=tablecmd ) scrX <- ttkscrollbar( fmTableData, orient="horizont", command=function(...) tcl( tableData,'xview',...) ) scrY <- ttkscrollbar( fmTableData, orient="vertical", command=function(...) tcl( tableData,'yview',...) ) empacotando os scrollbars tcl( "pack", scrY, side = "right", fill = "y", expand = FALSE, pady = c(0,18) ) tcl( "pack", scrX, side = "bottom", fill = "x", expand = FALSE ) tcl( tableData, "tag", "celltag", "ZeroZero", "0,0" ) tcl( tableData, "tag", "rowtag", "rowtitle", "0" ) tcl( tableData, "tag", "coltag", "coltitle", "0" ) tcl( tableData, "tag", "configure", "ZeroZero", bg='SystemButtonFace', fg='SystemButtonFace', state='disabled' ) tcl( tableData, "tag", "configure", "rowtitle", bg='lightgray', relief='groove', anchor='center')#, borderwidth=c(1,1,1,1) ) tcl( tableData, "tag", "configure", "coltitle", bg='lightgray', relief='groove', anchor='w')#, borderwidth=c(1,1,1,1) ) tcl( tableData, "tag", "configure", "active", fg='green', bg='gray90', relief='solid', borderwidth=c(1,1,1,1) ) tcl( tableData, "width", "0", "15" ) tcl( 'pack', tableData, side='left', anchor='n', fill="both", expand=TRUE ) # # stay here to serve as an example # # bind Table {::tk::table::MoveCell %W -1 0} tcl( 'bind', .Tk.ID( tableData ), '', paste('::tk::table::MoveCell', .Tk.ID( tableData ), 1, 0 ) ) # bind Table <$cut>{tk_tableCut %W} tcl( 'bind', .Tk.ID( tableData ), '', paste('tk_tableCut', .Tk.ID( tableData ) ) ) --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] tcltk table "validateCommand"
Hi Dan Were you able to find a way to access the % S values ?? Do you have any examples of how this works? Thank you for your attention. Cleber Em 25/01/2016 08:21, peter dalgaard escreveu: > It's been so long that I have forgotten how to get the package with the table > widget installed on OSX, so I cannot check things for you. However, the > canonical way to handle %S type arguments is to pass them as formal arguments > to the callback, e.g. > >> .Tcl.callback(function(x,y)x+y) > [1] "R_call 0x7f9a34806ca0 %x %y" > > so I would assume that you should just define your > > CellValidation <- function(S){} > > and then just access S as a variable inside the function. > > As far as I remember, this only works at entry completion, though. That does > sort of make sense since not every prefix of a valid entry is valid ("1e-2" > is a double, "1e-" is not). If you want to actually disable certain keys > during entry, then you have a larger task on your hand. > > -pd > > On 22 Jan 2016, at 21:25 , Dalthorp, Danielwrote: > >> I'd like to allow users to edit data in tcltk tables and to use vcmd to >> validate data entry, e.g., not allowing non-numbers to be entered in >> numeric cells and not allowing '\n' to be entered in text cells. >> >> The problem is that I can't figure out how to "see" their data entry before >> it is entered, although it looks like %S can be somehow used in vcmd to get >> this information. >> >> Example: to disallow '\n' to be entered into a cell in an editable table: >> >> require(tcltk2) >> tt<-tktoplevel(); tfr<-tkframe(tt); tkgrid(tfr) >> tableData<-tclArray() >> tableData[[0,0]]<-"junk" >> >> CellValidation<-function(){ >> >> ## http://www.tcl.tk/community/hobbs/tcl/capp/tkTable/tkTable.html says: >> ## *%S* For *ValidateCommand*, it is the potential new value of the cell >> being validated. >> ## which is exactly what I want, but I can't figure out how to do that. >> ## The following allows one bad character and then disallows further edits >> >> testval<-tclvalue(tcl(table1,"curvalue")) >> >> if (length(grep("\n",testval))>0) return(tcl("expr", FALSE)) else >> return(tcl("expr", TRUE)) >> } >> >> table1<<-tk2table(tfr, >> rows=1,cols=1, >> selectmode="extended", >> variable=tableData, >> validate=T, >> vcmd=CellValidation >> ) >> >> tcl(table1,"tag","configure", "active", fg='black',bg=colors()[411]) >> tkgrid(table1) >> >> How can I get the %S value rather than the tcl(table1,"curvalue")? >> >> Much thanks for any help. >> >> -Dan >> --- Este email foi escaneado pelo Avast antiv�rus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] how to use the fontchooser tcl tk widget ?
hello all r users, somebody has a example how to use fontchooser widget? I haven't success in my try :-( Thanks Cleber > library( tcltk ) # in R-devel, > tclVersion() [1] "8.6.4" > tclvalue( tcl('tk::fontchooser', 'show', command='' ) ) Error in (function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, : unused argument ("{DejaVu Sans Mono} 26 bold italic") Error in (function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE, : unused argument ("{DejaVu Sans Mono} 26 bold italic") [1] "" > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcl('tk::fontchooser', 'show') : How to use? R-devel Tcl 8.6
Hello, Somebody would indicate the correct way to use the option the fontchooser widget into tcltk package (in R-devel, Tcl 8.6) ? I tried to use as other traditional widgets but no success. (code below) Thanks Cleber > tt <- tktoplevel(); but <- ttkbutton( tt, text='Test'); tcl('pack', but ) > tcl( but, 'configure', '-text' ) -text text Text {} Test > tcl( but, 'configure', text=NULL ) -text text Text {} Test > tcl( but, 'cget', '-text') Test > > > tcl('tk::fontchooser', 'show') > tcl( 'tk::fontchooser', 'configure', '-font') > > > sessionInfo() R Under development (unstable) (2016-11-01 r71616) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.4.0 > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcl('tk::fontchooser', 'show') : How to use? R-devel Tcl 8.6
Hello, Somebody would indicate the correct way to use the option the fontchooser widget into tcltk package (in R-devel, Tcl 8.6) ? I tried to use as other traditional widgets but no success. (code below) Thanks Cleber > tt <- tktoplevel(); but <- ttkbutton( tt, text='Test'); tcl('pack', but ) > tcl( but, 'configure', '-text' ) -text text Text {} Test > tcl( but, 'configure', text=NULL ) -text text Text {} Test > tcl( but, 'cget', '-text') Test > > > tcl('tk::fontchooser', 'show') > tcl( 'tk::fontchooser', 'configure', '-font') > > > sessionInfo() R Under development (unstable) (2016-11-01 r71616) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.4.0 > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcl('tk::fontchooser', 'show') : Hoe to use? R-devel Tcl 8.6
Hello, Somebody would indicate the correct way to use the option the fontchooser widget into tcltk package (in R-devel, Tcl 8.6) ? I tried to use as other traditional widgets but no success. (code below) Thanks Cleber > tt <- tktoplevel(); but <- ttkbutton( tt, text='Test'); tcl('pack', but ) > tcl( but, 'configure', '-text' ) -text text Text {} Test > tcl( but, 'configure', text=NULL ) -text text Text {} Test > tcl( but, 'cget', '-text') Test > > > tcl('tk::fontchooser', 'show') > tcl( 'tk::fontchooser', 'configure', '-font') > > > sessionInfo() R Under development (unstable) (2016-11-01 r71616) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.4.0 > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] which properly to avoid pointer copy Tcl Tk? 'externalptr'
hello, I'm trying to disable an tkentry widget with a tkcheckbutton using an R function via the command flag. but I get an error regardding copy of the pointer: 'externalptr' which properly way to avoid this? thanks, cleber > library( tcltk ) > tp <- tktoplevel() > > chk <- tclVar( TRUE ) > statusentry <- tclVar( "normal" ) # normal, disabled > anystring <- tclVar( "anystring" ) > > chebut <- ttkcheckbutton( tp, variable=chk, text='Save with new name: ', onvalue=TRUE, offvalue=FALSE, + command=function(...) ifelse( as.numeric(tclvalue(chk)), +tkconfigure(ent1,'-state','normal'), +tkconfigure(ent1,'-state','disabled') ) + ) > tcl( 'pack', chebut ) > > ent1 <- ttkentry( tp, textvariable=anystring, state='normal' ) > tcl( 'pack', ent1 ) Error in rep(no, length.out = length(ans)) : attempt to replicate an object of type 'externalptr' > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] pure TCL run a command within the R via the tcltk package?
thanks Jonh Fox! :-) my solution (partial and temporary) was as follows. cleber ( for the r-help history file ) library( tcltk ) # from ?.Tcl f <- function()cat("HI!\n") .Tcl.callback(f) sink("simpletest.tcl") cat('toplevel .t\n') cat('button .t.b -text "but" -command { ', .Tcl.callback(f), ' }\n' ) cat('checkbutton .t.c -text "ck1" -variable "chkvar"\n' ) cat('pack .t.b\n') cat('pack .t.c\n') sink() #tcl('set', 'argc', '0') # for use with code generated by vTcl #tcl('set', 'argv', '0') # for use with code generated by vTcl tcl('source', "simpletest.tcl" ) tclvalue('chkvar') unlink('simpletest.tcl') Em 10/10/2016 11:02, Fox, John escreveu: Dear Cleber, See ?.Tcl I hope this helps, John - John Fox, Professor McMaster University Hamilton, Ontario Canada L8S 4M4 Web: socserv.mcmaster.ca/jfox -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Cleber N.Borges via R-help Sent: October 9, 2016 9:00 PM To: r-help@r-project.org Subject: [R] pure TCL run a command within the R via the tcltk package? Dear, is there any way of a button on pure TCL run a command within the R via the tcltk package? thank you in advance for informations cleber what I have in mind is something like: (below) ## sink("simpletest.tcl") cat(' toplevel .t button .t.b -text "but" -command {"some tcltk command for push data into R"} checkbutton .t.c -text "ck1" -variable "chkvar" pack .t.b pack .t.c ' ) sink() library( tcltk ) #tcl('set', 'argc', '0') #tcl('set', 'argv', '0') tcl('source', "simpletest.tcl" ) > tclvalue('chkvar') [1] "1" > tclvalue('chkvar') # after click in screen [1] "0" > ### after click in button get error: invalid command name "some tcltk command for push data into R" invalid command name "some tcltk command for push data into R" while executing ""some tcltk command for push data into R"" invoked from within ".t.b invoke" ("uplevel" body line 1) invoked from within "uplevel #0 [list $w invoke]" (procedure "tk::ButtonUp" line 24) invoked from within "tk::ButtonUp .t.b" (command bound to event) ## > sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] pure TCL run a command within the R via the tcltk package?
Dear, is there any way of a button on pure TCL run a command within the R via the tcltk package? thank you in advance for informations cleber what I have in mind is something like: (below) ## sink("simpletest.tcl") cat(' toplevel .t button .t.b -text "but" -command {"some tcltk command for push data into R"} checkbutton .t.c -text "ck1" -variable "chkvar" pack .t.b pack .t.c ' ) sink() library( tcltk ) #tcl('set', 'argc', '0') #tcl('set', 'argv', '0') tcl('source', "simpletest.tcl" ) > tclvalue('chkvar') [1] "1" > tclvalue('chkvar') # after click in screen [1] "0" > ### after click in button get error: invalid command name "some tcltk command for push data into R" invalid command name "some tcltk command for push data into R" while executing ""some tcltk command for push data into R"" invoked from within ".t.b invoke" ("uplevel" body line 1) invoked from within "uplevel #0 [list $w invoke]" (procedure "tk::ButtonUp" line 24) invoked from within "tk::ButtonUp .t.b" (command bound to event) ## > sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] how to work ttkspinbox ? win BUG ??
thanks David for your help thanks for your help, David I suspect that there are a bug in windows version... :-( cleber ### > library( tcltk ) > t <- tktoplevel() > s = ttkspinbox(t, from = 1.0, to = 100.0, textvariable='spinval') Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "ttk::spinbox". > tkpack(s) Error in .Tcl.args.objv(...) : object 's' not found > > > sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base > Em 08/10/2016 17:51, David Winsemius escreveu: On Oct 7, 2016, at 7:15 PM, Cleber N.Borges via R-help <r-help@r-project.org> wrote: hello all, somebody have a example of use of ttkspinbox ? I tried to use like others widgets but I get error. Thanks in advanced for any help cleber ### library( tcltk ) t <- tktoplevel() spin <- ttkspinbox( t ) Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "ttk::spinbox". combo <- ttkcombobox( t ) tkpack( combo ) This displays a spinbox in an X-window: t <- tktoplevel() s = ttkspinbox(t, from = 1.0, to = 100.0, textvariable='spinval') tkpack(s) David Winsemius Alameda, CA, USA --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] how to work ttkspinbox ?
hello all, somebody have a example of use of ttkspinbox ? I tried to use like others widgets but I get error. Thanks in advanced for any help cleber ### > library( tcltk ) > > t <- tktoplevel() > > spin <- ttkspinbox( t ) Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "ttk::spinbox". > > combo <- ttkcombobox( t ) > tkpack( combo ) > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] help with use of the Linear Programming - constrOptim
Dears, I imagine that the LP method should be the solution to find the parameters of one objective function ... I known there are the constrOptim command for this. but I don't know how to elaborate the contour condictions in matricial forms that the way like constrOptim works I show below one function example to be optimized I appreciate much if somebody can help me responding if I really am right imagining LP like ideal tool in my case and indicate basic material (introduction) about the subject below Thanks in advanced Cleber Borges # fobjective <- function( x = 0.1 ){ # Constants k1 <- 0.007585776 k2 <- 6.16595e-08 k3 <- 2.137962e-13 k4 <- 1e-14 # Determine all the 6 variables: # a, b, c, d, e, f ### # 6 Contour Condictions: ( Igualities ) ### k1 == a * d / c# 1 k2 == a * e / d# 2 k3 == a * f / e# 3 k4 == a * b# 4 4 * a == b + d + e + f# 5 x == c + d + e + f# 6 return( c( a, b, c, d, e, f ) ) } --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] How to use the options "usecommand" and "command" of tktable?
How to capture the output from the "command" option of tktable and how to send input to it? As far as I understand, the most appropriate way to use the tktable is through the flag usecommand and command. It fires the string information and cell coordinates and wait for a new string to set a new value. It's I understood by example in pure TCL given in reference [1]. Is there how to translate this code to R? I believe that the signs of tktable not reach the level of R and will need to be accessed by the lower level commands. But how? Thank you in advance for dedicated attention. cleber ### [1] - http://dbaspot.com/object/showthread.php?t=785221= ### my R code library( tcltk ) tclRequire( "Tktable" ) tclServiceMode( FALSE ) top <- tktoplevel() TableCommand <- function( x=NULL ) { cat( class( x ), '\n' ) cat( x , '\n' ) } tab <- tkwidget( top, 'table', rows=2, cols=2, usecommand=TRUE, command=TableCommand ) tcl('pack', tab, expand=TRUE, fill='both' ) tclServiceMode( TRUE ) ### TCL from [1] package require Tktable namespace eval ::test {} proc ::test::build_table {} { catch {destroy .test} variable top [toplevel .test] variable myarray array unset myarray variable table [table $top.table \ -rows 5 \ -height 5 \ -cols 2 \ -command "[namespace current]::TableCommand %S %r %c"] pack $table -expand true -fill both $table tag config complete -background blue } proc ::test::TableCommand {S r c} { variable table variable myarray if {$S != ""} { # I only want integers in my cells! puts "\"$S\" into $r,$c ?" if {[string is integer -strict $S]} { $table tag cell complete "$r,$c" set myarray($r,$c) $S } else { $table tag cell !complete "$r,$c" array unset myarray $r,$c } } if {[info exists myarray($r,$c)]} { return $myarray($r,$c) } return "$r,$c" } ::test::build_table --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] there is a vectorinzing version of "[[<-" for "tclArray" class ?
hi all, there is a vectorinzing version of "[[<-" for "tclArray" class ? TIA cleber # > library(tcltk); getS3method("[[<-",'tclArray') function (x, ..., value) { name <- as.character(x) i <- paste(..., sep = ",") if (is.null(value)) .External(.C_RTcl_RemoveArrayElem, name, i) else { value <- as.tclObj(value) .External(.C_RTcl_SetArrayElem, name, i, value) } x } > --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] [tcltk][tktable] How to make an efficient data transfer from R to Tcl?
hello all, I intend transfer a big data.frame, more than 1e4 rows, more than 100 columns... I found solutions (in internet and help pages) for small data.frame like the showed bellow. Big data.frames is very expensive in computation time in my approach I would like to optimize this transfer anyway ... I saw a function named "as.tclObj" that seems to me a promising form but hard to code... Somebody know a way more clever to do it? thanks for tips cleber ## library( tcltk ) nrow <- 10 ; ncol <- 100 # simulated data: data is originally a data frame DF <- as.data.frame(matrix(round(runif(nrow*ncol),3),nr=nrow,nc=ncol)) ## # DF_tcl <- as.tclObj( as.matrix( DF ) ) tableDataTclArray <- tclArray() for( i in 1:nrow( DF ) ) tableDataTclArray[[ i, 0 ]] <- .Tcl( noquote( paste('format "', rownames( DF )[ i ] , '"') ) ) for( i in 1:ncol( DF ) ) tableDataTclArray[[ 0, i ]] <- .Tcl( noquote( paste('format "', colnames( DF )[ i ] , '"') ) ) for( i in 1:nrow( DF ) ) for( j in 1:ncol( DF ) ) tableDataTclArray[[ i, j ]] <- DF[i,j] ## ## ## ## # my full code: ### library( tcltk ); tclRequire("Tktable") wDataOrg <- tktoplevel() tcl('wm', 'geometry', wDataOrg, "1024x600+175+80" ) fmTableData <- ttklabelframe( wDataOrg, text=' Data ', padding=c( 8, 5, 8, 15 ) ) height <- -1; width <- -1 nrowDefault <- 1e4+1; ncolDefault <- 100+1 tableDataTclArray <- tclArray() tableData <- tkwidget( fmTableData, "table", rows=nrowDefault, cols=ncolDefault, height=height+1,width=width+1, xscrollcommand=function(...) tkset( scrX, ... ), yscrollcommand=function(...) tkset( scrY, ... ), rowstretchmode='unset', colstretchmode='unset', multiline=0, cache=1, background="white", selectmode="extended", selecttitle=0, font='{Arial} 10', ipadx=5, ipady=5, anchor='e', borderwidth=c( 0, 1, 0, 1 ), drawmode='slow', variable=tableDataTclArray ) tcl( tableData, "tag", "celltag", "ZeroZero", "0,0" ) tcl( tableData, "tag", "rowtag", "rowtitle", "0" ) tcl( tableData, "tag", "coltag", "coltitle", "0" ) tcl( tableData, "tag", "configure", "ZeroZero", bg='SystemButtonFace', relief="raised", state='disabled' ) tcl( tableData, "tag", "configure", "rowtitle", bg='lightgreen', relief='raised', borderwidth=c( 0, 1, 0, 1 ), anchor='center' ) tcl( tableData, "tag", "configure", "coltitle", bg='lightgreen', relief='raised', borderwidth=c( 0, 1, 0, 1 ), anchor='w' ) tcl( tableData, "tag", "configure", "active", fg='yellow', bg='red' ) tcl( tableData, "width", "0", "20" ) scrX <- tkscrollbar( fmTableData, orient="horizontal", command=function(...) tkxview( tableData, ... ) ) scrY <- tkscrollbar( fmTableData, orient="vertical", command=function(...) tkyview( tableData, ... ) ) scrYwidth <- as.integer( tkcget( scrY, width = NULL ) ) tcl( "pack", scrY, side = "right", fill = "y", expand = FALSE, pady = c(0, scrYwidth + 2) ) tcl( "pack", scrX, side = "bottom", fill = "x", expand = FALSE ) tcl( "pack", tableData, anchor='n', side="right", expand=TRUE, fill="both" ) tcl( "pack", fmTableData, fill="both", expand = TRUE, padx=10, pady=10 ) ## expensive time computation [[elided Yahoo spam]] DF <- as.data.frame( matrix( round(runif(1e4 * 100),3), nr=1e4, nc=100 ) ) simulated data for( i in 1:nrow( DF ) ){ tableDataTclArray[[ i, 0 ]] <- .Tcl( noquote( paste('format "', rownames( DF )[ i ] , '"') ) ) } for( i in 1:ncol( DF ) ){ tableDataTclArray[[ 0, i ]] <- .Tcl( noquote( paste('format "', colnames( DF )[ i ] , '"') ) ) } for( i in 1:nrow( DF ) ) { for( j in 1:ncol( DF ) ){ tableDataTclArray[[ i, j ]] <- DF[i,j] } } # --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] [tcltk][tktable] How to make an efficient data transfer from R to Tcl?
my objective is to show data in screen inside a tktable... for that, the data must be in a TCL variable and not only in a R variable like that: library( tcltk ) mtcars_in_TCL <- tclArray() for( i in 1:5 ) for( j in 1:5 ) mtcars_in_TCL[[ i,j ]] <- as.matrix(mtcars)[ i,j ] i thank by attention cleber Em 08/12/2015 22:51, Bert Gunter escreveu: Define: "transfer" ( save/load should be efficient and fast within R, but you appear to have something else in mind. What?) Apologies if it's obvious and I just don't get it. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Dec 8, 2015 at 4:37 PM, Cleber N.Borges <kle...@yahoo.com.br> wrote: hello all, I intend transfer a big data.frame, more than 1e4 rows, more than 100 columns... I found solutions (in internet and help pages) for small data.frame like the showed bellow. Big data.frames is very expensive in computation time in my approach I would like to optimize this transfer anyway ... I saw a function named "as.tclObj" that seems to me a promising form but hard to code... Somebody know a way more clever to do it? thanks for tips cleber ## library( tcltk ) nrow <- 10 ; ncol <- 100 # simulated data: data is originally a data frame DF <- as.data.frame(matrix(round(runif(nrow*ncol),3),nr=nrow,nc=ncol)) ## # DF_tcl <- as.tclObj( as.matrix( DF ) ) tableDataTclArray <- tclArray() for( i in 1:nrow( DF ) ) tableDataTclArray[[ i, 0 ]] <- .Tcl( noquote( paste('format "', rownames( DF )[ i ] , '"') ) ) for( i in 1:ncol( DF ) ) tableDataTclArray[[ 0, i ]] <- .Tcl( noquote( paste('format "', colnames( DF )[ i ] , '"') ) ) for( i in 1:nrow( DF ) ) for( j in 1:ncol( DF ) ) tableDataTclArray[[ i, j ]] <- DF[i,j] ## ## ## ## # my full code: ### library( tcltk ); tclRequire("Tktable") wDataOrg <- tktoplevel() tcl('wm', 'geometry', wDataOrg, "1024x600+175+80" ) fmTableData <- ttklabelframe( wDataOrg, text=' Data ', padding=c( 8, 5, 8, 15 ) ) height <- -1; width <- -1 nrowDefault <- 1e4+1; ncolDefault <- 100+1 tableDataTclArray <- tclArray() tableData <- tkwidget( fmTableData, "table", rows=nrowDefault, cols=ncolDefault, height=height+1,width=width+1, xscrollcommand=function(...) tkset( scrX, ... ), yscrollcommand=function(...) tkset( scrY, ... ), rowstretchmode='unset', colstretchmode='unset', multiline=0, cache=1, background="white", selectmode="extended", selecttitle=0, font='{Arial} 10', ipadx=5, ipady=5, anchor='e', borderwidth=c( 0, 1, 0, 1 ), drawmode='slow', variable=tableDataTclArray ) tcl( tableData, "tag", "celltag", "ZeroZero", "0,0" ) tcl( tableData, "tag", "rowtag", "rowtitle", "0" ) tcl( tableData, "tag", "coltag", "coltitle", "0" ) tcl( tableData, "tag", "configure", "ZeroZero", bg='SystemButtonFace', relief="raised", state='disabled' ) tcl( tableData, "tag", "configure", "rowtitle", bg='lightgreen', relief='raised', borderwidth=c( 0, 1, 0, 1 ), anchor='center' ) tcl( tableData, "tag", "configure", "coltitle", bg='lightgreen', relief='raised', borderwidth=c( 0, 1, 0, 1 ), anchor='w' ) tcl( tableData, "tag", "configure", "active", fg='yellow', bg='red' ) tcl( tableData, "width", "0", "20" ) scrX <- tkscrollbar( fmTableData, orient="horizontal", command=function(...) tkxview( tableData, ... ) ) scrY <- tkscrollbar( fmTableData, orient="vertical", command=function(...) tkyview( tableData, ... ) ) scrYwidth <- as.integer( tkcget( scrY, width = NULL ) ) tcl( "pack", scrY, side = "right", fill = "y", expand = FALSE, pady = c(0, scrYwidth + 2) ) tcl( "pack", scrX, side = "bottom", fill = "x", expand = FALSE ) tcl( "pack", tableData, anchor='n', side="right", expand=TRUE, fill="both" ) tcl( "pack", fmTableData, fill="both", expand = TRUE, padx=10, pady=10 ) ## expensive time computation [[elided Yahoo spam]] DF <- as.data.frame( matrix( round(runif(1e4 * 100),3), nr=1e4, nc=100 ) ) simulated data for( i in 1:nrow( DF ) ){ tableDataTcl
Re: [R] tcltk TK table : Is it possible to block the cell? [Question in 2003, but TK changes the interfaces functions]
thanks by the help but I do not understand how to set a tag in cell table. cleber Em 05/12/2015 18:57, peter dalgaard escreveu: On 05 Dec 2015, at 20:15 , Cleber N.Borges <kle...@yahoo.com.br> wrote: in 2003 [1] someone asked for: "Is it possible to" block "the cell?" but the solution involves the "tkcmd" that no longer exists ... tkcmd (.Tk.ID (table1), "tag", "celltag" "ZeroOne", "0.1") tcl() should be a drop-in replacement. The .Tk.ID() business should no longer be necessary, though. tcl(table1, "tag", "celltag",) I tried to adapt to: tktag.add (table1, "celltag" "ZeroOne", "0.1") but I get error. How to adapt it? Stop guessing and start thinking? That would be equivalent to tcl(table1, "tag", "add", "celltag" "ZeroOne", "0.1") and as the error message *clearly* says, there is no tag option "add"! -pd Where it could have informations about the tcltk package as it does not have the detailed help? thanks in advanced for help cleber [1] - http://grokbase.com/p/r/r-help/037xs650d8/r-tktable-disable-cell tclRequire("Tktable") 2.9 tt <- tktoplevel() table1 <- tkwidget(tt,"table",bg="white") tkpack(table1) tkcmd(.Tk.ID(table1),"tag","celltag","ZeroOne","0,1") Error: could not find function "tkcmd" tktag.add( table1,"tag","celltag","ZeroOne","0,1") Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] bad tag option "add": must be celltag, cget, coltag, configure, delete, exists, includes, lower, names, raise, or rowtag. tkcmd(.Tk.ID(table1),"tag","celltag","ZeroTwo","0,2") Error: could not find function "tkcmd" tkcmd(.Tk.ID(table1),"tag","configure","ZeroOne",state="disabled",bg="gray") Error: could not find function "tkcmd" tkcmd(.Tk.ID(table1),"tag","configure","ZeroTwo",state="normal",bg="white") Error: could not find function "tkcmd" .Tcl("set tclarray(0,0) Normal") Normal .Tcl("set tclarray(0,1) Disabled") Disabled .Tcl("set tclarray(0,2) Normal") Normal tkconfigure(table1,variable="tclarray") --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code. --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] Tk table: how to get information about configurations ?
I understood that the configuration is done by the "tk configure" but I can not get the value of the properties back. like this: tkconfigure (table, background = 'red') tkcget (table, 'background') # give me an error thanks for you help cleber ## > tkconfigure (table, background = 'red', titlecol=1, multiline=0 ) > > tkcget (table, 'background') # give me an error Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name ".1.1.1". > tkcget (table, 'multiline') # give me an error Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name ".1.1.1". > tkcget (table, 'titlecol') # give me an error Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name ".1.1.1". > Em 05/12/2015 11:40, phgrosj...@sciviews.org escreveu: It depends what property you are looking for… Have you tried tkcget(table, …)? Philippe Grosjean Hello I would like to know the correct way of getting information about the values of the parameters of a Tktable. some details I even managed to extract but quite archaic form ... I thank you for advance for any help. cleber ### # example library( tcltk ) ; tclRequire( 'Tktable' ) tt <- tktoplevel() ; fm <- ttkframe( tt ) tkpack( fm, expand=T, fill='both') # set info (geometry) of toplevel tkwm.geometry( tt, "600x400+400+200" ) # get info (geometry) about toplevel tcl( 'wm', 'geometry', wDataOrg ) table <- tkwidget( fm, 'table', background='white', selectmode="extended" ) tkpack( table, expand=T, fill='both' ) # how get informations about this table? tkconfigure( table ) # ? tcl( table, 'x' ) # ??? tcl( table, 'curselection' ) --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code. --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] tcltk TK table : Is it possible to block the cell? [Question in 2003, but TK changes the interfaces functions]
in 2003 [1] someone asked for: "Is it possible to" block "the cell?" but the solution involves the "tkcmd" that no longer exists ... tkcmd (.Tk.ID (table1), "tag", "celltag" "ZeroOne", "0.1") I tried to adapt to: tktag.add (table1, "celltag" "ZeroOne", "0.1") but I get error. How to adapt it? Where it could have informations about the tcltk package as it does not have the detailed help? thanks in advanced for help cleber [1] - http://grokbase.com/p/r/r-help/037xs650d8/r-tktable-disable-cell > tclRequire("Tktable") 2.9 > tt <- tktoplevel() > table1 <- tkwidget(tt,"table",bg="white") > tkpack(table1) > tkcmd(.Tk.ID(table1),"tag","celltag","ZeroOne","0,1") Error: could not find function "tkcmd" > > tktag.add( table1,"tag","celltag","ZeroOne","0,1") Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] bad tag option "add": must be celltag, cget, coltag, configure, delete, exists, includes, lower, names, raise, or rowtag. > > > tkcmd(.Tk.ID(table1),"tag","celltag","ZeroTwo","0,2") Error: could not find function "tkcmd" > tkcmd(.Tk.ID(table1),"tag","configure","ZeroOne",state="disabled",bg="gray") Error: could not find function "tkcmd" > tkcmd(.Tk.ID(table1),"tag","configure","ZeroTwo",state="normal",bg="white") Error: could not find function "tkcmd" > > .Tcl("set tclarray(0,0) Normal") Normal > .Tcl("set tclarray(0,1) Disabled") Disabled > .Tcl("set tclarray(0,2) Normal") Normal > tkconfigure(table1,variable="tclarray") --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] Tk table: how to get information about configurations ?
Hello I would like to know the correct way of getting information about the values of the parameters of a Tktable. some details I even managed to extract but quite archaic form ... I thank you for advance for any help. cleber ### # example library( tcltk ) ; tclRequire( 'Tktable' ) tt <- tktoplevel() ; fm <- ttkframe( tt ) tkpack( fm, expand=T, fill='both') # set info (geometry) of toplevel tkwm.geometry( tt, "600x400+400+200" ) # get info (geometry) about toplevel tcl( 'wm', 'geometry', wDataOrg ) table <- tkwidget( fm, 'table', background='white', selectmode="extended" ) tkpack( table, expand=T, fill='both' ) # how get informations about this table? tkconfigure( table ) # ? tcl( table, 'x' ) # ??? tcl( table, 'curselection' ) --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] Tktable do not expand inside a Tkframe
hello all, I'm trying to build a table within a frame. I would like the table to expand when the entire window is expanded. I could not find examples of how to solve this problem. I thank you in advance for help. Cleber ### # piece of the code library( tcltk ) tclRequire( "Tktable" ) dataorgW <- tktoplevel() fmMenu <- tkframe( dataorgW, borderwidth=10, relief="groove", bg='red' ) tkpack( fmMenu, expand=1, fill='both' ) scrX <- tkscrollbar( fmMenu, command=function(...) tkxview( tableData, ... ), orient="horizontal" ) scrY <- tkscrollbar( fmMenu, command=function(...) tkyview( tableData, ... ), orient="vertical" ) height <- -1; width <- -1 tableData <- tkwidget( fmMenu, "table", rows=50, cols=50, titlerows=1, titlecols=1, height=height+1,width=width+1, xscrollcommand=function(...) tkset( scrX, ... ), yscrollcommand=function(...) tkset( scrY, ... ), rowstretch='all', colstretch='all' ) tkconfigure( tableData, multiline=0 ) tkgrid( tableData, scrY ) tkgrid.configure( scrY, sticky="nsw") tkgrid( scrX, sticky="new" ) tclarray <- tclArray() tkconfigure( tableData, variable=tclarray, selectmode="extended", background="white" ) --- Este email foi escaneado pelo Avast antiv�rus. https://www.avast.com/antivirus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
[R] how to add 1 + 1 with the interface between R and C
Dear useRs, I would like some help on how to make the sum of 1 + 1 but using the interface between A and C. the function call does .call lock and close the R. Thank you for any help it. Cleber ### R code text_code <-" #include #include #include void testfun( double *k, double *res ); void testfun( double *k, double *res ) { res = k + 1; } " sink('test.c') cat( text_code ) sink() system("R CMD SHLIB test.c") dyn.load( "test.dll" ) is.loaded( 'testfun' ) k=1 .C('testfun', k=as.double(k), res=as.double(0) ) ### Output > text_code <-" + #include + #include + #include + void testfun( double *k, double *res ); + void testfun( double *k, double *res ) + { + res = k + 1; + } + " > sink('test.c') > cat( text_code ) > sink() > system("R CMD SHLIB test.c") cygwin warning: MS-DOS style path detected: C:/R/etc/x64/Makeconf Preferred POSIX equivalent is: /cygdrive/c/R/etc/x64/Makeconf CYGWIN environment variable option "nodosfilewarning" turns off this warning. Consult the user's guide for more details about POSIX paths: http://cygwin.com/cygwin-ug-net/using.html#using-pathnames gcc -m64 -I"C:/R/include" -DNDEBUG -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -std=gnu99 -mtune=core2 -c test.c -o test.o gcc -m64 -shared -s -static-libgcc -o test.dll tmp.def test.o -Ld:/RCompile/r-compiling/local/local320/lib/x64 -Ld:/RCompile/r-compiling/local/local320/lib -LC:/R/bin/x64 -lR > > dyn.load( "test.dll" ) > > is.loaded( 'testfun' ) [1] TRUE > k=1 > .C('testfun', k=as.double(k), res=as.double(0) ) $k [1] 1 $res [1] 0 --- Este email foi escaneado pelo Avast antivírus. https://www.avast.com/antivirus __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, reproducible code.
Re: [R] ternary contour plot
hello, i make here my suggeestion of a Ternary Plot as a RSM. cleber trimage - function(f){ [[elided Yahoo spam]] t1 = length(x) im = aux = numeric(0) for( i in seq( 1, t1, by = 2 ) ){ #idx = seq( t1**2, i*t1, by = -t1 ) - ((t1 - i):0) idx = seq( i*t1, t1**2, by = t1 ) - (i-1) im = c(im, aux, idx, aux ) aux = c(aux, NA) } z = outer(X=x, Y=y, FUN=f) return( matrix(z[im],nr=t1) ) } ## # dataset of mail: Francesco --- june,4 a - c(0.1, 0.5, 0.5, 0.6, 0.2,0, 0, 0.00417, 0.45) b - c(0.75,0.5,0,0.1,0.2,0.951612903,0.918103448,0.7875,0.45) c - c(0.15,0,0.5,0.3,0.6,0.048387097,0.081896552,0.20833,0.1) d - c(500,2324.90,2551.44,1244.50, 551.22,-644.20,-377.17,-100, 2493.04) df- data.frame (a, b, c, d) reg - lm( d ~ -1 + a*b*c ) mod - gsub(:,*, paste( coef(reg), '*', names(coef(reg)), collapse=' + ')) spf - function( a,b,c ){eval(parse(text=mod))} f1 - function(a,b){ c=1-a-b; return( spf(a,b,c) ) } zmat - trimage(f1) windows(w=4.5, h=4.5) par(mar=c(0,0,0,0), pty='s', xaxt='n', yaxt='n', bty='n' ) image(zmat) Em 19/12/2013 13:38, Nicholas Hamilton escreveu: Dear Walmes, I wanted to mention that I have just published on CRAN, a package for R, for the plotting of ternary diagrams. It is based off ggplot2, which is highly regarded, and, my website can be viewed at www.ggtern.com, including many examples, specifically including a case study at the following address: http://ggtern.com/case-study-zirconia-alumina-silica/ Hope you find it of value. Best Regards, Nicholas Hamilton School of Materials Science and Engineering Univesity of New South Wales Sydney Australia [[alternative HTML version deleted]] __ 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 commented, minimal, self-contained, reproducible code.
[R] trying to compile R in win 7 (with Rtools) ... (bitmapdll - png.h )
I tried to follow the intrusions in http://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Building-the-bitmap-files when I type make bitmapdll (in gnuwin directory) or make (in gnuwin/bitmap dir) the libpng and libjpeg seems to compile but libtiff reclaims by png.h file. I set in the MkRules.local: - # optional overrides for making bitmapdll: names of source directories JPEGDIR = C:/Rsrc/R-patched/src/gnuwin32/bitmap/jpeg-9 PNGDIR = C:/Rsrc/R-patched/src/gnuwin32/bitmap/libpng TIFFDIR = C:/Rsrc/R-patched/src/gnuwin32/bitmap/libtiff The error snippet: --- make CC='gcc -std=gnu99 -m32' AR='ar' RANLIB=ranlib -C C:/Rsrc/R-patched/src/gnuwin32/bitmap/libtiff -f ../Makefile.tiff JPEGDIR=C:/Rsrc/R-patched/src/gnuwin32/bitmap/jpeg-9 gcc -std=gnu99 -m32 -DHAVE_PNG -DHAVE_JPEG -DHAVE_TIFF -I. -I../../extra/zlib -I./C:/Rsrc/R-patched/src/gnuwin32/bitmap/libpng -IC:/Rsrc/R-patched/src/gnuwin32/bitmap/jpeg-9 -I./C:/Rsrc/R-patched/src/gnuwin32/bitmap/libtiff -I../../include -O3 -Wall -pedantic-c rbitmap.c -o rbitmap.o rbitmap.c:53:17: fatal error: png.h: No such file or directory compilation terminated. make[1]: *** [rbitmap.o] Error 1 make: *** [all] Error 2 so, I don't understand the error because *The png.h is in C:/Rsrc/R-patched/src/gnuwin32/bitmap/libpng* I thank for some help cleber __ 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 commented, minimal, self-contained, reproducible code.
[R] trying to compile R in win 7 (with Rtools)
hello all, I am trying to compile the R in Win7 and compiles one small part but the script don't move from the 'base' directory to 'stats' I installed the Rtools likee administrator and call the terminal (MS-DOS) like administrator too. if somebody can tell me any tips, I thank in advanced cleber # File LOG http://klebyn.ploud.com/arquivo_log/log C:\Rsrc C:\Rsrc C:\Rsrctar -xf R-3.0.2.tar.gz C:\Rsrcwhere basename cat cmp comm cp cut date diff du echo expr gzip ls makeinfo C:\Rtools\bin\basename.exe C:\Rtools\bin\cat.exe C:\Rtools\bin\cmp.exe C:\Rtools\bin\comm.exe C:\Rtools\bin\cp.exe C:\Rtools\bin\cut.exe C:\Rtools\bin\date.exe C:\Rtools\bin\diff.exe C:\Rtools\bin\du.exe C:\Rtools\bin\echo.exe C:\Rtools\bin\expr.exe C:\Rtools\bin\gzip.exe C:\Rtools\bin\ls.exe C:\Rtools\bin\makeinfo.exe C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\makeinfo.exe C:\Rsrcwhere mkdir mv rm rsync sed sort texindex touch uniq C:\Rtools\bin\mkdir.exe C:\Rtools\bin\mv.exe C:\Rtools\bin\rm.exe C:\Rtools\bin\rsync.exe C:\Rtools\bin\sed.exe C:\Rtools\bin\sort.exe C:\Windows\System32\sort.exe C:\Rtools\bin\texindex.exe C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\texindex.exe C:\Rtools\bin\touch.exe C:\Rtools\bin\uniq.exe C:\Rsrcsort --version sort (GNU coreutils) 8.15 Packaged by Cygwin (8.15-1) Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and Paul Eggert. C:\Rsrccd R-3.0.2\src\gnuwin32 C:\Rsrc\R-3.0.2\src\gnuwin32make all recommended compilaR.log # # http://klebyn.ploud.com/arquivo_log/log # # connections.c: In function 'do_readbin': connections.c:3759:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3761:8: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3769:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3784:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3788:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] pcre_exec.c: In function 'pcre_exec': pcre_exec.c:7190:20: warning: 'match_partial' may be used uninitialized in this function [-Wuninitialized] localtime.c: In function 'timesub.isra.2': localtime.c:1407:5: warning: assuming signed overflow does not occur when assuming that (X + c) X is always false [-Wstrict-overflow] localtime.c:1411:8: warning: assuming signed overflow does not occur when assuming that (X - c) X is always false [-Wstrict-overflow] localtime.c: In function 'time2sub.constprop.10': localtime.c:1566:8: warning: assuming signed overflow does not occur when assuming that (X + c) X is always false [-Wstrict-overflow] localtime.c:1581:5: warning: assuming signed overflow does not occur when assuming that (X + c) X is always false [-Wstrict-overflow] localtime.c:1593:9: warning: assuming signed overflow does not occur when assuming that (X + c) X is always false [-Wstrict-overflow] localtime.c:1599:8: warning: assuming signed overflow does not occur when assuming that (X - c) X is always false [-Wstrict-overflow] localtime.c:1619:5: warning: assuming signed overflow does not occur when assuming that (X - c) X is always false [-Wstrict-overflow] cannot create /tmp/R4428: directory nonexistent mv: cannot stat `/tmp/R4428': No such file or directory make[3]: *** [mkR1] Error 1 make[2]: *** [all] Error 2 make[1]: *** [R] Error 1 make: *** [all] Error 2 C:\Rsrc\R-3.0.2\src\gnuwin32 __ 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 commented, minimal, self-contained, reproducible code.
Re: [R] trying to compile R in win 7 (with Rtools)
thanks. I am logged in the MS-DOS. I thought that cygwin is not necessary... in cygwin terminal, when I type: where sh CLEBER@pinkfloyd /cygdrive/c $ where sh C:\cygwin\bin\sh.exe C:\Rtools\bin\sh.exe so, I have two version of sh and the cygwin will be priority... I will make more test and to consider your sugestion of cygwin... thanks cleber Em 04/10/2013 21:58, Tambellini William escreveu: Hi Cleber It cant find /tmp which does not exist on standard win32 mount system. Are you sure you dont have to call the make all... from the cygwin bash (cygwin terminal) and not the msdos pseudo terminal ? W. __ 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 commented, minimal, self-contained, reproducible code.
Re: [R] trying to compile R in win 7 (with Rtools)
bingo! :-) I got one pass to advanced! my TMP environment variable is: %SystemRoot%\TEMP thanks cleber Em 04/10/2013 22:02, Joshua Wiley escreveu: Hi Cleber, You need to set TMPDIR to a valid directory, the default /tmp/ does not work on Windows. From the cmd shell: set TMPDIR=C:/TMP for example and then run make all recommended Cheers, Josh __ 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 commented, minimal, self-contained, reproducible code.
Re: [R] trying to compile R in win 7 (with Rtools) ... tcl.h
stop because *had a stone in the middle of the way* *in the middle of the way had a stone* (by vinicius de moraes) # so, one more help? somebody? :-) thanks... cleber building package 'tcltk' making init.d from init.c making tcltk.d from tcltk.c making tcltk_win.d from tcltk_win.c gcc -I../../../../include -DNDEBUG -I ../../../../Tcl/include -DWin32 -O3 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o In file included from init.c:22:0: tcltk.h:23:17: fatal error: tcl.h: No such file or directory compilation terminated. make[4]: *** [init.o] Error 1 make[3]: *** [mksrc-win2] Error 1 make[2]: *** [all] Error 2 make[1]: *** [R] Error 1 make: *** [all] Error 2 Em 04/10/2013 22:46, Cleber N.Borges escreveu: bingo! :-) I got one pass to advanced! my TMP environment variable is: %SystemRoot%\TEMP thanks cleber Em 04/10/2013 22:02, Joshua Wiley escreveu: Hi Cleber, You need to set TMPDIR to a valid directory, the default /tmp/ does not work on Windows. From the cmd shell: set TMPDIR=C:/TMP for example and then run make all recommended Cheers, Josh __ 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 commented, minimal, self-contained, reproducible code.
[R] exchange of axis labels in qqnorm function
Hello all, Are there a reason for this behaviour in qqnorm function? (the exchange of axis labels ) x - rnorm(1000) par( mfcol=c(1,2) ) qqnorm(x, xlab='X Axis', ylab='Y Axis', datax=FALSE ) #Default qqnorm(x, xlab='X Axis', ylab='Y Axis', datax=TRUE ) Thanks for any explanation. cleber __ 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 commented, minimal, self-contained, reproducible code.
[R] the results of the SORT function differ from Scilab/Matlab for Complex Numbers
Hello useRs, The results of the SORT function differ from Scilab/Matlab for Complex Numbers in my example. This design is the desirable in R? Thanks. Cleber r - c( 1.7507+0.1689i, 1.7507-0.1689i, 1.3886+0.i, 1.0458+0.0792i, 1.0458-0.0792i, 0.8279+0.1861i, 0.8279-0.1861i, 0.8263+0.3731i, 0.8263-0.3731i, 0.6548+0.i ) cbind(sort(r, d=T)) [,1] [1,] 1.7507+0.1689i [2,] 1.7507-0.1689i [3,] 1.3886+0.i [4,] 1.0458+0.0792i [5,] 1.0458-0.0792i [6,] 0.8279+0.1861i [7,] 0.8279-0.1861i [8,] 0.8263+0.3731i [9,] 0.8263-0.3731i [10,] 0.6548+0.i Scilab --gsort(r) ans = 1.7507 + 0.1689i 1.7507 - 0.1689i 1.3886 1.0458 + 0.0792i 1.0458 - 0.0792i 0.8263 + 0.3731i 0.8263 - 0.3731i 0.8279 + 0.1861i 0.8279 - 0.1861i 0.6548 sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 [3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C [5] LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] R.matlab_1.6.1R.oo_1.10.2 R.methodsS3_1.4.2 loaded via a namespace (and not attached): [1] MASS_7.3-22 tools_2.15.2 __ 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 commented, minimal, self-contained, reproducible code.
Re: [R] the results of the SORT function differ from Scilab/Matlab for Complex Numbers
Ok, thanks. There are a simple mode for emulate this behaviour? Cleber Em 08/11/2012 19:25, Thomas Lumley escreveu: On Fri, Nov 9, 2012 at 10:02 AM, Cleber N.Borges kle...@yahoo.com.br mailto:kle...@yahoo.com.br wrote: Hello useRs, The results of the SORT function differ from Scilab/Matlab for Complex Numbers in my example. This design is the desirable in R? Well, it's deliberate and documented. R sorts complex numbers by real part then by imaginary part. Matlab, according to its documentation, sorts by modulus then phase. There isn't a unique way to sort complex numbers, so you're going to get differences. Personally, I think the R method is more straightforward, since you don't need to decide and remember where the branch cut goes on the phase coordinate. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland [[alternative HTML version deleted]] __ 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 commented, minimal, self-contained, reproducible code.
[R] Error: bad index in plotmo functions for MARS model (package earth)
Hello all useRs, I am tring make a simple surface plot ( 2 by 2 terms of a MARS model (with earth package) but I get the follow error message: plotmo( mars ) Error: bad index (missing column in x?) I don't no how to workround this... :-( I thanks in advanced by some help! Thanks. Cleber ### ### example code: library( earth ) data( gasoline, package='pls' ) nir - gasoline$NIR dim( nir ) [1] 60 401 class( nir ) [1] AsIs oct - gasoline$octane mars - earth( oct ~ nir, nk=300, nfold=10, degree=3, trace=0 ) plotmo( mars ) Error: bad index (missing column in x?) plotmo( mars, all1=T ) Error: bad index (missing column in x?) plotmo( mars, all1=T, all2=T ) Error: bad index (missing column in x?) sessionInfo() R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] pls_2.1-0 earth_3.2-0 plotrix_3.2-2 plotmo_1.2-6 leaps_2.9 loaded via a namespace (and not attached): [1] tools_2.13.1 __ 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 commented, minimal, self-contained, reproducible code.