Interesting to read all the answers. Personally, I was a bit irked to see
that using a combination of assignments using rownames() and colnames() did
not work as one canceled what the other had done.
But it turns out if we listed to what John really wanted versus what he said
he wanted, then a
(Sorry for the double post.)
On Tue, 4 Jul 2023 10:14:43 +0300
Ivan Krylov wrote:
> Try replacing the _second_ paste() in the example above with a c().
What I had forgotten to mention is that you also need to replace the
initial assignment
> string=""
with the following:
string =
On Mon, 3 Jul 2023 20:08:06 +
"Sorkin, John" wrote:
> # create variable names xxx1 and xxx2.
> string=""
> for (j in 1:2){
> name <- paste("xxx",j,sep="")
> string <- paste(string,name)
> print(string)
> }
> # Creation of xxx1 and xxx2 works
> string
You need to distinguish between a
My life is complete.
I have inspired a fortune!
John
From: Rolf Turner
Sent: Monday, July 3, 2023 6:34 PM
To: Bert Gunter
Cc: Sorkin, John; r-help@r-project.org (r-help@r-project.org); Achim Zeileis
Subject: Re: [R] Create a variable lenght string that
At least on my system string has a single value of " xxx1 xxx2" not "xxx1" and
"xxx2".
The variable zzz has two values: "J K xxx1" and "J K xxx2"
What you want is "J", "K", "xxx1", "xxx2"
If I cheat everything works. So then the goal is to rewrite the program so
cheating is not needed.
#
On Mon, 3 Jul 2023 13:40:41 -0700
Bert Gunter wrote:
> I am not going to try to sort out your confusion, as others have
> already tried and failed.
Fortune nomination!!!
cheers,
Rolf Turner
--
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't.
I am not going to try to sort out your confusion, as others have already
tried and failed. But I will point out that "string" of variables is pretty
much nonsense in R. A "character vector"/"vector of strings" is probably
what you mean and want to provide column names // names for the second
Colleagues,
I am sending this email again with a better description of my problem and the
area where I need help.
I need help creating a string of variables that will be accepted by the
dimnames function. The string needs to start with the dimnames j and k followed
by a series of dimnames
8 matches
Mail list logo