I have an Excel worksheet with 20 rows. Using XLConnect I successfully read the data into 'indata'. In order to sort it on the 'Item' column and the 'Price_Per_Item' column I submit:
index <- with(indata, order(Item, Price_Per_Item)) sortedData <- indata[index, ] The above works fine but now I do not want to name the columns in the R program directly but pass the names of the columns from a parameter file: index <- with(indata, order(parameters$ItemColumn, parameters$PriceColumn)) sortedData <- indata[index, ] This does not work. Only one row appears in 'sortedData'. I've tried unlisting the two arguments to 'order' but this does not correct the problem. Can anyone suggest a solution to my problem? Your assistance is appreciated. - Barry King -- __________________________ *Barry E. King, Ph.D.* Director of Retail Operations Qualex Consulting Services, Inc. barry.k...@qlx.com O: (317)940-5464 M: (317)507-0661 __________________________ [[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.