2015-08-09 63 views
0

我有528個觀測到的溫度數據的數據範圍值(2-53)。我要縮放數據以使其範圍介於0和1之間以適應貝塔分佈,以找到Beta分佈適合數據的天氣。R中的縮放數據集

有誰能告訴我請我怎麼縮放到我的數據?

+0

你的意思是數據規範化範圍[0,1],對吧?檢查此:http://stn.spotfire.com/spotfire_client_help/norm/norm_scale_between_0_and_1.htm和一些很好的答案在這裏:http://stackoverflow.com/questions/12969623/normalisation-of-a-two-column-data -using-min-and-max-values – AntoniosK

+0

非常感謝你 –

回答

0

將它們除以最大值...例如,

# Dummy data 
x = rnorm(100, mean=15) 

# Normalise 
x = x/max(x) 
+0

非常感謝 –