When the read.table command does not have check.names set to FALSE, the resulting data.frame will call "column name with spaces" "column.name.with.spaces", and phenodata[,survival] will not work. With check.names=FALSE, the column name will stay "column name with spaces", and it will work.

    check.names: logical.  If ‘TRUE’ then the names of the variables in the
              data frame are checked to ensure that they are syntactically
              valid variable names.  If necessary they are adjusted (by
              ‘make.names’) so that they are, and also to ensure that there
              are no duplicates.

Column names do not need to be "syntactically valid variable names", so both of these works fine:

    phenodata$"column name with spaces"
    column <- "column name with spaces"
    phenodata[,column]

But when the name is valid, this can also be used without the quotes:

    phenodata$column.name.without.spaces

Another way to fix this would be to run:

    survival <- make.names(survival)

This would cause "column name with spaces" to be converted to "column.name.with.spaces", again matching the name of the column in the data.frame.