- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在 table1.txt 中有原始温度数据,其站号标题为
Date 101 102 103
1/1/2001 25 24 23
1/2/2001 23 20 15
1/3/2001 22 21 17
1/4/2001 21 27 18
1/5/2001 22 30 19
我有一个查找表文件 lookup.txt,内容如下:
ID Station
1 101
2 103
3 102
4 101
5 102
现在,我想创建一个新表 (new.txt),其 ID 号标题应显示为
Date 1 2 3 4 5
1/1/2001 25 23 24 25 24
1/2/2001 23 15 20 23 20
1/3/2001 22 17 21 22 21
1/4/2001 21 18 27 21 27
1/5/2001 22 19 30 22 30
无论如何我可以在 R 或 matlab 中做到这一点吗?
最佳答案
我想出了一个使用 tidyverse 的解决方案。它涉及一些从宽到长的转换,匹配 Station 上的数据帧,然后传播变量。
#Recreating the data
library(tidyverse)
df1 <- read_table("text1.txt")
lookup <- read_table("lookup.txt")
#Create the output
k1 <- df1 %>%
gather(Station, value, -Date) %>%
mutate(Station = as.numeric(Station)) %>%
inner_join(lookup) %>% select(-Station) %>%
spread(ID, value)
k1
关于r - 如何从 R 或 matlab 中的原始数据和查找表创建新表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53464153/
在更大的应用程序的上下文中,我的小程序需要将一些数据打印到 Zebra 或 Dymo(取决于用户安装的内容)标签打印机。 我收到的数据是转义形式,我只需要发送到打印机并让它解释它的数据。 搜索我找到了
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭去年。 Improve th
我正在尝试使用 GetUserMedia() 从用户麦克风录制和保存声音片段和 AudioContext蜜蜂。 我已经能够使用 MediaRecorder 做到这一点API,但不幸的是,Safari/
我想编写一个将十六进制数据转换为音频文件的小型Web应用程序。 音频文件的数据将采用十六进制格式,如下所示: DA1FFFF8B3AEEE2E23BBB9A2221F10400180001EF1C1E
在其中一个 API 中,我收到以下 Json 响应:您可以在此处查看此响应示例 Sample Json resopnse { "histogram" : { "1" : "12
如何在 python 上使用 Resuests 库发布原始数据?我正在尝试登录。 Json 抛出异常 TypeError: set(['"clienteLogin":{"Token":"b94261f
有人告诉我,无论何时使用字节,都应该将变量声明为无符号字符。在 Windows 的数据类型中,BYTE 被声明为 unsigned char。 我的问题: 为什么? Unsigned 是从 0 到 2
如何读取 GPS 原始数据,更具体地说,我需要卫星伪距。此数据不提供 NMEA 格式。 最佳答案 卫星伪距在 official API 中不可用 ,既不通过 GpsStatus.Listener 也不
给定以下 XML: 1424 我正在尝试获取
我使用了以下代码将十进制的 bigint 转换为 bytearray(原始数据),但我得到了错误的结果。 这里有什么错误吗? 我正在 Apple Mac 中尝试此操作(适用于 Iphone 应用程序)
我在 iOS 应用程序中使用 Firebase 登录时遇到了表格 View 问题。该表从子提要加载内容。当我第一次登录时,表加载正常,但如果我注销并再次登录,表会重新加载所有数据,将原始数据添加到表的
我正在使用 Apache BCEL动态创建 java 类,每个类都有自己的关联图像。这些生成的类实现了以下接口(interface): interface ImageOwner { byte[
有没有办法读取 Sim 卡的“原始”数据?类似于如何使用 Pdu 的 SmsMessage 原始数据读取原始数据? 最佳答案 阅读SIM卡相关信息需要TelephonyManager API . Te
有没有办法在命令行 curl 中将数据 POST 或 GET(插入您最喜欢的 HTTP 方法)数据到 URL 并包含在原始发布的数据 header 值中,而不是发出 -H 选项? 例如: $curl
我正在开展一个项目,尝试使用 Myo Gesture Control Armband 识别一些用于康复治疗的 Action /姿势。 . 我有三个问题: EMG Raw Data 返回的最大值和最小值
我有 flv 文件,其中包含带有 aac 原始数据的音频标签。每个音频标签都有一组 aac 原始数据。原始数据有不同的大小。我想通过 RTP 发送。我添加了 13 位大小的 AU header 。它是
我使用制造商提供的库通过 USB 访问相机。我通过结构接收有关图像的信息: typedef struct { /*! Buffer handle which contains new data
我正在从事 BLE 项目,其中录音机硬件连续流式传输数据并发送到 iOS 应用程序。从 iOS 应用程序端,我需要读取传输的数据。 硬件向 iOS 应用程序发送 HEX 数据,我们需要创建 .mp3/
我正在尝试使用 AFNetworking 发出 HTTP PUT 请求以在 CouchDB 服务器中创建附件。服务器需要 HTTP 正文中的 base64 编码字符串。如何在不使用 AFNetwork
我有一些 Graylog2 使用 syslog 输入插件接收的日志。 我需要以我收到的相同格式导出它们,无需任何解析,以便我可以发送给应用程序支持团队。 我已将 INPUT 设置为保留 full_ma
我是一名优秀的程序员,十分优秀!