similar to: Selecting elements from a vector (a simple question with weird results)

Displaying 20 results from an estimated 30000 matches similar to: "Selecting elements from a vector (a simple question with weird results)"

2010 Jan 01
4
How to use read.table with Hebrew column names ?
Hello dear R help group, I am trying to read a .txt file, with Hebrew column names, while keeping the column names looking well in R - but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And am trying the command: read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t") This returns me with: X.....ª X...ª......
2010 Apr 21
2
long output in R
Hello all: Is there a way to set up R such that, when you have a very long output from a command, it will pause when it has displayed one-screen of information and ask me to press a button to continue displaying? I happen to have one such command and the information I need is at the top of the output - and it's just nowhere to be seen. (If you are familiar with Stata, I'm looking for
2009 Sep 13
2
How can I get "predict.lm" results with manual calculations ? (a floating point problem)
Hello dear r-help group I am turning for you for help with FAQ number 7.31: "Why doesn't R think these numbers are equal?" http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f *My story* is this: I wish to run many lm predictions and need to have them run fast. Using predict.lm is relatively slow, so I tried having it run faster by
2010 Jan 21
2
"stack imbalance in ..." when loading a workspace
Hi all, I just failed in loading a saved wordspace (13MB of size), and received these errors: Warning: stack imbalance in 'missing', 52 then 51 Warning: stack imbalance in 'if', 50 then 53 Warning: stack imbalance in 'as.environment', 57 then 59 Warning: stack imbalance in 'ls', 54 then 53 Warning: stack imbalance in '.Internal', 54 then 53 Warning: stack
2009 Mar 18
1
Reading a file line by line - separating lines VS separating columns
Hello all. I wish to read a large data set into R. My current issue is in getting the data so that R would be able to access it. Using read.table won't work since the data is over 1GB in size (and I am using windows XP), so my plan was to read the file chunk by chunk and each time move it into bigmemory (I'll play with that when the time will come, maybe ff is better ?!). I encountered
2010 Feb 25
24
two questions for R beginners
* What were your biggest misconceptions or stumbling blocks to getting up and running with R? * What documents helped you the most in this initial phase? I especially want to hear from people who are lazy and impatient. Feel free to write to me off-list. Definitely write off-list if you are just confirming what has been said on-list. -- Patrick Burns pburns at pburns.seanet.com
2011 Apr 29
2
read.csv fails to read a CSV file from google docs
Hello all, I wish to use read.csv to read a google doc spreadsheet. I try using the following code: data_url <- " http://spreadsheets0.google.com/spreadsheet/pub?hl=en&hl=en&key=0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE&single=true&gid=0&output=csv " read.csv(data_url) Which results in the following error: Error in file(file, "rt") : cannot open
2010 Mar 18
1
How to read.table with “Hebrew” column names (in R)?
(I am reposting this question after a few months without a solution...) Hi all, I am trying to read a .txt file, with Hebrew column names, but without success. I uploaded an example file to: http://www.talgalili.com/files/aa.txt And tried the command: read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t") This returns me with: X.....ª X...ª......
2009 Aug 20
4
simple randomization question: How to perform "sample" in chunks
Hello dear R-help group. My task looks simple, but I can't seem to find a "smart" (e.g: non loop) solution to it. Task: I wish to randomize a data.frame by one column, while keeping the inner-order in the second column as is. So for example, let's say I have the following data.frame: xx <-data.frame(a= c(1,2,2,3,3,3,4,4,4,4) , b =
2009 Jun 01
1
using "cochran.test()" as a "mcnemar.test()" ?
Hello all I wish to perform a mcnemar.test() for a 5X5 matrix. Wikipedia tells me (http://en.wikipedia.org/wiki/Cochran_test) I should turn to cochran.test. The only place I found it was in the "outliers" package, but the command cochran.test() acts differently then mcnemar.test() , and doesn't take a table as input. Any ideas on how to use it ? #Example code: aa =
2010 Mar 31
3
barplot and line
Hi r-users,   I have this data below and would like to plot a barplot overlap with a line. This is my data: > hist_50     pdf_obs pdf_gen.50 1  0.000000   0.000000 2  0.083156   0.125366 3  0.132196   0.158230 4  0.126866   0.149432 5  0.120469   0.127897 6  0.121535   0.104096 7  0.103412   0.082171 8  0.082090   0.063539 9  0.065032   0.048408 10 0.050107   0.036470 11 0.036247   0.027236 12
2009 Nov 16
1
Paper on data exploration
R users doing data analysis may be interested in the following paper: http://methodsblog.wordpress.com/2009/11/13/first-paper-now-online/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+wordpress%2Fmethodsblog+(methods.blog) All data and R code is available. Alain ----- -------------------------------------------------------------------- Dr. Alain F. Zuur First author of:
2010 Dec 16
5
test whether all elements of a vector are identical
Dear list, this might be an easy one, but I could figure out a solution (or how to google the right term). Is there any way to test whether all elements of a vector are identical? For numeric vectors I would use sum(diff(vector)==0)==0 but I have character vectors. Any Ideas? Cheers Jannis
2010 Apr 26
1
Why am I getting different results from cor VS ccf ?
Hi all, I am getting different results from ccf and cor, Here is a simple example: set.seed(100) N <- 100 x1 <- sample(N) x2 <- x1 + rnorm(N,0,5) ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] cor(x1[-N], x2[-1]) Results: > ccf(x1,x2)$acf[ccf(x1,x2)$lag == -1] [1] -0.128027 > cor(x1[-N], x2[-1]) [1] -0.1301427 Thanks, Tal ----------------Contact
2009 Nov 18
2
Importing tRNA data into R ?
Hello dear R help group, I would like to download the tRNA data on: http://gtrnadb.ucsc.edu/download.html And then import it into R. Can anyone direct me as to how to do so? Thanks, Tal ---------------------------------------------- My contact information: Tal Galili E-mail: Tal.Galili@gmail.com Phone number: 972-52-7275845 FaceBook: Tal Galili My Blogs: http://www.talgalili.com (Web and
2009 Jun 28
2
simple loop
Hi everyone! I have this dataframe: firm<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4),rep(5,4),rep(6,4)) year<-c(rep(2000:2003,6)) industry<-c(rep(10,4),rep(20,4),rep(30,4),rep(10,4),rep(20,4),rep(30,4)) X1<-c(10,14,18,16,20,45,23,54,24,67,98,58,16,32,57,12,54,0,0,22,11,3,5,6) data<-data.frame(firm, industry,year,X1) data I need a loop that calculates the mean of X1 by year and by
2010 Jun 13
1
Finding an order for an hclust (dendrogram) object without intersections
Hello all, I manually created an hclust object. Now I am looking to reorder the leafs so they won't intersect with each other, and would be happy for advises on how to do that. Here is an example code: #------------------------------------- a <- list() # initialize empty object # define merging pattern: # negative numbers are leaves, # positive are merged clusters (defined by row
2009 Nov 20
6
How to: highlight R syntax on webpages ?
My question if in the Subject, but if to extend: I am specifically curious about WordPress blogs. But any solution will give me a lead. Thanks, Tal ---------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com/ (English) [[alternative HTML version deleted]]
2009 Oct 14
2
Scatter plot using icons (from a gif) instaed of points - is it possible ?
Hello dear R-help group. I wish to plot a scatter plot using icons (or images) instead of points. Is it possible? and how so? Thanks, Tal ---------------------------------------------- My contact information: Tal Galili E-mail: Tal.Galili@gmail.com Phone number: 972-52-7275845 FaceBook: Tal Galili My Blogs: http://www.talgalili.com (Web and general, Hebrew) http://www.biostatistics.co.il
2010 Jun 12
1
Displaying "homogeneous groups" in aov post-hoc results ?
Hello dear R-help mailing list, A friend of mine teaches a regression and experimental design course and asked me the following question. She is trying to find a way to display the "homogeneous groups" (after performing tukey test on an aov object). here's an example for what she means by "homogeneous groups": She did one way anova and got these results for tukey test: