On Jun 26, 2015, at 3:02 PM, Rich Shepard wrote:
> On Fri, 26 Jun 2015, MacQueen, Don wrote:
>
>> I would have just assigned them all to the first day of the month, using
>> as.Date( paste0(allchem$sampdate,'-01') )
>> (or maybe the middle of the month represented by the 15th)
>> and then had a
On Fri, 26 Jun 2015, MacQueen, Don wrote:
I would have just assigned them all to the first day of the month, using
as.Date( paste0(allchem$sampdate,'-01') )
(or maybe the middle of the month represented by the 15th)
and then had a variable that was of the Date class in the base R (with
which I
If
a <- read.table(args[1],sep="\t",header=T, stringsAsFactors=F)
fails but
a <- read.table("/path/to/file/filename.txt", header=T,sep="\t",
stringsAsFactors=F)
succeeds, then since those two commands are otherwise identical, you had
better put
print(args[1])
before the call to read.table
I would have just assigned them all to the first day of the month, using
as.Date( paste0(allchem$sampdate,'-01') )
(or maybe the middle of the month represented by the 15th)
and then had a variable that was of the Date class in the base R (with
which I am familiar, no small consideration).
Depe
Do not post to the list in html and always copy your message to the list so
others can follow the discussion.
That should not matter if the possible values in a row are only 0, 1, 2 as you
indicated. No matter how large the matrix is, the table should only have three
columns. If more values are
Oops - error on my part. Sorry.
On Fri, Jun 26, 2015 at 2:54 PM, Bert Gunter wrote:
> ... and you should also know by now to cc the list and not respond just to me!
> Bert Gunter
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
>-- Cliffor
On Jun 26, 2015, at 10:14 AM, Sarah Goslee wrote:
> Guess what?
>
> On Fri, Jun 26, 2015 at 9:09 AM, ritschko wrote:
>> Hey! Have you ever found a solution to your problem? I have exactly the same
>> issue.
>>
>> Best
>>
Dear ritschko;
People on the R-help list generally feel annoyed when
as.yearmon(allchem$sampdate)
worked for me.
David
On 26 June 2015 at 19:44, Rich Shepard wrote:
> Data file 'example.dat' has this format:
>
> stream,sampdate,param,quant
> B,1992-03,Cl,4
> B,1992-03,SO4,33
> B,1992-03,pH,8.43
> B,1992-04,Cl,4
> B,1992-04,SO4,32
> B,1992-04,pH,8.46
> B,1992-0
Don't use html formatting in your emails and use dput() to provide data.
Assuming your matrix is called mat:
> mat <- structure(c(0L, 1L, 2L, 1L, 0L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
0L, 1L, 0L, 2L, 0L, 0L, 1L, 2L, 0L, 0L, 0L, 2L, 2L, 0L, 0L, 2L,
2L, 2L, 2L, 2L, 2L, 2L), .Dim = c(5L, 7L), .Dimna
On Fri, 26 Jun 2015, Rich Shepard wrote:
allchem$sampdate <- as.yearmon(format(%Y-%m))allchem$sampdate
Reading the yearmon help page again led me to try
allchem$sampdate <- as.yearmon(allchem$sampdate)
which produces the following structure:
'data.frame': 2226 obs. of 4 variables
... and you should also know by now to cc the list and not respond just to me!
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Fri, Jun 26, 2015 at 10:58 AM, Kate Ignatius wrote:
> "reading in a tab delimited fi
Data file 'example.dat' has this format:
stream,sampdate,param,quant
B,1992-03,Cl,4
B,1992-03,SO4,33
B,1992-03,pH,8.43
B,1992-04,Cl,4
B,1992-04,SO4,32
B,1992-04,pH,8.46
B,1992-05,Cl,4
B,1992-05,SO4,31
B,1992-05,pH,8.43
It's read into R with
allchem <- read.table('example.dat', stringsAsFacto
Hi there,
I have a matrix (n*m) which rows including 0,1,2
I want to know the frequency of each elements (0 , 1 , 2) separately for
each row!
for example :
123 456 7
A 0 1 10 222
B 1 1 1200 2
C 21 10 0
Hi Jens,
Thanks for the example! I can see that you can change the 'filename' attribute
for a ff object one-by-one, but is there a way to issue one command that will
automatically change the attribute to all the ff objects in your workspace, as
you can imagine when I have large number of object
Hi David,
Normally, I would have a R code example for this, but since I'm new to this too
and just didn't have time to do that. Hopefully, Jen's code illustrates the
problem.
Tao
On Thursday, June 25, 2015 8:53 PM, David Winsemius
wrote:
On Jun 25, 2015, at 4:04 PM, Shi, Tao vi
??
Are you expecting us to guess what your code was from
"reading in a tab delimited file using args" ?
You've posted here before and should know by now that explicit code
should be provided whenever possible.
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And
When reading in a tab delimited file using args I keep getting the error:
Error: unexpected symbol in "Name index"
Execution halted
The code is this:
a <- read.table(args[1],sep="\t",header=T, stringsAsFactors=F)
When inputting the file directly, as follows, this produces no errors:
a <- read
Guess what?
On Fri, Jun 26, 2015 at 9:09 AM, ritschko wrote:
> Hey! Have you ever found a solution to your problem? I have exactly the same
> issue.
>
> Best
>
The people who read the R-help email list have exactly zero idea what
you're talking about.
The above is all that shows up on the maili
Hey! Have you ever found a solution to your problem? I have exactly the same
issue.
Best
--
View this message in context:
http://r.789695.n4.nabble.com/large-dummy-variable-set-in-R-tp4700833p4709112.html
Sent from the R help mailing list archive at Nabble.com.
___
I'm trying to read in a file using the function fread.
The file that I'm trying to read in has about 100 lines of information I
don't want prior to getting to my matrix of data that I do want. On the
line prior to the data I want there is always a string identifier "*end*"
The following fread ca
On Jun 25, 2015, at 11:52 PM, Steven Yen wrote:
> Thanks Davis. But actually, the line is legitimate:
I didn't say it was illegitimate, only confusing.
>
> if (inherits(wt,what="character")) wt<-data[,wt]
What you are asking for is known in R as non-standard evaluation. Examples
include th
Dear Jim Holtman,
Thank you very much for your help.
Theproblem I'm trying to solve is “To determine weather the evolutionof ENSO
can influence rainfall over Tanzania”. In this study I havetwo types of data,
ie Rainfall data (for 23 stations) and Ninoindices data, both spanning a period
of 31 y
First, you have to increase the bottom margin to have enough space for the
legend.
You do it like this:
par(
mar = c(6,4,4,2)
)
From R help:
‘mar’ A numerical vector of the form ‘c(bottom, left, top, right)’
which gives the number of lines of margin to be specified on
Offtopic. This list is about R programming. Post to a statistics list
like stats.stackexchange.com instead. Better yet, find a local expert
to help you. What you describe sounds confused and likely to produce
nonsense to me. You may not even have the information needed to answer
the question you as
OK. I do not have canned solution for you, but
temp <- apply(test,1, table)
gives you number of occurences in each row. From this it shall be possible to
extract name info and number info
lapply(temp, function(x) x[x>1])
[[1]]
four
2
[[2]]
one two
2 2
[[3]]
three
2
[[4]]
four
Am 26.06.2015 um 10:38 schrieb PIKAL Petr:
Hi
I am little bit lost in your logic. Why triple in your fourth line is one. I
expected it will be four?
Petr
Sorry yes you are right ...
type mismatch
Knut
__
R-help@r-project.org mailing list -- To UNS
Sorry last count was wrong ...
test =data.frame("first"=c("seven","two","five","four"),
"second"=c("three","one","three","one"),
"third"=c("four","two","three","four"),
"fourth"=c("four","one","one","four"))
count =data.frame("dobule1"=c("four",
Tao,
I do assume that the ff-files are still at some location and not deleted
by a finalizer. The following explains how to manipulate file locations
with ff and ffdf objects.
Kind regards
jens
library(ff)
path1 <- "c:/tmp"
path2 <- "c:/tmp2"
# create ffdf,
# using non-standard path sets fin
Hi
I am little bit lost in your logic. Why triple in your fourth line is one. I
expected it will be four?
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Knut
> Krueger
> Sent: Friday, June 26, 2015 10:10 AM
> To: r-h...@stat.math.ethz.ch
> Su
just use same file handle.
From: My List
Date: 2015-06-26 15:37
To: R-help
Subject: [R] Usage of sink()
All:
I have the following code segment.
msg <- file("msg.txt", open="wt")
out <- file("out.txt", open="wt")
sink(msg, type="message")
sink(out, type="output")
write("write() to stderr"
Dear Members,
is there a better solution to count the amounts of occurrence in a row
with string data than with loops to get the count data.frame?
test =data.frame("first"=c("seven","two","five","four"),
"second"=c("three","one","three","one"),
"third"=c("four
I used the following code -
msg <- file("ABC.txt", open="a")
out <- file("ABC.txt", open="a")
sink(msg, type="message")
sink(out, type="output")
write("write() to stderr", stderr())
write("write() to stdout", stdout())
and it works.
Thanks !!!
-Harmeet
On Fri, Jun 26, 2015 at 12:48 PM, Jianwen L
All:
I have the following code segment.
msg <- file("msg.txt", open="wt")
out <- file("out.txt", open="wt")
sink(msg, type="message")
sink(out, type="output")
write("write() to stderr", stderr())
write("write() to stdout", stdout())
This works fine, when I want the messages to goto mes.txt and
On 06/25/2015 11:18 PM, Therneau, Terry M., Ph.D. wrote:
The help page for prmatrix states that it only exists for backwards
compatability and
strongly hints at using print.matrix instead.
However, there does not seem to be a print.matrix() function.'
I asked this very same question here
34 matches
Mail list logo