The position of elements on the periodic table is significant. The elements arranged in combination on the periodic table exhibit identical electronic configurations and thus identical reactivity and chemical properties. The vertical rows of elements are known as groups.
Fluorine is a group 17 element. This group has a unique name, they are termed as halogens. Chlorine is also a halogen, they both exhibit seven valence electrons in their outer shell, and as such desires to take an additional electron for a stable octet to form the single charged anion.
Oxygen is a group 16 element, exhibiting 6 valence electrons, and likes to prevail as the double charged anion. As a consequence, the chemical properties of fluorine more closely resemble with that of chlorine, and not with oxygen.