TimeSeriesやEventSeriesのようなオブジェクトにおいて入力の日付をどのように解釈するかを指定するオプションである.DateListPlotやDateHistogramのような日付可視化関数でも用いられる.
DateFunction
TimeSeriesやEventSeriesのようなオブジェクトにおいて入力の日付をどのように解釈するかを指定するオプションである.DateListPlotやDateHistogramのような日付可視化関数でも用いられる.
詳細
- DateFunctionは,通常,入力された日付を特定の形式に変換するため,または入力に含まれる可能性のある曖昧さを解消するために用いられる.
- DateFunction->(DateList[#,{"e1",…}]&)等の設定で,一連の要素"ei"を各日付から抽出するように指定する. »
- DateFunctionオプションの典型的なデフォルト値にはAutomaticおよびIdentityが含まれる.
例題
すべて開く すべて閉じる例 (3)
data = {{{10, 1}, 8}, {{10, 10}, 10}, {{10, 20}, 12}, {{10, 24}, 14}, {{11, 5}, 15}, {{11, 15}, 20}};DateListPlot[data, DateFunction :> (Join[{2006}, #]&)]data = Table[{i, Sin[i / Pi]}, {i, 50}];DateListPlot[data, DateFunction :> (DateList[{2006, 1, 1 + # * 7}]&)]デフォルトで,時系列の日付粒度は入力のタイムスタンプから推測される:
TimeSeries[Range[3], {Today}]Normal[%]DateFunctionを使って異なる粒度を選択する:
TimeSeries[Range[3], {Today}, DateFunction -> Function[DateObject[#, "Year"]]]Normal[%]スコープ (2)
DateListPlotについて曖昧な日付文字列を解釈する関数を定義する:
data = {{"06/01/06", 8}, {"07/01/06", 10}, {"08/01/06", 12}, {"09/01/06", 14}, {"10/01/06", 15}, {"11/01/06", 20}};DateListPlot[data, DateFunction :> (DateList[{#, {"Month", "Day", "YearShort"}}]&)]DateListPlot[data, DateFunction :> (DateList[{#, {"Day", "Month", "YearShort"}}]&)]DateListPlot[data, DateFunction :> (DateList[{#, {"YearShort", "Month", "Day"}}]&)]data = {{"2006 12-1", 8}, {"2006 12-2", 10}, {"2006 12-3", 12}, {"2006 12-4", 14}, {"2006 12-5", 15}, {"2006 12-6", 20}};DateObject[data[[1, 1]]]EventSeries[data, DateFunction :> (DateObject[{#, {"Year", "Month", "Day"}}, "Day"]&)]Normal[%]EventSeries[data, DateFunction :> (DateObject[{#, {"Year", "Day", "Month"}}, "Day"]&)]Normal[%]テキスト
Wolfram Research (2007), DateFunction, Wolfram言語関数, https://reference.wolfram.com/language/ref/DateFunction.html.
CMS
Wolfram Language. 2007. "DateFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DateFunction.html.
APA
Wolfram Language. (2007). DateFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DateFunction.html
BibTeX
@misc{reference.wolfram_2026_datefunction, author="Wolfram Research", title="{DateFunction}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/DateFunction.html}", note=[Accessed: 08-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_datefunction, organization={Wolfram Research}, title={DateFunction}, year={2007}, url={https://reference.wolfram.com/language/ref/DateFunction.html}, note=[Accessed: 08-September-2026]}