This paper discusses some properties of convex subsets of affine spaces over the principal ideal domains Z[1/p], where p is a prime number. In particular, it is shown that such convex sets are equivalent to certain algebras with finitely many operations, and a minimal number of generators for the segments of the line Z[1/p] is provided. In the case of p = 3, relations between convex sets and a certain groupoid variety are discussed.