This code should work:
library(raster)
input <- list.files(pattern='tif$')
output <- gsub("tif", "img", input)
for (i in seq(along=input)) {
r <- raster(input[i])
# using "2 byte unsigned integer" data type
r <- calc(r, fun = function(x) x * 2, datatype='INT2U', filename = output[i])
}