The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 random reordering of the data on a column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

coll@inia.

Spain
125 Posts

Posted - 12/29/2014 :  07:13:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.8.5 and Service Release (Select Help-->About Origin):
Operating System:win 7
Anyone knows how to reorder the existing data in a column (15000 rows) randomly?
I also need to repeat that reordering n times to obtain random means and sd values for each row data

I need that to calculate probabilities for each row value........

I did not find any function or help in the forums

thanks julio

lkb0221

China
497 Posts

Posted - 12/29/2014 :  2:40:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can create a new column beside it, fill this new column with random data and sort the worksheet by it.

Zheng
OriginLab
Go to Top of Page

coll@inia.

Spain
125 Posts

Posted - 12/29/2014 :  3:24:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Zheng!
simple and smart idea! and above all it looks like it worked beautifully!!!!

two minor points:
1) if I am not mistaken, the final sorting it is best done by including only the columns with the old values rather than with the whole worksheet. That allows to maintain the order of the rest of the data (gene names, accesion numbers, etc) and change their values only in a random way.

2) it will be time consuming to make even 4 variations, perhaps could be it automated? any simple ideas?

nevertheless, I found the idea very ingenious

Thank you again & Merry Christmas!
julio
Go to Top of Page

lkb0221

China
497 Posts

Posted - 12/29/2014 :  4:08:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
Please try the following sample:

// Start
// Assume the dataset is the 2nd column, and the random number is in 4th one in [book1]Sheet1
range rr = [Book1]Sheet1!;
sort.c1 = 2;
sort.c2 = 2;
sort.r1 = 1;
sort.r2 = rr.nrows;
sort.cName1$ = A: D;
sort.wksName$ = [Book1]Sheet1!;
sort.wks();
// End



Zheng
OriginLab

Edited by - lkb0221 on 12/29/2014 4:28:41 PM
Go to Top of Page

coll@inia.

Spain
125 Posts

Posted - 12/30/2014 :  12:50:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
REALLY FANTASTIC!!!

that was really fast and convinient.

Thank you very much and have a HAPPY NEW 2015!!

julio
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000