tableAgent: A chain-method table class in Matlab

バージョン 2.0.1 (1.96 MB) 作成者: Renwen Lin
@tableAgent: A class for applying chain method on table in Matlab, and providing with many useful methods functions
ダウンロード: 30
更新 2019/3/7

tableAgent: A chain-method table class in Matlab

methods of tableAgent:

areParensNext droprow numArgumentsFromSubscript stackCell
blockCopy gen numel stackCell2
blockExchange gen_dummy pivot subsasgn
cmdstrStandardize gen_forEachCol plotcols subsref
col gen_slice plotcolsNumber subsrefDot
colbyLabel genbygroup queryTabAinTabB summary
colstr2coldouble groupby renamecol tableAgent
colstrLabel2coldouble height row unstack
copykeyproperties istableAgent rowstr2rowdouble varargout_demo
disp keepcol runCmdGen width
dispBasicProperties keeprow size
dispclass merge sortrows
dropcol mergeTables stack

1.1 objective
1.2 Install
1.3 usage
1.4 requirement
Author: linrenwen@gmail.com

1.1 objective
@tableAgent: create a class for applying chain method on table in Matlab

1.2 Install
All files you need are included in tableAgent_test.zip.

unzip the tableAgent_test.zip. and add the folder to matlab path.
run tableAgent_test.m for examples.

1.3 usage
See tableAgent_test.m for List of all features.

data construction
%% data construction method 1
T = tableAgent;
T.name = ["Joan","Merry","Tom","Kate"]';
T.sex = ["male","female","male","female"]';
T.grade = [99,67,66,35]';
T.G = [99,67,88,55]'+ 4;

%% data construction method 2
T = table;
T.name = ["Joan","Merry","Tom",
TB = tableAgent(T);
generate new col or variable, by passing variable x
%% Test of passing variable x
para.x = [1,1]';
TB = T.row([1,2]).gen('Gx=grade + para.x',para);
generate new col or variable, by passing inline-function para
%% Test of passing inline-function para
fnew = @(x)(x+3);
TB = T.row().gen('G=fnew(pi)',fnew,'fnew');
TB = T.row().gen('G2=fnew(pi)',fnew,'fnew');
generate new col by group operation
%% chain method demo
TB = T.row('G>=60').groupby('sex').genbygroup('SexPlus = G+1')...
.genbygroup('SexPlus = sex+"plus"');
test of dropcols and droprows
TB = T.row([1,2]).droprow('G==71');
TB = T.keeprow([1,3,4]);
TB = T.dropcol(2).row(3).droprow().keepcol('name,G');

TB = T.droprow('G==71');
TB = T.row(1).droprow()
index of table Agent
%% Test of assign
T{1,2:3} = [33,55];
T{1,1} = "Joan,Hi";
chain-method operation
%% chain method demo
TB =T.row('grade==67|grade<38').gen('grade = grade+1').gen('G = grade*2')...
.row('grade<=99').gen('G = log(grade)*10')...
.row([1,3]).gen('G=3')...
.row().gen('G=pi');
disp
%% test of disp
T = T.row([1,2]);
T.gen('G=2').dispclass;
dispclass(T);
disp(T);
disp(T.table);

1.4 requirement
Matlab 2018b

引用

Renwen Lin (2024). tableAgent: A chain-method table class in Matlab (https://github.com/homecls/tableAgent), GitHub. 取得済み .

MATLAB リリースの互換性
作成: R2018b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersTables についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub の既定のブランチを使用するバージョンはダウンロードできません

バージョン 公開済み リリース ノート
2.0.1

list of methods of tableAgent

2.0

add pivot, stack, stackCell, plotcols, gen_slice and other methods for tableAgent class

1.041.0.3

add method of stack and unstack

1.0.3

update readme.md

1.0.2

Update Readme

1.0.1

この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。
この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。