user1667674
user1667674

Reputation:

Sourcing script does not print any output to the console

I am using Ubuntu inside Windows XP using VirtualBox, and I installed R properly. I am using a library called psych for this. The following is my code:

impact <- read.table("stats1.ex.02.txt", header=T)
class(impact)
describe(impact)  

I am taking Statistics One course on coursera.org and the Prof gives this txt file to work with. When I run this in R, using source("test.R") (where test.R is the filename I gave), nothing happens. What could be problem here ?

Upvotes: 2

Views: 6526

Answers (1)

A5C1D2H2I1M1N2O1R2T1
A5C1D2H2I1M1N2O1R2T1

Reputation: 193517

Try using source("test.R", echo=TRUE) or adding print to whatever you want printed after sourcing your script. Thus, your script might be:

impact<- read.table("stats1.ex.02.txt",header=T)
print(class(impact))
print(describe(impact))

Upvotes: 10

Related Questions