由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - R: 变object 名为 string
相关主题
R doesnt have pass by reference mechanism?help, got laid off
如何找到两个相同character在一个string中的位置?R question
res log pseudo-likelihood function咣,咣,咣,上书了!Quick R guide.
SAS问题,关于@和@@的区别请教一个概率题的思路
请教Base 70 中的一题 关于@怎么演化成这样了呢?
MCMC算法的Posterior Std. 一定是减少的么?也谈什么是统计
提高R速度的一些tips再写一个找工作的经历
辅修stats或biostats的问题R program help
相关话题的讨论汇总
话题: object话题: string话题: example话题: want话题: 名为
进入Statistics版参与讨论
1 (共1页)
d********p
发帖数: 31
1
请问如何将 R 的object 名变成 string。
Example:
x=20
y=object_to_string(x)
print ( paste('this is what I want:', y, '=', x) )
结果应当是:
this is what I want: x = 20
D*********2
发帖数: 535
2
sorry I do not get it.
Why can not u just
print ( paste('this is what I want: x =', x) )
or your x is a list of variable? Give a detailed example please.
d********p
发帖数: 31
3

because it will be used in a loop, so in each iteration x will be different.
that is why.
thanks.

【在 D*********2 的大作中提到】
: sorry I do not get it.
: Why can not u just
: print ( paste('this is what I want: x =', x) )
: or your x is a list of variable? Give a detailed example please.

l*********s
发帖数: 5409
4
brother songkun provided the answer days ago: use eval(parse(text="x1")) .
d********p
发帖数: 31
5

so great! thanks.

【在 l*********s 的大作中提到】
: brother songkun provided the answer days ago: use eval(parse(text="x1")) .
1 (共1页)
进入Statistics版参与讨论
相关主题
R program help请教Base 70 中的一题 关于@
How to transpose a data frame in RMCMC算法的Posterior Std. 一定是减少的么?
接着How to transpose a data frame in R问一句。提高R速度的一些tips
How to compute sum of revenue for each day each person in R?辅修stats或biostats的问题
R doesnt have pass by reference mechanism?help, got laid off
如何找到两个相同character在一个string中的位置?R question
res log pseudo-likelihood function咣,咣,咣,上书了!Quick R guide.
SAS问题,关于@和@@的区别请教一个概率题的思路
相关话题的讨论汇总
话题: object话题: string话题: example话题: want话题: 名为