similar to: how to call a function for each row

Displaying 20 results from an estimated 20000 matches similar to: "how to call a function for each row"

2012 Jan 09
6
runif with condition
Hi I want to generate 4 random number which sum up to 100 always Please help ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/runif-with-condition-tp4278704p4278704.html Sent from the R help mailing list archive at Nabble.com.
2011 Dec 03
2
help in removal of fixed pattern
Hi I have column name as given below If the variable is in log(X1 + 1) pattern it should be removed and i need only X1 Input log(x1 + 1) x2 log(X3 +1) Expected Output X1 X2 X3 Please help me -- View this message in context: http://r.789695.n4.nabble.com/help-in-removal-of-fixed-pattern-tp4152524p4152524.html Sent from the R help mailing list archive at Nabble.com.
2011 Oct 24
2
How to get intecerpt standard error in PLS
Hi how do we get intercepts standard error. I'm using the package pls. i got the coefficient but not able to get the stabdard error -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-intecerpt-standard-error-in-PLS-tp3932104p3932104.html Sent from the R help mailing list archive at Nabble.com.
2012 Nov 26
3
Help in splitting the records
Hi I have set of records seperated by a separator say "$$$" i want to get the values in a dataframe. eq qwer$$12$$qwre ewrtr$7789$ewwe I want the output as\ V1 V2 V3 qwer 12 qwre ewrtr 7789 ewwwe Please help me ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-splitting-the-records-tp4650827.html Sent from
2011 Nov 07
1
Intercepts is coming as Zero in the Mixed Models
Hi I'm getting the intercepts of the Random effects as 0. Please help me to understand why this is coming Zero This is my R code Data<- read.csv("C:/FE and RE.csv") Formula="Y~X2+X3+X4 + (1|State) + (0+X5|State)" fit=lmer(formula=Formula,data=Data) ranef(fit). My sample Data State Year Y X2 X3 X4 X5 X6 S2 1960 27.8 397.5 42.2 50.7 78.3 65.8 S1 1960 29.9 413.3 38.1
2011 Nov 15
1
Remove thw data from the dataframe
Hi, I want to remove the entire row from the dataset if any of the row contains blank or NA my dataset look like State Year Y X2 X3 X4 X5 X6 State1 1960 27.8 397.5 42.2 50.7 78.3 65.8 State2 1960 29.9 413.3 38.1 52 79.2 66.9 State1 1961 29.8 439.2 40.3 54 79.2 67.8 State2 1961 30.8 459.7 39.5 79.2 69.6 State1 1962 31.2 492.9 37.3 54.7 77.4 68.7 State2 1962 528.6 38.1 80.2 73.6 State1 1963
2011 Oct 21
1
use of segments in PLS
How to use the segments in the PLS fit1 <- mvr(formula=Y~X1+X2+X3+X4+x5+....+x27, data=Dataset, comp=5,segment =7 ) here when i use segments,the error was like this rror in mvrCv(X, Y, ncomp, method = method, scale = sdscale, ...) : argument 7 matches multiple formal arguments Please help -- View this message in context:
2011 Oct 18
1
getting p-value and standard error in PLS
Hi How to get p-value and the standard error in PLS I have used the following function to calculate PLS fit1 <- mvr(formula=Y~X1+X2+X3+X4, data=Dataset, comp=4) Please help me -- View this message in context: http://r.789695.n4.nabble.com/getting-p-value-and-standard-error-in-PLS-tp3914760p3914760.html Sent from the R help mailing list archive at Nabble.com.
2011 Nov 16
2
fitted.values in lm function
Hi i have few clarification regarding the output from the fitted(object). I'm creating a object using the following formula dataset <- read.csv("~/data.csv") obj = lm (formula="log(y+1)~log(x1+1)+(log(x2+1)+log(x3+1)", data=dataset) fitted(obj) here the output of the fitted(obj) considers the log(x1+1) or just log(x1). -- View this message in context:
2012 Feb 22
4
Week number from a date
Hi My data looks like this startDate="2008-06-01" dateRange =c( "2008-10-01","2008-12-01") Is there any method to find the week number from the startDate range ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html Sent from the R help mailing list archive at Nabble.com.
2012 Nov 11
4
Multiplying elements of a list by rows of a matrix
Hi all, I have the following code: set.seed(1) x1 <- matrix(sample(1:12), ncol=3) x2 <- matrix(sample(1:12), ncol=3) x3 <- matrix(sample(1:12), ncol=3) X <- list(x1,x2,x3) tt <- matrix(round(runif(5*4),2), ncol=4) Is there a way I can construct a new list where newlist[[i]] = tt[i,] %*% X[[i]] without using a for loop? Each element of newlist will be 3 x 1 vector. Thanks -- Tina
2011 Sep 19
2
Setting the Values
Hi I have a variable str = " X", "Y" and values ("0","12") i want to set value for X =0 and Y =12 and use inside the program. how to do this Please anybody help me. -- View this message in context: http://r.789695.n4.nabble.com/Setting-the-Values-tp3823388p3823388.html Sent from the R help mailing list archive at Nabble.com.
2012 Apr 03
2
Histogram classwise
Hi I have a data class wise. I want to create a histogram class wise without using for loop as it takes a long time my data looks like this x class 27 1 93 3 65 5 1 2 69 5 2 1 92 4 49 5 55 4 46 1 51 3 100 4 ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Histogram-classwise-tp4528624p4528624.html Sent from the R help mailing list archive
2012 Jul 17
2
comparing three vectors
Hi I 've a data a=c(10,20,30) b=c(100,200,300) c=c(50,60,70) I want to compare a[1]<=c[1]<b[1],...... How to compare for all the records ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/comparing-three-vectors-tp4636728.html Sent from the R help mailing list archive at Nabble.com.
2012 Apr 24
2
searchina a pattern in a string
I have a long string. i want to sepearate a 10 digit phone no from it. eg "my no is 9876543210 is personal no and my official no is 123-456-8907. you can use any of these" i want to seperate the 9876543210 and 123-456-8907 from this. therev may be many phone nos in the string. how to do it ----- Thanks in Advance Arun -- View this message in context:
2012 Apr 10
1
plotting multiple plot in same graph
Hi I have four sets of datas x1, x2, x3,y I want to sactter plot between (x1,y) and line chart between (x2 ,y) and (x3,y) all these should come in a single graph Can anyone help ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/plotting-multiple-plot-in-same-graph-tp4545624p4545624.html Sent from the R help mailing list archive at
2012 Mar 27
1
help in replacing for llop
Hi I have records like like this X1 X2 State 34 72 state1 9 63 state1 49 31 state1 60 34 state1 80 73 state1 60 20 state2 59 87 state2 88 20 state2 71 66 state2 65 56 state2 59 16 state1 60 100 state2 I want to get the summarize value like mean median histogram for X1 and X2 based on state. I'm using FOR loop for this. Is there any method to remove for loop and use apply or any
2012 Oct 24
3
Results not dispalying in R console
Hi I'm not getting any results in R console when i run commands. I reinstalled R but the results are same ----- Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Results-not-dispalying-in-R-console-tp4647271.html Sent from the R help mailing list archive at Nabble.com.
2013 Sep 02
3
Product of certain rows in a matrix
Hi, You could try: A<- matrix(unlist(read.table(text=" 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 ",sep="",header=FALSE)),ncol=3,byrow=FALSE,dimnames=NULL) library(matrixStats) ?res1<-t(sapply(split(as.data.frame(A),as.numeric(gl(nrow(A),2,6))),colProds)) ?res1 #? [,1] [,2] [,3] #1??? 4?? 10?? 18 #2?? 63?? 64?? 63 #3?? 18?? 10??? 4
2012 Feb 13
2
R's AIC values differ from published values
Using the Cement hardening data in Anderson (2008) Model Based Inference in the Life Sciences. A Primer on Evidence, and working with the best model which is lm ( y ~ x1 + x2, data = cement ) the AIC value from R is model <- lm ( formula = y ~ x1 + x2 , data = cement ) AIC ( model ) 64.312 which can be converted to AICc by adding the bias