Displaying 20 results from an estimated 20000 matches similar to: "Different results in calculating SD of 2 numbers"
2007 Apr 18
5
Problem with ?curve
Dear all R gurus,
I have following syntax:
y = c(1:10)
chippy <- function(x)
{
y[5] = x
sin(cos(t(y)%*%y)*exp(-t(y)%*%y/2))
}
curve(chippy, 1, 20, n=200)
But I am getting error while executing :
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' and 'y' lengths differ
In addition: Warning message:
number of items to
2008 Sep 11
4
All possible pairs of two variables
I have two variables (x,y) :
x : it takes all integer values from 0 to y and,
y : takes all values from 0, 10
I am looking for some R code to find all possible pairs of (x,y). Can anyone please help me?
New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
[[alternative HTML version
2011 Jun 06
2
A Calculation on list object
Hello, I am into some calculation on a list object, therefore requesting the peers if there is any short cut way to so the same calculation.
Let say I have following list object:
> List <- vector('list', length = 3)
> set.seed(1)
> List[[1]] <- rnorm(5)
> List[[2]] <- rnorm(2)
> List[[3]] <- rnorm(7)
> List
[[1]]
[1] -0.6264538 0.1836433 -0.8356286
2010 Sep 15
3
Keyword to clear the screen
Hi all, can anyone please tell me what is the key-word to clear the screen? I am aware of the "cont+L", however I need some R-syntax, that can be typed into the console to clear the screen.
Thanks
[[alternative HTML version deleted]]
2012 Dec 26
3
Working with date
Hi,
Let say I have a date variable:
> ?asd <- as.Date("2012-01-03")
> asd
[1] "2012-01-03"
Now, I want to express this date like 3/1/2012.
can somebody help me how to achieve that?
Thanks,
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called
heatmap.w.row.and.col.clust which auto-generates breaks using
breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20,
digits = 2) #(stddev in this case = 2.5)
This has always worked well in the past but now I am getting an error
that non-finite breaks are being generated. Drilling down, it seems
that my wrapper is generating finite
2011 Jan 08
3
Question on list objects
Hi, I have 2 questions on list object:
1. Suppose I have a matrix like:
dat <- matrix(1:9,3)
Now I want to replicate this entire matrix 3 times and put entire result in a list object. Means, if "res" is the resulting list then I should have:
res[[1]]=dat, res[[2]]=dat, res[[3]]=dat
How can I do that in the easilest manner?
2. Suppose I have 2 list objects:
list1 <- list2
2010 Oct 29
4
Checking existance of a directory
Hi all, I am wondering is there any way to check whether some Directory exists or not, given the parent path of that directory? After searching for a while I found that there is a function dir.create() to create some directory. However I need to know whether such directory already exists or not, otherwise I will create that.
Thanks,
[[alternative HTML version deleted]]
2010 Dec 22
3
A question to get all possible combinations
Let say, I have a matrix with 8 rows and 6 columns:
> df1 <- matrix(NA, 8, 4)
> df1
[,1] [,2] [,3] [,4]
[1,] NA NA NA NA
[2,] NA NA NA NA
[3,] NA NA NA NA
[4,] NA NA NA NA
[5,] NA NA NA NA
[6,] NA NA NA NA
[7,] NA NA NA NA
[8,] NA NA NA NA
Now I want to get **all possible** ways to fetch 6 cells at a
2010 Oct 14
1
Fw: Problem to create a matrix polynomial
Awaiting some suggestion. Was my question not very understandable? Please let me know how can I offer more elaborate clarification.
Additionally, I would like to solve the determinant of "p1" for the values of "z" (I am working with some multivariate time series modelling). When I use det() function, it am getting error that, that function is not for objects with class
2018 Nov 25
1
[PATCH] drm/nouveau/bios/ramcfg: fix missing parentheses when calculating RON
From: Colin Ian King <colin.king at canonical.com>
Currently, the expression for calculating RON is always going to result
in zero no matter the value of ram->mr[1] because the ! operator has
higher precedence than the shift >> operator. I believe the missing
parentheses around the expression before appying the ! operator will
result in the desired result.
[ Note, not tested ]
2010 Aug 01
3
Meaning of following function
Hi friends, I am aware of the function "-"() which acts as minus in ordinary computations. For example:
> "-"(3, 1)
[1] 2
However what is the meaning of
> "-"(3)
[1] -3
I was expecting R to generate some error as it does for "*"(3). What is the logic for that calculation?
Thanks,
[[alternative HTML version deleted]]
2008 Nov 20
2
Calculating SD according to groups of rows
*Hi all,
I know this is probably basic, but I have proven to be a slow learner in any
programming language. Anyhow,
how can I calculate the SD for each person in my table? I have two patients
in this R data.frame, 7200 and 23955.
I extracted this from a relational database, but am I better off attempting
to compute SD in SQL, or is this easily accomplished in R?
* SUBJECT_ID HR
1
2008 Oct 22
2
Creating list from matrix
Hello everyone,
I have a matrix like :
mat <- matrix(rnorm(12*3), 3)
Now I want to break that matrix in 4 parts each of them are matrix of (3x3) and put those 4 matrices in a "list" object of length 4
Can anyone please tell me how to do that?
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
[[alternative HTML
2010 Oct 17
2
Vector multiplication
Is there any operator in R, which will multiply each possible combination of the elements of 2 vectors? Suppose I have 2 vectors (1,2) and (1,2,3). If I multiply those 2, I should get:(1,2,3,2,4,6)
Thanks,
[[alternative HTML version deleted]]
2010 Sep 03
2
Matrix to list
Dear all, suppose I have following matrix:
> mat <- matrix(rnorm(25), 5)
>
> mat
[,1] [,2] [,3] [,4] [,5]
[1,] 0.97056228 -1.3278509 -0.73511792 2.1650629 -0.4411997
[2,] 0.58613700 -0.2559899 -1.18334248 -1.4990907 1.8138846
[3,] -1.03333313 2.0227887 0.89622681 0.6483973 -1.5523283
[4,] 0.38968833 0.2490004 -0.02301061 -0.2705150
2012 Jul 02
1
How to get prediction for a variable in WinBUGS?
Dear all,I am a new user of WinBUGS and need your help. After running the following code, I got parameters of beta0 through beta4 (stats, density), but I don't know how to get the prediction of the last value of h, the variable I set to NA and want to model it using the following code.Does anyone can given me a hint? Any advice would be greatly appreciated.Best
2010 Aug 20
2
Determining the length of unique items in a vector
Dear all, let suppose I have following vector:
> dat1 <- c(rep("asd", 5), rep("xyz", 12), rep("erd", 17))
> dat1 <- dat1[sample(1:length(dat1), length(dat1), replace=F)]
> dat1
[1] "erd" "xyz" "erd" "asd" "asd" "erd" "xyz" "asd" "erd" "erd"
2006 Jun 25
1
Puzzled with contour()
Folks,
The contour() function wants x and y to be in increasing order. I have
a situation where I have a grid in x and y, and associated z values,
which looks like this:
x y z
[1,] 0.00 20 1.000
[2,] 0.00 30 1.000
[3,] 0.00 40 1.000
[4,] 0.00 50 1.000
[5,] 0.00 60 1.000
[6,] 0.00 70 1.000
[7,] 0.00 80 0.000
[8,] 0.00 90
2008 Dec 06
1
Morlet wavelet not supportd by wavCWTPeaks
aa <- (structure(list(X.0.85 = c(-1.02, -1.17, -1.29, -1.39, -1.46,
-1.5, -1.52, -1.5, -1.46, -1.39, -1.3, -1.19, -1.07, -0.93, -0.79,
-0.65, -0.5, -0.36, -0.22, -0.08, 0.05, 0.18, 0.3, 0.41, 0.52,
0.62, 0.72, 0.81, 0.89, 0.98, 1.05, 1.13, 1.19, 1.25, 1.29, 1.31,
1.31, 1.29, 1.24, 1.16, 1.06, 0.93, 0.77, 0.58, 0.38, 0.16, -0.07,
-0.31, -0.89, -1.05, -1.19, -1.31, -1.41, -1.47, -1.51, -1.51,