File: gcat.R

package info (click to toggle)
r-cran-r.utils 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,936 kB
  • sloc: sh: 18; makefile: 6
file content (33 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
message("*** Testing gcat()...")

library("R.utils")

gcat("Hello world!\n")

a <- 1
gcat("a=${a}\n")

gcat(GString("a=${a}\n"))

message("*** Testing gcat()...DONE")


message("*** Testing gstring()...")

a <- 2
s <- gstring("a=${a}\n")
print(s)

cat("a=${a}\n", file="foo.txt")
s <- gstring(file="foo.txt")
print(s)
file.remove("foo.txt")

pathT <- tempdir()
pathname <- file.path(pathT, "foo.txt")
cat("a=${a}\n", file=pathname)
s <- gstring(file="foo.txt", path=pathT)
print(s)
file.remove(pathname)

message("*** Testing gcat()...DONE")