From dev-return-1636-apmail-systemml-dev-archive=systemml.apache.org@systemml.incubator.apache.org Fri Apr 21 20:43:09 2017 Return-Path: X-Original-To: apmail-systemml-dev-archive@minotaur.apache.org Delivered-To: apmail-systemml-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3782719EA5 for ; Fri, 21 Apr 2017 20:43:09 +0000 (UTC) Received: (qmail 35159 invoked by uid 500); 21 Apr 2017 20:43:09 -0000 Delivered-To: apmail-systemml-dev-archive@systemml.apache.org Received: (qmail 35113 invoked by uid 500); 21 Apr 2017 20:43:09 -0000 Mailing-List: contact dev-help@systemml.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.incubator.apache.org Delivered-To: mailing list dev@systemml.incubator.apache.org Received: (qmail 35100 invoked by uid 99); 21 Apr 2017 20:43:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2017 20:43:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 452361AFC15 for ; Fri, 21 Apr 2017 20:43:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.335 X-Spam-Level: *** X-Spam-Status: No, score=3.335 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FORGED_HOTMAIL_RCVD2=1.187, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=hotmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id E5hX5rn79I0b for ; Fri, 21 Apr 2017 20:43:04 +0000 (UTC) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-oln040092253044.outbound.protection.outlook.com [40.92.253.44]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B89215F342 for ; Fri, 21 Apr 2017 20:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4+R0yrF1pT4N5Q86TbX3sD6wG78LftQz07qKFUI7KxA=; b=fnLQ9ZpqjQHsuCmybKGqtSflMbg0z9I5A1boGS9bGckvBo2vWzISw0FTuiWb4V1x8wE+dYM+wsw6t8E4mVd08C2Trm7lzKEVtxsBSLB3bKK53ZZJ9czvos0Wr+UYpfIj0dN6187I+rai9Xe+cYMIi7rVOWjyPmKv+x5gSICm6H1ZcQoU568b/pEA/SdDwbhqDwlOivdvx5UzDseU33clgmJcHpDrgPWwgi3+J+T0z1w3mCNajAFZTnEVSZO8uvBDIuVBiY/5uT0zLTvcFfhp9Kn96g6weDk1jk/pUKpQT9zoUgISgbXHUii5kSmTHRHAQRb1/AZAQGynaIL4A/OTVQ== Received: from PU1APC01FT050.eop-APC01.prod.protection.outlook.com (10.152.252.58) by PU1APC01HT173.eop-APC01.prod.protection.outlook.com (10.152.253.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1019.14; Fri, 21 Apr 2017 20:42:55 +0000 Received: from PN1PR01MB0717.INDPRD01.PROD.OUTLOOK.COM (10.152.252.53) by PU1APC01FT050.mail.protection.outlook.com (10.152.253.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.14 via Frontend Transport; Fri, 21 Apr 2017 20:42:55 +0000 Received: from PN1PR01MB0717.INDPRD01.PROD.OUTLOOK.COM ([10.174.145.142]) by PN1PR01MB0717.INDPRD01.PROD.OUTLOOK.COM ([10.174.145.142]) with mapi id 15.01.1034.015; Fri, 21 Apr 2017 20:42:50 +0000 From: arijit chakraborty To: "dev@systemml.incubator.apache.org" Subject: Randomly Selecting rows from a dataframe Thread-Topic: Randomly Selecting rows from a dataframe Thread-Index: AQHSut8bTb0Q9HnIoEKza/93d3uGUA== Date: Fri, 21 Apr 2017 20:42:50 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: systemml.incubator.apache.org; dkim=none (message not signed) header.d=none;systemml.incubator.apache.org; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:43D5D24AE85BB5ADFF42D5AB1B4306B5886A6B4355DF52E5131AE67798CE0AF5;UpperCasedChecksum:A5C2203AF3A30FBE1EC9CDC160084EF12D4F2776B86FEC09BAB22A54C446DAE6;SizeAsReceived:7885;Count:40 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [6bP1+0Tzj5wnHMrktmWugr9N4rO8JOUo] x-microsoft-exchange-diagnostics: 1;PU1APC01HT173;5:v6O6/wrCk26JF89PBllSixeNiFDSQpFzqBoFqygNTHbkuZ/xHCoOtZ+YyP8L0v6G8cixfuL3TnowW4DPvfwGD4gw5jOYFpAPbct2ervrp2n9zfmwCKEeN1oVkF4SaGf8aZIZp1U4Gwckc3IuFWlQvQ==;24:nkKoU+3iI323GmiBXGHVCW5/BphdC1doSotRupd0nqRqU5XHrV5M+UsOdK3FIejfehKu+asO/Qf2n09Jr4g7ni9yE7EcHCfUgQjq1P/gZSI=;7:8xtPp86oBTf0rLP/B1Nndh7D4gxj93psov/XquqpUXMhkKQQnvo2PdRWMVMxfQ0TbvywXEOjjrhFJEesCdB1iafWmbB5LTGVlO2rkUUlRtSN+JZBOCCwo840+IjPC30ILh1QyC73AX7KnCGY65Kkp8PmaKtCXLPtv81vueHFAoHy614sYClzgbJN5R7t3E573J88pWh4RGPk7+nlMa48QZKGFp2UE/Qg6Q5AJKHJ2KEmqvAEG6iysjwgWNshH80/EnT1wo4vqevqYIKyQRmJdJWVPkqQeHhZ/aDbm/hCRn8SvlU2n9wo9l9l1QsGjoL9 x-incomingheadercount: 40 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:PU1APC01HT173;H:PN1PR01MB0717.INDPRD01.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: b9858afe-c7a2-41b0-8ee0-08d488f6fa5c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322274)(1603101448)(1601125374)(1701031045);SRVR:PU1APC01HT173; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(444000031);SRVR:PU1APC01HT173;BCL:0;PCL:0;RULEID:;SRVR:PU1APC01HT173; x-forefront-prvs: 02843AA9E0 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_PN1PR01MB0717D81B8F7E05E409C596B3A31A0PN1PR01MB0717INDP_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2017 20:42:50.8582 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT173 --_000_PN1PR01MB0717D81B8F7E05E409C596B3A31A0PN1PR01MB0717INDP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Suppose I've a dataframe of 10 variables (X1-X10) and have 1000 rows. Now I= want to randomly select rows so that I've a subset of the dataset. Can anyone please help me to solve this problem? I tried the following code: randSample =3D sample(nrow(dataframe), 200); This gives me a column matrix with position of the row randomly selected. B= ut I could not able to solve how from this matrix I can subset data from or= iginal dataframe. Thank you! Arijit --_000_PN1PR01MB0717D81B8F7E05E409C596B3A31A0PN1PR01MB0717INDP_--