similar to: vectorize subscript ranges?

Displaying 20 results from an estimated 4000 matches similar to: "vectorize subscript ranges?"

2011 May 26
3
change function scope?
I'm still getting used to R's scoping. I've run into the following situation value=0 thefunction <- function() print( value ) somefunction <- function() { value=99; thefunction() } somefunction() now, I understand that somefunction() returns 0 because thefunction() was defined with value=0 in its parent envrionment, it dosent look at all in the environment of somefunction. My
2004 Dec 13
3
bootstrap package
Hello R'ers In previous versions of R (I now use 2.0.1) there was a package "bootstrap". I wrote some programs that depended heavily on this package but can unfortunately not find it on Cran today. Is there any way to find an older version of "bootstrap" and use it with the new version - 2.0.1? Sincerely Fredrik Lundgren Norrk??ping Sweden
2006 Aug 11
3
Auto-save possible in R?
Hello fellow R'ers, I have a simple calculation with a very large data set being generated (34.9 million values) on a somewhat unreliable XP box that will likely take ~ 74hrs. I wanted to know if there is a way to have my script automatically "save.image()" throughout the calculation in case of a crash. This could be on the basis of output generated or time elapsed. I checked the
2010 Apr 11
2
".Rhistory in Mac OS X"
Dear R'ers, I use R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 and Mac OS X 10.5.8 and use to work in different dierectories. When doing so it appears as if the .Rhistory file from my home directory always is loaded even when I want the file from the directory where I'm working. I have tried to fix it through preferences
2004 Jun 30
2
Question about plotting related to roll-up
Hello R'ers, I have a large set of data which has many y samples for each unit x. The data might look like: Seconds Response_time ---------- ---------------- 0 0.150 0 0.202 0 0.065 1 0.110 1 0.280 2 0.230 2 0.156 3 0.070 3 0.185 3 0.255 3 0.311 3 0.120 4 .... and so on When I do a basic plot with type=l or the default of points it obviously plots every
2008 Apr 12
1
ggplot2 - plot with only legend?
I just found out that this message got scrambled with other threads, so I trying to re-send... Dear R'ers, I am trying to build a composite plot (with several plots in one figure). I have tried, but I cannot use facetting, as I need to customize each plot using grid. Since all the plots are the same (with different data, but same layout and categories), I would like to have only one legend,
2007 Jul 03
1
Plotting very skewed data in barplot
Dear R'ers, I would like to use barplot or a similar function to plot data demonstrating the distribution of the length of a kind of conservation in about 25000 DNA sequences. My data look like this: #Total sequences: 23873 0 19936 1 218 2 391 3 477 4 360 5 431 6 294 7 215 8 320 9 209 10 160 (.....) 99 0 100 1 101 0 102 0 103 1 104 0 105 0 106 0 107 0 108 0 109 1 Therefore, I would like
2004 Feb 11
1
levelplot colorkey
Dear R'ers, I've scanned available documentation and the web, but I can't seem to figure out where I've gone wrong in adding numbers to scale the colorkey in levelplot (Lattice package). For example, levelplot(z, contour=T, labels=T, cuts=10, region=T,... colorkey=list(T, space="bottom", at=seq(0,2000,length=20),
2012 Jan 25
1
Coloring Canada provinces (package maps?)
Dear R'ers, I am wondering what is the smallest geographicterritorial unit available for formatting in Canada. Provinces? I know that in the US it is the county so that I can color US counties any way I want, for example: ### Example for coloring US counties ### Creating an ARTIFICIAL criterion for coloring US counties: library(maps) allcounties<-data.frame(county=map('county',
2012 Apr 27
1
Dot plot cex
Dear R'ers, I was not able to change the font size of axis label using cex.   Tried R archive solutions, though not solved yet. My code is: print(dotplot(ss ~ Response | bb*sr*tr, pp, pch = 21,               strip = FALSE, strip.left = TRUE,layout = c(3,8),               scales = list(y = list(relation = "free")), cex.axis=.2, cex.label=.2,                       ylab =
2012 Apr 27
1
TikzDevice
Dear R'ers, I have trouble installing tikzDevice in Ubuntu.  When I use install.packages("tikzDevice"), it gives error message: ERROR: dependency ‘filehash’ is not available for package ‘tikzDevice’ * removing ‘/usr/local/lib/R/site-library/tikzDevice’ Then I tried filehash installation, I get the message: "package ‘filehash’ is not available (for R version 2.13.1)"
2010 Mar 30
1
Efficiency question: replacing all NAs with a zero
Dear R'ers, I have a very large data frame (over 4000 rows and 2,500 columns). My task is very simple - I have to replace all NAs with a zero. My code works fine on smaller data frames - but I have to deal with a huge one and there are many NAs in each column. R runs out of memory on me ("Reached total allocation of 1535Mb: see help(memory.size)"). Is there any other, more efficient
2009 Apr 07
1
Constrained, multiple response statistics
R'ers: I was hoping I could get some direction on this. I have a dataset of the form: Y1,Y2,...,YM = f(X1,X2,...,XN), where N is >>> M The response data (Y1,Y2,...,YM) is frequency data, such that the sum of all Yi = 1.0. Both Xj and Yi are continuous variables. I'm trying to figure out the best approach(es) to solving for the model f() -- any ideas? I could solve
2010 Oct 22
1
lm looking for weights outside of the user-defined function
Dear R'ers, I am fighting with a problem that is driving me crazy. I use "lm" in my user-defined function, but it seems to be looking for weights outside of my function's environment: ### Generating example data: x<-data.frame(y=rnorm(100,0,1),a=rnorm(100,1,1),b=rnorm(100,2,1)) myweights<-runif(100) data.for.regression<-x[1:3] ### Creating function
2006 Jul 18
1
Reconfiguring wide frame to long frame
Greetings, fellow R'ers. How can I get this frame in R: ID meas ID.1 meas.1 1 1.1 3 1.2 2 2.1 4 2.2 to look like this (stacking): ID meas 1 1.1 2 2.1 3 1.2 4 2.2 It's not really the reshape function (or is it?) because we can consider the additional columns, viz., ID.1 and meas.1, as independent of ID and meas so it is basically a stacking
2009 Sep 22
1
any way to make it work faster (deleting rows that contain certain values)
Hello, dear R'ers, index<-expand.grid(1:7,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4) In this case, dim(index) is 7,340,032 (!) and 11. I realize it's huge. Then, I am trying to get rid of the undesired combinations of columns. They should not contain identical values in any 2 columns. Also if column 1 has a value of 5, there should be no 2 in any other column, if column 1 has a value
2010 Apr 04
2
"mantel.haenszel.test for trend in S-plus doesn't work i R"
Dear R'ers, When I used S-plus i wrote a small program for a Mantel-Haenszel test for trend (I think it worked). Unfortunately I can't get it working in R. It appears as if my use of 'el' is the problem but I can't sort it out. Error in apply(array, c(, 2, 3), function(el) el * 1:s) : argument is missing, with no default Further down in the program I use 'el'
2013 Dec 06
2
Using assign with mapply
I have a data frame whose first colum contains the names of the variables and whose second colum contains the values to assign to them: : kkk <- data.frame(vars=c("var1", "var2", "var3"), vals=c(10, 20, 30), stringsAsFactors=F) If I do : assign(kkk$vars[1], kkk$vals[1]) it works : var1 [1] 10 However, if I try with mapply
2003 Oct 14
3
mapply() gives seg fault
Hello everybody. I've been experimenting with mapply(). Does anyone else have problems with: R> mapply(rep,times=1:4, MoreArgs=42) (I get a seg fault). robin R> R.version _ platform powerpc-apple-darwin6.6 arch powerpc os darwin6.6 system powerpc, darwin6.6 status beta major 1 minor 8.0 year 2003 month 10 day 02 language R >
2011 Nov 11
1
Fwd: Use of R for VECM
----- Forwarded Message ----- From: vramaiah at neo.tamu.edu To: "bernhard pfaff" <bernhard.pfaff at pfaffikus.de> Sent: Friday, November 11, 2011 9:03:11 AM GMT -06:00 US/Canada Central Subject: Use of R for VECM Hello Fellow R'ers I am a new user of R and I am applying it for solving Bi-Variate (Consumption and Output) VECM with Co-Integration (I(1)) with three lags on