由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - R-Question about attach
相关主题
a R questionSAS软件下载地址已失效(as of 3/23/2010)
R environment 问题null model fit statistics (in proc logistic and etc)
R同名函数问题SAS help
Use SAS to fill in missing values?把base考了
初级问题:怎么算某variable 的所有observation的加和[合集] SAS 问题:如何在使用macro的时候保护data。
SAS base questionSAS问题请教, keep/drop
what is the problem?问你们个 sas macro 的问题
SAS/IML读已有数据问题【包子】从excel读取数据到R的问题
相关话题的讨论汇总
话题: attach话题: mydata话题: q4话题: q1话题: gender
进入Statistics版参与讨论
1 (共1页)
a*****8
发帖数: 110
1
Tried to run: attach(mydata)
Got this:
The following object(s) are masked from mydata ( position 3 ) :
gender q1 q2 q3 q4
I thought it was becuae I have objects gender q1 q2 q3 q4 in my workspace.
But it still didn't work after I removed them.
Thanks!
s*****n
发帖数: 2174
2
Did you attach multiple times? If so, you need to detach multiple times
accordingly.
BTW, R tip #1, never do attach(). You may avoid typing some letters in a
short term, but in the long run, you may get into trouble sooner or later.
q**j
发帖数: 10612
3
it is position 3. check what is in your position 2.
a*****8
发帖数: 110
4
Thanks so much for your reply!
Yes, I did.
I am not sure if I did an attach and didn't detach when I saved my workspace
. But I colsed everything and restart R, attach is still not working.
a*****8
发帖数: 110
5
OK, I just start a new session.
> mydata
gender q1 q2 q3 q4
1 f 1 1 5 1
2 f 2 1 4 1
3 f 2 2 4 3
4 3 1 NA 3
5 m 3 5 2 4
6 m 5 4 5 5
7 m 5 3 4 4
8 m 4 5 5 5
> attach(mydata)
The following object(s) are masked _by_ .GlobalEnv :
gender q1 q2 q3 q4
>
What is the problem? Thanks!
s*****n
发帖数: 2174
6
you probably saved workspace before, and when you restart R, it loads the
default workspace automatically, which includes the previous definition or
attachment of gender, q1...q4.
What you can do is:
1. find out the default working directory of your R, and then delete the .
RData file. In Windows, it is usually your R installation directory, and in
Unix, it is usually the current directory.
2. You can also do a rm(list=ls()), which erases everything in the memory
and then do a save workspace to
a*****8
发帖数: 110
7
Thank you so much!
q**j
发帖数: 10612
8
if you read the starting chapter of the little book, it tells you how to avo
id this kind of situation by modifying the Rgui setup.

【在 a*****8 的大作中提到】
: Thank you so much!
a*****8
发帖数: 110
9
What little book? Thanks!
h***i
发帖数: 3844
10
little sas book

【在 a*****8 的大作中提到】
: What little book? Thanks!
相关主题
SAS base questionSAS软件下载地址已失效(as of 3/23/2010)
what is the problem?null model fit statistics (in proc logistic and etc)
SAS/IML读已有数据问题SAS help
进入Statistics版参与讨论
a*****8
发帖数: 110
11
Are you sure, it's all about SAS
h***i
发帖数: 3844
12
没看前文,sorry

【在 a*****8 的大作中提到】
: Are you sure, it's all about SAS
a*****8
发帖数: 110
13
Nevermind, thanks anyway!
q**j
发帖数: 10612
14
sorry. the little book i wrote. taste of r.

【在 a*****8 的大作中提到】
: Nevermind, thanks anyway!
a*****8
发帖数: 110
15
Thanks! I will go look at it!
1 (共1页)
进入Statistics版参与讨论
相关主题
【包子】从excel读取数据到R的问题初级问题:怎么算某variable 的所有observation的加和
【包子】SAS 多个图在同一页SAS base question
【包子】R处理大dataset问题what is the problem?
sas proc transpose can do this?SAS/IML读已有数据问题
a R questionSAS软件下载地址已失效(as of 3/23/2010)
R environment 问题null model fit statistics (in proc logistic and etc)
R同名函数问题SAS help
Use SAS to fill in missing values?把base考了
相关话题的讨论汇总
话题: attach话题: mydata话题: q4话题: q1话题: gender