2016-08-31 R で文字列の長さを調べる R character 型の文字列が何文字であるか、サイズを調べるには、nchar 関数を使えばいいです。 実行例 > nchar("abc") [1] 3 > nchar("あいう") [1] 3