From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kPGIHd1EsWC3bgAAgWs5BA (envelope-from ) for ; Fri, 28 May 2021 21:30:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KK3QGN1EsWDHCQAAbx9fmQ (envelope-from ) for ; Fri, 28 May 2021 19:30:37 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4144910836 for ; Fri, 28 May 2021 21:30:36 +0200 (CEST) Received: from localhost ([::1]:42118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmiBn-0002yf-8U for larch@yhetil.org; Fri, 28 May 2021 15:30:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmiB9-0002yM-6S for emacs-orgmode@gnu.org; Fri, 28 May 2021 15:29:55 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:53672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmiAy-0004xX-AY for emacs-orgmode@gnu.org; Fri, 28 May 2021 15:29:54 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 960A412108F; Fri, 28 May 2021 15:29:37 -0400 (EDT) (envelope-from wtd@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=date:from :to:cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=lDOKPALd3e3CH+5Cm55t9i8I5JQCoNZ668UQ65 bAV9c=; b=CLJA1xPZJ9+OcEs7vWjV51no4KMKkxs0AzpRkJFvOwhQenlvPTyj7I isUj5oskGMbYhu90ad/CvnWelTdLswvowFXB9g7FlLs7f4QnrjA4zzZ4BMc+5Rat GZ82QMgchJF1DViCBkKrQbvdqYxbqpxxveCz9YgAqpnvbtpoxS27Y= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8EDAF12108E; Fri, 28 May 2021 15:29:37 -0400 (EDT) (envelope-from wtd@pobox.com) Received: from shell3.miskatonic.org (unknown [199.103.62.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 380A812108B; Fri, 28 May 2021 15:29:35 -0400 (EDT) (envelope-from wtd@pobox.com) Received: by shell3.miskatonic.org (Postfix, from userid 1000) id BA25B120790; Fri, 28 May 2021 15:29:33 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by shell3.miskatonic.org (Postfix) with ESMTP id B4FA5120650; Fri, 28 May 2021 15:29:33 -0400 (EDT) Date: Fri, 28 May 2021 15:29:33 -0400 (EDT) From: William Denton X-X-Sender: wtd@shell3.miskatonic.org To: Roger Mason Subject: Re: Passing a variable into an R source block. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Pobox-Relay-ID: 08E60884-BFEB-11EB-8890-D5C30F5B5667-56320186!pb-smtp20.pobox.com Received-SPF: pass client-ip=173.228.157.52; envelope-from=wtd@pobox.com; helo=pb-smtp20.pobox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622230236; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=u84ox3ToZppSH+QLTBY2rHW6G66dJNqQK4CDgA+UO4E=; b=WFfjNLFrU2E0D1CEhVvYS9zJmK/v1MKhYpyA1xhy2MDO47Q8PXXjGTKQHDYoz1WuQXTuWd RO3/Dt0TPTBb0D0w1yhuyjM844edB9SvFBSO/obLToIUCjqbneXmcGZOY9RTZwaxrwptuk xcH1N82o8hw6cYV2pp+qeuYhZZMMS6XSO9jzFNTeoEn9UWjp7gjnpBYliz5K6/kBWhv80w k+haxm0ZFVPUEptSyEIDMKxGmazERMda3S+HRAAiX25bBLEDgCM1Kw6tT5ZVntEQ1LQdIn 3vwQGesgF+CEqbXQoP/rpvjvNre/gQLcl6AxIGEz5FBZjWnKeYDf0QNGrteSWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622230236; a=rsa-sha256; cv=none; b=PsaRmUsF0bBrcwTghrnOqgJRJlZM2eS9nU/NRy6ExZYs8ApcdVfdmJYqJ9xS6K9jE6BRhy uTuLmBqCWZwiGk6maVdc1DX4w6PeotP8FwXcd3Fxnod1N+JzPEKX5AFwTDSW5tjAIwAuZq 3iLTvMxREUPHHpJuc82ReUTL7ei01NfHaI98w5ZFEBGyfrv5KEq9Jz1RUYx1B/TnG1nqrx +kr4rt8yZ5QMrJFvtYGjxPykkibtOfh5JYA87PLT25U1EkxY8nvSUf0Anml2o1pW6lGWnu 3m1YbyiVVVQkWdwkx65o6jxJ/KfrlhPBqYep0vwFc/uT4XcYQJTgqJseIUB1FA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=CLJA1xPZ; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=CLJA1xPZ; dmarc=pass (policy=none) header.from=pobox.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4144910836 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: RLEYXgONReMy The Org table is passed in to R as a data.frame, so all you need is this at the start (with stringr loaded in previously): #+begin_src R :session :colnames yes :var data=query t <- str_split_fixed(data$te, " ", 3) colnames(t) <- c('date','cycle','energy') t #+end_src #+RESULTS: | date | cycle | energy | |-----------------+-------+----------------| | 20210528-053900 | 1 | -1333.58106425 | | 20210528-053900 | 2 | -1333.25006295 | | 20210528-053900 | 3 | -1332.40596663 | | 20210528-053900 | 4 | -1327.1880297 | | 20210528-053900 | 5 | -1320.63944318 | Bill -- William Denton https://www.miskatonic.org/ Librarian, artist and licensed private investigator.