Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:44:48+00:00 2026-06-08T18:44:48+00:00

Below is an artificial example of a R widget library(gWidgets) options(guiToolkit=RGtk2) f <- function(file,

  • 0

Below is an artificial example of a R widget

library(gWidgets)
options("guiToolkit"="RGtk2")

f <- function(file, max.rows){
    dat <- read.table(file, nrows=max.rows)
return(max(dat[,]))
}

lst <- list() 
    lst$action <- list(beginning="f(",ending=")")
    lst$arguments$file <- list(type="gfilebrowse")
    lst$arguments$max.rows <- list(type="gedit", text=-1)

ggenericwidget(lst, container=gwindow("Example"))

widget

The name of each argument in the R widget is the same as its name in the R function. Is it possible to only change the name appearing in the R widget ? For instance, I would like to write “Maximum number of rows” in the R widget instead of “max.rows”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:44:52+00:00Added an answer on June 8, 2026 at 6:44 pm

    All I could come up with was the following, working from this post. I’m not sure if you’re willing to create the widgets from scratch, but it seems to me that it’s the only way to manually choose labels for your arguments.

    library(gWidgets)
    options("guiToolkit"="RGtk2")
    
    f <- function(file, max.rows){
       dat <- read.table(file, nrows=max.rows)
       return(max(dat[,]))
    }
    
    win <- gwindow("Example")
    
    grp.text <- ggroup(horizontal=FALSE, container = win)
    lbl.text <- glabel("Maximum Lines: ", container = grp.text)
    insert.text <- gedit(-1, container = grp.text)
    
    grp.file <- ggroup(horizontal=FALSE, container = win)
    lbl.file <- glabel("File: ", container = grp.file)
    browse.file <- gfilebrowse(container = grp.file)
    
    read <- gbutton(text="Go", container = grp.file, 
        handler = function(h, ...) {
                cat(f(svalue(browse.file), 
                    as.numeric(svalue(insert.text))));
        }
    )
    

    This is a minimal example; there would have to be some error-checking along the way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

below is the code to download a txt file from internet approx 9000 lines
Below is my main activity file. I am stuck with the bottom area (commented
I am creating a dynamic array inside a function. The code (posted below) runs
Below is my validation() function which controls some messages in an alert: function validation()
below is a java script function and the html for the clicked item that
Below is the code i'm looking at the moment. <s:View xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark title=data xmlns:model=model.*
Below I have a very simple example of what I'm trying to do. I
Below is my current char* to hex string function. I wrote it as an
I am trying find a string in below string. http://example.com/TIGS/SIM/Lists/Team Discussion/DispForm.aspx?ID=1779 by using http://example.com/TIGS/SIM/Lists
Below is the code to write to a file after downloading an image from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.