similar to: iterated sum

Displaying 20 results from an estimated 3000 matches similar to: "iterated sum"

2013 Dec 13
2
how can i write the function into a file c:/mytest.R with cat function?
mytest<-function(x,f){ sum(x*f)/sum(f) } cat(mytest,file="c:/mytest.R") Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'closure') cannot be handled by 'cat' how can i write the mytest function into a file c:/mytest.R with cat function? [[alternative HTML version deleted]]
2013 Dec 15
3
how to add a line in the graph?
t<--4:4 y<-c(5,7,10,13,15,16,14,12,11) plot(t,y,type="l") how can i add a curve y=0.83*t-0.44*t^2 in the graph? [[alternative HTML version deleted]]
2013 Dec 17
0
result
Mydata is as under. dat=" salary ex + 1 1856 1799 + 2 1856 1800 + 3 1858 1800 + 4 1858 1801 + 5 1862 1803 + 6 1862 1805 + 7 1862 1810 + 8 1865 1805 + 9 1865 1808 + 10 1865 1815 + 11 1865 1820 + 12 1870 1810 + 13 1870 1830 + 14 1880 1840 + 15 1880 1845 + 16 1880 1851 + 17 1880 1853 + 18 1880 1855 + 19 1885 1850 + 20 1885 1852 + 21 1885 1857 + 22 1885 1860 + 23
2012 Apr 13
3
A little exercise in R!
Greetings all! A recent news item got me thinking that a problem stated therein could provide a teasing little exercise in R programming. http://www.bbc.co.uk/news/uk-england-cambridgeshire-17680326 Cambridge University hosts first European 'maths Olympiad' for girls The first European girls-only "mathematical Olympiad" competition is being hosted by Cambridge
2011 Dec 24
2
readLines errors
Hi All, I met a problem using readLines function to return the data from Google maps. readLines(url(" http://ditu.google.cn/maps/geo?q=+qianshuichong,+guichi+anhui,+CN&output=csv&key=ABQIAAAAq8Fnd_oUka-7RdS6BrD7GBTqeABoQuNTXS36G_rkiwQnKRW6GBTkns8JpKz6y6dScgB8827dlddUlg"), n=1, warn=FALSE) [1] "200,4,30.6528380,117.4872250" The above code is ok because the
2011 Jun 05
2
kronecker sum
Dear All, Could someone please suggest how to find the Kronecker sum of two 2x2 matrices, i.e. given two matrices: -A A a -a and -B B b -b I need: -A-B A B 0 a -a-B 0 B b 0 -A-b A 0 b a -a-b Many thanks, Lara [[alternative HTML version deleted]]
2011 Aug 23
4
Correlation discrepancy
Dear R list, I have one very elementary question regrading correlation between two variables. x = c(44,46,46,47,45,43,45,44) y = c(44,43,41,41,46,48,44,43) > cov(x, y) [1] -2.428571 However, if I try to calculate the covariance using the formula as covariance = sum((x-mean(x))*(y-mean(y)))/8       # no of of paired obs. = 8 or     covariance = sum(x*y)/8-(mean(x)*mean(y)) gives
2015 Jun 08
2
help awk y shells en R
Hola buenas, a veces empleo desde R shells de unix, Existe alguna manera de utilizar estos shelss desde windows o el lenguaje awk. La idea es hacerlo siempre desde R, igual invoncando cygwin desde windows es posible. Pero no me queda claro Un abrazo y gracias por adelntado Javier #_____________________________________________________________________ # EJEMPLO, ¿Que habría que poner en #
2013 Apr 25
2
Decomposing a List
Greetings! For some reason I am not managing to work out how to do this (in principle) simple task! As a result of applying strsplit() to a vector of character strings, I have a long list L (N elements), where each element is a vector of two character strings, like: L[1] = c("A1","B1") L[2] = c("A2","B2") L[3] = c("A3","B3")
2012 Jul 30
6
Turning off continuation prompt?
Greetings All. My apologies for a question whose answer is probably readily available somewhere (for some interpetation of "somewhere") ... Say I have just typed (from a sheet of paper) several lines into the R command-line, and what I see is: > chisq.test(matrix(c(3,6,3,4,4, + 4,1,4,6,5, + 2,7,4,2,5, + 8,2,4,4,2, +
2010 Dec 07
4
increase or decrease variable by 1
many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? -- View this message in context: http://r.789695.n4.nabble.com/increase-or-decrease-variable-by-1-tp3076390p3076390.html Sent from the R help mailing list archive at Nabble.com.
2008 Dec 08
4
Removing string's accents
Hi, I''m pretty sure to have seen a new method ''remove_accents'' in Rails 2.2 but I can''t find it again. Is it me or does this method exists for good ? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2010 Nov 13
1
Efficient marginal sums?
Hi Folks, [This is not unrelated to the current "vector of vectors" thread, but arises quite independently] Say I have a function f(x,y) which computes a value for scalar x and y; or, if either x=X or y=Y is a vector, a corresponding vector of values f(X,y) or f(x,Y) (with the usual built-in vectorisation of operations). Now I have X=(x.1,x.2,...,x.m) and Y=(y.1,y.2,...,y.n). I'm
2010 Feb 26
2
t-distribution values
Dear all, how to calculate values of t-distribution for given values of d.f. using R functions? Anton
2011 Nov 18
3
Permutations
Hi all, why factorial(150) shows the error out of range in 'gammafn'? I have to calculate the number of subset formed by 150 samples taking 10 at a time. How is this possible? best [[alternative HTML version deleted]]
2012 Oct 11
2
Help on probability distribution question
Dear All,   I have a questions I would like to ask about and wonder if you have any thoughts to make it work in R.   1. I work in the field of medicine where physiologic variables are often simulated, and they can not have negative values. Most often the assumption is made to simulate this parameters with a normal distribution but in the "log-domain" to avoid from negative values to be
2013 Mar 26
2
edit.data() read-only?
Greetings All. The function edit.data() allows a convenient spreadsheet-like view of a dataframe with too many rows/columns to fit on the screen (especially when there are many columns). Very useful when scanning through a dataset (row & column are conveniently identified by the labels at the side and above). However, there seens to be no option to set it "read-only" on start-up,
2012 Feb 25
2
Finding name of variable supplied as function argument
Greetings All. I want to do the following simple thing. I have defined a function med3x3() such that, given vectors X,Y, med3x3(X,Y) returns a 3x3 table where: Row 1: X > median(X) Row 2: X = median(X) Row 3: X < median(X) Col 1: Y < median(Y) Col 2: Y = median(Y) Col 3: Y > median(Y) (with intersections of these conditions for the individual cells). I can easily define fixed
2012 Apr 05
2
"NA" vs. NA
Dear All, I assume this is an R-devel issue, apologies if I missed something obvious. I have a dataframe where the row names are country codes, based on ISO 3166, something like this: ------------ "v1" "v2" "UK" 1 2 "NA" 2 3 ------------ It happens that "NA" is the country code for "Namibia", and that creates problems on
2007 Aug 08
6
The CentOS-Plus kernel
I see the new kernel available in the plus repository... is there some way to view what the differences are between that and the mainline kernel?