0

Just started coding yesterday for the first time and I have ZERO clue as to what I'm doing. I'm trying to run a t-test in R studio but I'm getting this error:

Error in exists(cacheKey, where = .rs.WorkingDataEnv, inherits = FALSE) : invalid first argument

Error in assign(cacheKey, frame, .rs.CachedDataEnv) : attempt to use zero-length variable name

Error in x(select[h, 1:50]) : could not find function "x"

This is the code:

KIRC1 = read.table("KIRC.txt")
x = as.vector(KIRC1[, 1:50])
y = as.vector((KIRC1[, 51:100]))
hk = t.test(x(select[h, 1:50]) (y(select[h, 51:100]), alternative = "greater"))

How do I make the t-test run?

neilfws
  • 32,751
  • 5
  • 50
  • 63
  • 2
    Difficult to help without seeing the data in `KIRC1`. But there are some obvious issues with your code. 1. The parentheses indicate that there are functions named `x()` and `y()`. This is not the case, hence the error. 2. It's not clear how or why you are trying to subset `x` and `y`. You don't use parentheses to do this, where does the `select()` function come from and what is `h`? 3. The `x` and `y` terms are not separated by a comma in `t.test()`. It looks like you already have two numerical vectors, `x` and `y`, so something like `t.test(x, y, alternative = "greater")` might work. – neilfws Jul 13 '23 at 03:43
  • HI green22! Welcome to StackOverflow. Would you be able to include some of your data in your question? Thanks! – Mark Jul 13 '23 at 05:13
  • See: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Mark Jul 13 '23 at 05:14

0 Answers0