[R] 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 V2V3 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 the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] configure: error: --with-x=yes (default) and X11 headers/libs are not a
Hi I'm trying to install R-2.15.2 in Unix environment and when i run ./configure i'm getting the following error configure: error: --with-x=yes (default) and X11 headers/libs are not available. i just unzip .tar file and ran ./configure. I'm not able to get x11() anywhere. Please help me - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/configure-error-with-x-yes-default-and-X11-headers-libs-are-not-a-tp4649592.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] pattern matching
hi My string contain string = The sales is good when my num1 between 1 to 5 . else the sales is poor. i want to find the patten between 1 to 5 . between and to will be constant but the numbers would be changing. How to search for that pattern. Please help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/pattern-matching-tp4645688.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to get a date variable from a dataset
Hi I have a find the class of each variable of the data set which is given as input. I can able to find the string and the numeric variable. Not able to find if the variable is date or not Can any one help me. - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-a-date-variable-from-a-dataset-tp4639038.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] finding correlation for lagged values
Hi I've to find the correlation of a variable and lag of other variable. My code currently looks like this y= 32 1 45 26 33 55 15 24 31 78 x=51 69 96 67 71 89 61 42 78 24 lagTimes=2 i want to find the correlation between y and Lag(x,1) and Y Lag(x,2) i'm using loop to find the lag and then finding correlation If there are more variables and need to find the correlation lag with y it takes a lot of time. can anyone help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/finding-correlation-for-lagged-values-tp4638663.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Generating Random Numbers
hi My inputs is min=(10,10,10,10,10) and max=(100,100,100,100,100) total = 300 i have to generate 5 numbers between min and max and those numbers should sum upto total Can anyone help? - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Generating-Random-Numbers-tp4637020.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] read the date format
hi I have a data like thursday, November 20,2012. I'm not able to convert into data format in R Can anyone please help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/read-the-date-format-tp4635245.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] checking the validity of the expressions
hi I have a data and have to convert it into the given expression like data=1000:2000 and expression is exp() The code should be checking the validity of the expressions and give out the result that it is valid expression or invalid expression. can any one help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/checking-the-validity-of-the-expressions-tp4633671.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Rootogram for flexmix function
Hi I use the flexmix function for clustering. when i give the command plot(flexmixobjext) , it gives the rootogram plot can anyone help me to understand the plot - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Rootogram-for-flexmix-function-tp4633428.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in increasing R memory in unix
HI I've a unix machine which is of 16 GB. when i run any R process it takes only 2GB of Memory. How to increase Memory limit. It takes a lot of time to run the process for larger datasets - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-increasing-R-memory-in-unix-tp4616510.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in poLCA
Hi My data looks like this dat= X1 X2 Group 84 44 1 86 29 1 94 77 1 78 87 2 94 78 2 60 31 2 I use the formula form = cbind(X1,X2) ~ Group poLCA(form,dat) But i'm getting error stating that ALERT: some manifest variables contain values that are not positive integers. For poLCA to run, please recode categorical outcome variables to increment from 1 to the maximum number of outcome categories for each variable Please can any one help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-poLCA-tp4602300.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] converting class verbatim to string
Hi I have a variable in verbatim and want to search a pattern . but i'm not able to convert it into string. is there anyway that i can search directly from verbatim - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/converting-class-verbatim-to-string-tp4589650p4589650.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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: http://r.789695.n4.nabble.com/searchina-a-pattern-in-a-string-tp4583740p4583740.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in using unique count by match function
Hi My code looks like this I have two parameters x and par1. X contains values and par1 contains the function which i required to use if par1 is max then output should be max(x). FUN - match.fun(par1) result=FUN(x) Is it possible to incorporate the unique count of x within this code eg x=(a,b,a,c) . The output should be 3 - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-using-unique-count-by-match-function-tp4569859p4569859.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] what is the maximum number of records that we can load using dbwrite
Hi I'm using the dbwrite to insert a large dataset. There are about 10 million rows. But i'm not able to load the records. Please can anyone tell me the way to load or maximum number of records that dbwrite does. so that i can load it in batches - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/what-is-the-maximum-number-of-records-that-we-can-load-using-dbwrite-tp4572849p4572849.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in Anderson-Darling Normality test
Hi I'm using the Anderson Darling Normality test in my modelling. I'm finding the Normality test for residuals. if the values of residuals are very high the p-value coming out is infinity. how to interpret this. or is there any means of calculating the normality test - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-Anderson-Darling-Normality-test-tp4566750p4566750.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] getting the value from previous row
Thanks it helped a lot - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/getting-the-value-from-previous-row-tp4554761p4560577.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Week number of a date in a month
Hi I have a requirement such that a a week should be ending on sunday. monday is the week start date. if a month start on sunday. then 2nd day of the month the monday will be in week 2 I need help in creating the week number - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Week-number-of-a-date-in-a-month-tp4554282p4554282.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] getting the value from previous row
Hi I've a dataset with record A = 100,200,300,400... There will be a parameter n. say n=10 means i have add 10% of previous value to the current row current_Val New_value 100 100 200210 (200+10) 300330( 300 +20+10) 400 460 (400+30+20+10) I'm using a loop But i want takes a long time. Please help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/getting-the-value-from-previous-row-tp4554761p4554761.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] loess function take
Hi The function loess takes very long time if the dataset is very huge I have around 100 records and used only one independent variable. still it takes very long time Any suggestion to reduce the time - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/loess-function-take-tp4550896p4550896.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in creating a matrix
Hi I have dataset with n variables, say n =3 x y z the formula should be form = x+y+z+x*x +x*y+x*z +y*y + y*z+z*z my code has to for loop Is there any way to reduce two loops for (i in 1:n) { for (j in i:n) { dat= cbind(dat,dat[,i]*dat[,j]) } } - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-creating-a-matrix-tp4551532p4551532.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help in creating a matrix
The formula is created sepearately and data is created for the formula and then use the modelling lm - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-creating-a-matrix-tp4551532p4551967.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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 Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Creating a dummy variable
HI I want to create a dummy variable for a dataset which has various dates Eg I've one year data. The user can choose any date range startdate : 2012-01-01 enddate: 2012-02-01 startdate: 2012-06-01 enddate=2012-07-01 the columns of dataset= X ,Y ,date Thanks and re - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Creating-a-dummy-variable-tp4542150p4542150.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] creating the variable from a data Range
Hi I have a dataset with a date variable. There may be more than one Date Range. i've to create 1 for the dateRange and 0 for the other. Please can any one help in this - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/creating-the-variable-from-a-data-Range-tp4538115p4538115.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in paste command
i have a character variable tablename=DressMaterials var1=(red,blue,green,white) My output should be like select * from DressMaterialswhere colors in (red,blue,green,white) i'm not able to get the where part. my code paste(select * from , tablename , where colors in ,paste(var1, collapse=,)) But i'm not able to get required result - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-paste-command-tp4534756p4534756.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help in paste command
Thanks Lell It worked well. - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-paste-command-tp4534756p4534925.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in match.fun
hi I have a dataframe and a parameter the parameter can have any one value min max mean sum hist i'm using the function match.fun fun=match.fun(input) fun(dataset) but if input is hist the plot pops up. is there any method to avoid it. else should use only if condition for histogram - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-match-fun-tp4535071p4535071.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in ddply
Hi I've records like this df= x panel 4 1 93 2 21 3 83 4 75 1 87 2 87 3 78 4 50 1 76 2 86 3 65 4 84 1 40 2 39 3 26 4 i want to create histogram out of it . i want all the mid and count values for panel wise my code is histoutput = ddply(df,.(df[2]),hist) i'm not able to get the required result. please help me using for loop takes a lot of time if there are more records - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-ddply-tp4528064p4528064.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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 at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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 alternatives - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-replacing-for-llop-tp4507939p4507939.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in matrix
Hi I have a matrix a = 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 b = 5 6 7 8 9 10 I want output as c = 5 2 3 8 2 3 1 6 3 1 9 3 1 2 7 1 2 10 Please any on help to avoid reduncy of my code - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-matrix-tp4449622p4449622.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Help in matrix
Thanks so much it worked very well - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-in-matrix-tp4449622p4450560.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Error in Aggregate
Hi My dataframe looks like this data= id V1 V2 V3 V4 1 5 6 7 8 1 10 20 30 40 2 23 54 54 6 3 43 54 54 33 4 12 34 54 54 4 34 54 23 52 I have to sum by id I used command aggregate(data,by =list(data$id),FUN=sum) Error i face is Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L), na.rm = FALSE) : sum not meaningful for factors Please help me - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Error-in-Aggregate-tp4431318p4431318.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] inserting a dataframe into the table
Hi, I have a dataset X Y A= 10 15 20 30 40 50 B = X Z 10 30 20 50 I have a table containing X Y Z columns How to insert a data frame into the table without using for loop ? now currently i'm using the for loop with using the insert command? - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/inserting-a-dataframe-into-the-table-tp4409756p4409756.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] inserting a dataframe into the table
Yes the table already exist and it contains data ant to insert two data frame into that separately - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/inserting-a-dataframe-into-the-table-tp4409756p4412667.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Multiplication usijg apply
Hi my data looks like X=(3,5,6,7)B= 1 2 3 4 and C=( 1 2 3 4) 2 3 4 5 4 5 6 7 8 9 1 2 I want my results to be XB + C. Please help me use apply in this function - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Multiplication-usijg-apply-tp4405903p4405903.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Creating XML using apply
Hi My data looks like this data is a vector data=var1 var2 var3 100 120 130 i want to put it in an XML xmlOutput=NULL xmlOutput- newXMLNode(results) for( i in 1 : length(data)) { newXMLNode(variable,attrs=c(name =names(data)[i] ), value = data[i]), parent = xmlOutput) } is it possible to use apply here If there more variables it takes long time to create XML - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Creating-XML-using-apply-tp4396480p4396480.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] variable ordering
Thanks it worked - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/variable-ordering-tp4393109p4393197.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in run if
hi My data looks like x=c(0,0,0,0,0) y=c(10,20,30,40,50) i want to generate 5 random numbers between x and y keeping x values as min and y value as max using apply it takes time when it is run using for - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/help-in-run-if-tp4389785p4389785.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] variable ordering
Hi, My input is x=c(D,A,B) Y=c(A,B,C,D) varorder=which(Y %in% X) I'm getting result as 1 2 4 But i need the result to be 4 1 2 can any one help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/variable-ordering-tp4393109p4393109.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] comparing vectors with condition
Hi I have two vector x=c(10,30,40,50) total=c(20,20,0,10) Var_exceeding_total=sum(as.numeric(x total)) This will compare the vectors x and total a gives the result. if i want to compare only if the y 0 . can we apply condition in the comparison ? - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/comparing-vectors-with-condition-tp4382946p4382946.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] calling the function which is stored in a list
Hi I'm storing two functions in a list # creating two function function1 - function(n) { return(sum(n)) } function2 - function(n) { return(mean(n)) } #storing the function function3 =c(function1,function2) is it possible to call the stored function and used it ? x=c(10,29) funtion3[1](x) Thanks - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/calling-the-function-which-is-stored-in-a-list-tp4372131p4372131.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] calling the function which is stored in a list
Thanks it works - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/calling-the-function-which-is-stored-in-a-list-tp4372131p4372557.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] rounding of integer
Hi I need to round integer \ eg if my value is 1003 i want to make it 1000 Thanks in advance - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/rounding-of-integer-tp4360549p4360549.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help required in using apply instead of for loop
Hi I have a function y= x^2 min =10 max=20 increment=0.1 I want to find the value of y for the value of x between min and max by step increment. how to get the values using apply function instead of for loop - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Help-required-in-using-apply-instead-of-for-loop-tp4344350p4344350.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to remove library source from sweave
Hi I need to remove source of the library from sweave. Please help me cat(\nlibrary(caret),file = abc.Rnw, append = TRUE) cat(\nlibrary(xtable),file = abc.Rnw, append = TRUE) i'm getting the source of the library also. can any one help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/how-to-remove-library-source-from-sweave-tp4323499p4323499.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to choose variabe that needs to be smoothing in GAM
Hi How to choose the variables that needs smoothing. Is there any criteria for those Please help me - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/How-to-choose-variabe-that-needs-to-be-smoothing-in-GAM-tp4305676p4305676.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] choosing a proper knot in GAM mgcv package
hi I want to choose proper knot for the following formula formula = y~ s(x1) + s(x2) + s(x3) + s(x4) + s(x5) + s(x6) +s(x7) + s(x8) gam(fromula,data=dat) if i run the error is Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : A term has fewer unique covariate combinations than specified maximum degrees of freedom how to find k and rectify this error - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/choosing-a-proper-knot-in-GAM-mgcv-package-tp4298977p4298977.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] error in Recursive
Hi I need help in the recursive problem. this is my code #Generate two random Numbers minval=20 maxval=100 cutoffValue=50 optVal- function(cutoffValue,minval,maxval) { x=runif(2) x=x*cutoffValue for( i in 1:2) { if(x[i] 30 || x[i] 60) # checking it falls between the range { optVal(cutoffValue,minval,maxval) } } return(x) } optVal(40,20,60) I'm getting Error like this *Error: evaluation nested too deeply: infinite recursion / options(expressions=)?* Please help me to solve this error. This takes infinite loop - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/error-in-Recursive-tp4281052p4281052.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to remove an element from list or character
HI I want to remove an element from a list or character. i can any of the class type like cat= [1] mac med if my input is 2 i need to remove med and if my input is one i need to remove mac from cat Please help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/how-to-remove-an-element-from-list-or-character-tp4268556p4268556.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] p values in lmer
hi How to get p-values for lmer funtion other than pvals.fnc(), since it takes long time for execution - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/p-values-in-lmer-tp4227434p4227434.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] vif function using lm object
Hi, can anyone please explain why the vif should have more than 2 terms. *vif.lm(lmobj) : model contains fewer than 2 terms* why it is throwng error if it is one variable. - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/vif-function-using-lm-object-tp4220904p4220904.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Hausman test for lmer model
Hi How to perform hausman test when a model is created using lmer ? Also please any one give link to mail it to r-sig-mixed-models mailing list. I'm not able to find it Thanks in advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Hausman-test-for-lmer-model-tp4213473p4213473.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] predict in lmer
Hi Please any one help in finding the predicted value for lmer function model- lmer(formula =formula,data=data,verbose=TRUE,family = gaussian) I need to get predicted value for this model. I'm not able to get the formula Please help Thanks in advance Arun -- View this message in context: http://r.789695.n4.nabble.com/predict-in-lmer-tp4193660p4193660.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help to get fitted and residual value
Data- read.csv(C:/FE and RE.csv) Formula=Y~X2+X3+X4 + X5+X6 fit=lm(formula=Formula,data=Data) 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 52 79.2 66.9 S2 1961 29.8 439.2 40.3 54 79.2 67.8 S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 Is there any way to fitted and residual for the new set of data. or should i create formula manually and pass the values individually S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 -- View this message in context: http://r.789695.n4.nabble.com/Help-to-get-fitted-and-residual-value-tp4167808p4167808.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in dbWriteTable
hi I need some help in dbWriteTable. I'm not able to insert the rows in the table if the column order are not same in the database and in the dataframe which i'm inserting. Also facing issue if the table is already created externally and inserting it thru dbWrite. is there some way that we can sepecify the rownames in the dbwrite..or any method which will solve my problem -- View this message in context: http://r.789695.n4.nabble.com/help-in-dbWriteTable-tp4145110p4145110.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Replacing a value in a dataframe
hi I have data like this in a dataframe Var Value Cheque X140FALSE X220FALSE X328TRUE I want to replace it FLASE with 0 and TRUE with 1. is there any method by which i can do without using LOOP -- View this message in context: http://r.789695.n4.nabble.com/Replacing-a-value-in-a-dataframe-tp4122188p4122188.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to call a function for each row
Hi I have a data-frame which look like this X1 X2 X3 1 3 5 2 4 6 3 6 1 I want to apply a formula Y=6*X1 + 7*X2 + 8*X3 for every row Thanks in Advance -- View this message in context: http://r.789695.n4.nabble.com/how-to-call-a-function-for-each-row-tp4122906p4122906.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Storing the linear model object
Hi Please let me know if we can store the linear model object in the data base and retrive the object and output from them Data- read.csv(C:/FE and RE.csv) Formula=Y~X2+X3+X4 lmobject = lm(formula=Formula,data=Data) can i store the lm object in the database and and is it possible to retrive it and get the summary information -- View this message in context: http://r.789695.n4.nabble.com/Storing-the-linear-model-object-tp4121944p4121944.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to get AIC BIC information using funtion lm
Hi how to get AIC BIC information using funtion lm ? Please help me Data- read.csv(C:/FE and RE.csv) Formula=Y~X2+X3+X4 lm(formula=Formula,data=Data) 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 52 79.2 66.9 S2 1961 29.8 439.2 40.3 54 79.2 67.8 S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 S1 1963 36.4 624.6 37.8 65.9 83.9 77.2 S2 1964 36.7 666.4 38.4 64.5 85.5 78.1 -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-AIC-BIC-information-using-funtion-lm-tp4114401p4114401.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problem in creating a dataframe
Hi I have a character class and i need to convert into dataframe data=(0,0,0,0) I want a dataframe with each one should under a separate column Please help me -- View this message in context: http://r.789695.n4.nabble.com/problem-in-creating-a-dataframe-tp4094676p4094676.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Generating Sequence of Dates
Hi. I need to generate a sequence of date, I need to generate date for a period. Each date should be generated n times. E.g seq(as.Date(2000/1/1), by=month, length.out=3) the output of this is 2000-01-01 2000-02-01 2000-03-01 But i need each date to be generated n times, if n =2 my output 2000-01-01 2001-01-01 2000-02-01 2000-02-01 2000-03-01 2000-03-01 -- View this message in context: http://r.789695.n4.nabble.com/Generating-Sequence-of-Dates-tp4090672p4090672.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] how to include a factor or class Variable
Hi How to include a factor or class variable to a fixed effect of lmer function. when i included it throws an error. Please help My code data - read.delim(C:/TestData/data.txt) Mon=as.factor(data$Month) lmerform= Y~ X2 +X3 + Month:Mon + (1|State)+ (1+ X5|State) lmerfit=lmer(formula=lmerform,data=data) summary(lmerfit) My data State YearMonth Y X2 X3 X4 X5 X6 GA 19601 27.8397.5 42.250.778.365.8 FA 19602 29.9413.3 38.152 79.266.9 GA 19613 29.8439.2 40.354 79.267.8 FA 19614 30.8459.7 39.555.379.269.6 GA 19621 31.2492.9 37.354.777.468.7 FA 19622 33.3528.6 38.163.780.273.6 GA 19633 35.6560.3 39.369.880.476.3 -- View this message in context: http://r.789695.n4.nabble.com/how-to-include-a-factor-or-class-Variable-tp4079991p4079991.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] fitted.values in lm function
Thanks Josh -- View this message in context: http://r.789695.n4.nabble.com/fitted-values-in-lm-function-tp4075426p4076397.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] changing date format in a dataframe
Hi I have a data frame and i need to change the date format in it. my dataframe X Date 1 1/1/2009 2 2/1/2009 3 3/1/2009 I need to change it to 2009-01-01 -- View this message in context: http://r.789695.n4.nabble.com/changing-date-format-in-a-dataframe-tp4076411p4076411.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Adding a year to existing date
Hi I need to add an year to and date field in the dataframe. Please help me X Date 1 2008-01-01 2 2008-02-01 3 2003-03-01 Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/Adding-a-year-to-existing-date-tp4078930p4078930.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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: http://r.789695.n4.nabble.com/fitted-values-in-lm-function-tp4075426p4075426.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] help in fitted values in lm function
Hi, I have a data set of 1 rows and ran a linear regression by using the function lmres = lm(formula,data) then got the fitted value by using the value fit=fitted(lmres). but the number of rows in the fitted one is about 9548, What could be the reason for reduction in the number of rows in the fitted one -- View this message in context: http://r.789695.n4.nabble.com/help-in-fitted-values-in-lm-function-tp4038642p4038642.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] help in fitted values in lm function
Yes there are few NA in the Data -- View this message in context: http://r.789695.n4.nabble.com/help-in-fitted-values-in-lm-function-tp4038642p4039207.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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 YearY X2 X3 X4 X5 X6 State1 196027.8397.5 42.250.778.365.8 State2 196029.9413.3 38.152 79.266.9 State1 196129.8439.2 40.354 79.267.8 State2 196130.8459.7 39.579.269.6 State1 196231.2492.9 37.354.777.468.7 State2 1962528.6 38.180.273.6 State1 196335.6560.3 39.369.880.476.3 State2 196336.4624.6 37.865.977.2 State1 1964666.4 38.464.585.578.1 State2 196438.4717.8 40.193.784.7 State1 196540.4768.2 38.673.293.3 State2 196540.339.867.8104.8 89.7 I want to remove the entire row from the dataset if any of the rows have blanks or NA -- View this message in context: http://r.789695.n4.nabble.com/Remove-thw-data-from-the-dataframe-tp4041903p4041903.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] logistic Regression using lmer
Hi can we perform logistic regression using lmer function. Please help me with this -- View this message in context: http://r.789695.n4.nabble.com/logistic-Regression-using-lmer-tp4034056p4034056.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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 52 79.2 66.9 S2 1961 29.8 439.2 40.3 54 79.2 67.8 S1 1961 30.8 459.7 39.5 55.3 79.2 69.6 S2 1962 31.2 492.9 37.3 54.7 77.4 68.7 S1 1962 33.3 528.6 38.1 63.7 80.2 73.6 S2 1963 35.6 560.3 39.3 69.8 80.4 76.3 S1 1963 36.4 624.6 37.8 65.9 83.9 77.2 S2 1964 36.7 666.4 38.4 64.5 85.5 78.1 S1 1964 38.4 717.8 40.1 70 93.7 84.7 S2 1965 40.4 768.2 38.6 73.2 106.1 93.3 S1 1965 40.3 843.3 39.8 67.8 104.8 89.7 S2 1966 41.8 911.6 39.7 79.1 114 100.7 S1 1966 40.4 931.1 52.1 95.4 124.1 113.5 S2 1967 40.7 1021.5 48.9 94.2 127.6 115.3 S1 1967 40.1 1165.9 58.3 123.5 142.9 136.7 S2 1968 42.7 1349.6 57.9 129.9 143.6 139.2 S1 1968 44.1 1449.4 56.5 117.6 139.2 132 S2 1969 46.7 1575.5 63.7 130.9 165.5 132.1 S1 1969 50.6 1759.1 61.6 129.8 203.3 154.4 S2 1970 50.1 1994.2 58.9 128 219.6 174.9 S1 1970 51.7 2258.1 66.4 141 221.6 180.8 S2 1971 52.9 2478.7 70.4 168.2 232.6 189.4 -- View this message in context: http://r.789695.n4.nabble.com/Intercepts-is-coming-as-Zero-in-the-Mixed-Models-tp3997498p3997498.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Help in ranef Function
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 YearY X2 X3 X4 X5 X6 S2 196027.8397.5 42.250.778.365.8 S1 196029.9413.3 38.152 79.266.9 S2 196129.8439.2 40.354 79.267.8 S1 196130.8459.7 39.555.379.269.6 S2 196231.2492.9 37.354.777.468.7 S1 196233.3528.6 38.163.780.273.6 S2 196335.6560.3 39.369.880.476.3 S1 196336.4624.6 37.865.983.977.2 S2 196436.7666.4 38.464.585.578.1 S1 196438.4717.8 40.170 93.784.7 S2 196540.4768.2 38.673.2106.1 93.3 S1 196540.3843.3 39.867.8104.8 89.7 S2 196641.8911.6 39.779.1114 100.7 S1 196640.4931.1 52.195.4124.1 113.5 S2 196740.71021.5 48.994.2127.6 115.3 S1 196740.11165.9 58.3123.5 142.9 136.7 S2 196842.71349.6 57.9129.9 143.6 139.2 S1 196844.11449.4 56.5117.6 139.2 132 S2 196946.71575.5 63.7130.9 165.5 132.1 S1 196950.61759.1 61.6129.8 203.3 154.4 S2 197050.11994.2 58.9128 219.6 174.9 S1 197051.72258.1 66.4141 221.6 180.8 S2 197152.92478.7 70.4168.2 232.6 189.4 -- View this message in context: http://r.789695.n4.nabble.com/Help-in-ranef-Function-tp3984436p3984436.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Error in dim(data) - dim : attempt to set an attribute on NULL.
This post has NOT been accepted by the mailing list yet. Hi, I'm passing the input parameters and calculating the linear regression. some time i'm getting the error Error in dim(data) - dim : attempt to set an attribute on NULL. But when i restart my R studio, then it runs. Please help to resolve this problem. My code looks like dataset - read.csv(C:/data/data1.csv) formula12= Y~X1+X2 LinearRegression - lm(formula=formula12,data=dataset, singular.ok=TRUE) vif(LinearRegression) Please help me to solve this issue -- View this message in context: http://r.789695.n4.nabble.com/Error-in-dim-data-dim-attempt-to-set-an-attribute-on-NULL-tp3954811p3954811.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Problem in creating XML
I've a problem in creating an XML My code node= newXMLNode(data) new-newXMLNode(new,parent=node) child-newXMLNode(Plot,parent=new) My dataframe Plot looks like below x y 0 123812.31 1 120166.77 2 15.83 3 102809.13 4 84438.97 5 84588.40 for( i in nrows(Plot)) { newXMLNode(child,attrs = c(x = as.character(i),y = as.character(Plot$y[j])),parent=newl) } Butg i'm getting error Error in strsplit(name, :) : non-character argument Please help me -- View this message in context: http://r.789695.n4.nabble.com/Problem-in-creating-XML-tp3935980p3935980.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to get intecerpt standard error in PLS
Hi This is my data present in a file Year Y X2 X3 X4 X5 X6 1960 27.8 397.5 42.2 50.7 78.3 65.8 1960 29.9 413.3 38.1 52 79.2 66.9 1961 29.8 439.2 40.3 54 79.2 67.8 1961 30.8 459.7 39.5 55.3 79.2 69.6 1962 31.2 492.9 37.3 54.7 77.4 68.7 my formula for using PLS fit1 - mvr(formula=Y~X1+X2+X3+X4, data=Dataset, comp=4) using the formula x=jack.test(fit1, ncomp = components) y - coef.mvr(fit1,components,intercept=TRUE) from y i 'm able to get the intercepts but only from x i'm able to get the standard errors ans p-values How to get the p-values and standard error for intercepts -- View this message in context: http://r.789695.n4.nabble.com/How-to-get-intecerpt-standard-error-in-PLS-tp3932104p3932299.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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: http://r.789695.n4.nabble.com/use-of-segments-in-PLS-tp3924397p3924397.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R square and F - stats in PLS
In the lm function the summary(lmobject) we have adjusted.r square and f statistics Do we have similar to the pls package and how to get it -- View this message in context: http://r.789695.n4.nabble.com/R-square-and-F-stats-in-PLS-tp3924484p3924484.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] problem in exceuting PLS
Hi I'm performing a PLS This is my data present in a file Year Y X2 X3 X4 X5 X6 1960 27.8 397.5 42.2 50.7 78.3 65.8 1960 29.9 413.3 38.1 52 79.2 66.9 1961 29.8 439.2 40.3 54 79.2 67.8 1961 30.8 459.7 39.5 55.3 79.2 69.6 1962 31.2 492.9 37.3 54.7 77.4 68.7 My R-code Data - read.csv(C:/TestData.csv) variable=names(Data)[4:8] dataset=NULL dataset$X=NULL len=length(variable) for( i in 1:len) { var=variable[i] if(i==1) { dataset$X=as.matrix(Data[var]) } if(i1) { dataset$X=as.matrix(cbind(dataset$X,Data[var])) } } depVar=Y dataset$Y=as.matrix(cbind(Data[depVar])) pls1=mvr(Y~X,data=dataset,ncomp=4) summary(pls1) On execution the error is Error in get(as.character(FUN), mode = function, envir = envir) : object 'X6' of mode 'function' was not found Please help me on this -- View this message in context: http://r.789695.n4.nabble.com/problem-in-exceuting-PLS-tp3914664p3914664.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to add a double quote to a string
Hi I want to add a double quote to a string eg Expected output = DROP TABLE IF EXISTS abc My code tab=c(abc) query = paste(DROP TABLE IF EXISTS ,tab,sep=) Please help me to solve this problem -- View this message in context: http://r.789695.n4.nabble.com/How-to-add-a-double-quote-to-a-string-tp3893061p3893061.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Stop the process
Hi I'm creating a sweave (Rnw) from R and running the r code inside the sweave and then creating report from sweave file using R. If any error occurs in the running R code inside the sweeve file. it should stop entire R process itself Please help me to solve this -- View this message in context: http://r.789695.n4.nabble.com/Stop-the-process-tp3859352p3859352.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Capturing the error information
Hi, I want to capture the error information without throwing it out. if i use try command it throws and also stores. and not able to get the error if i use tryCatch command. a=a b=10 c=try(a/b) Please help -- View this message in context: http://r.789695.n4.nabble.com/Capturing-the-error-information-tp3846624p3846624.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] How to terminate R program if found any execution error
Hi I want to terminate R process if there are any execution error. a=a b=10 c=try(a/b) if(class(c)[1]==try-error) { stop(Wrong Input Value) } d=c*c if c fails then it should terminate the process. Please can anyone help -- View this message in context: http://r.789695.n4.nabble.com/How-to-terminate-R-program-if-found-any-execution-error-tp3846127p3846127.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.