tag:blogger.com,1999:blog-5049613389055921243.post601764821324059020..comments2024-03-05T16:42:05.992+05:30Comments on We think therefore we R: Modelling with R: part 1Shreyeshttp://www.blogger.com/profile/02952702110986035135noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-5049613389055921243.post-46797964596439497652014-01-26T19:50:03.021+05:302014-01-26T19:50:03.021+05:30Can someone please upload the data set... i have t...Can someone please upload the data set... i have tried all the commands and R still cant read the data.Iqbalnoreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-14903354500379439962011-11-02T14:51:32.868+05:302011-11-02T14:51:32.868+05:30Thanks Dave :)Thanks Dave :)MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-51710840875155858752011-11-02T08:18:09.395+05:302011-11-02T08:18:09.395+05:30Just getting back to this. Been busy with finish g...Just getting back to this. Been busy with finish grad school. Thanks to both of you. I was able to get the data loaded. Thanks for the excellent tutorial!Dave Knoreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-72924799625145804882011-10-04T10:35:26.407+05:302011-10-04T10:35:26.407+05:30Thank you CrankyMax...
The command's quite he...Thank you CrankyMax...<br /><br />The command's quite helpful; will add it to the post.MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-48102515943846736302011-10-04T10:34:43.890+05:302011-10-04T10:34:43.890+05:30Hey Dave... Thanks for bringing this up. I hadn...Hey Dave... Thanks for bringing this up. I hadn't realized my mistake. I had downloaded the data from a website, which I can't recollect unfortunately, in a csv format. At that time I wasn't didn't know that I was going to put it up online, so I didn't keep a record of the link. :(<br /><br /><br />Regarding the files, I am using the "german.data" file (with 21 columns) and NOT the "german.data-numeric" file (with 25 columns). I really don't know what the additional four columns are representing since there in no description about them in the data dictionary. Hope this helps.<br /><br />Additionally, for importing the file into R, you can use the command by CrankyMax.<br /><br />Kindly let me know if you still have a problem while importing the data.MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-67517059722958902752011-10-04T09:09:46.532+05:302011-10-04T09:09:46.532+05:30I got the data to load with the german.data file f...I got the data to load with the german.data file from the site with the following command<br /><br />g.data <- read.delim("german.data",header=F,sep=" ")<br /><br />A great article; I'm following the series.<br />Cheers<br />BrettCrankyMaxhttps://www.blogger.com/profile/10717644542263443473noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-90261003160752623762011-10-04T05:26:25.296+05:302011-10-04T05:26:25.296+05:30I must be an idiot or something. I saw a couple ne...I must be an idiot or something. I saw a couple new things I wanted to try out in this post but am having a hard time finding the data you are using. The data you link to is not in comma delimited format and the german.data-numeric file (which looks like the one you are using) has 25 columns. Could you provide a better link to the data you are using? Thanks.Dave Kincaidhttps://www.blogger.com/profile/10168082019976608130noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-69829235949228655022011-10-02T19:45:00.343+05:302011-10-02T19:45:00.343+05:30I just realized the indecency in my behaviour.
Th...I just realized the indecency in my behaviour.<br /><br />Thank you Venki... I appreciate it.MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-21182078654842066052011-10-02T18:39:37.486+05:302011-10-02T18:39:37.486+05:30Oh, I didn't know about this command...
Will ...Oh, I didn't know about this command...<br /><br />Will definitely check it out and include it in the next post if it serves the purpose better.<br /><br />Thank you.MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-55542719307110813722011-10-01T13:37:57.493+05:302011-10-01T13:37:57.493+05:30Dude, don't use attach. It can lead to all man...Dude, don't use attach. It can lead to all manner of problems. Use with() instead.<br /><br />Used like so with(dataframe, function(variable)).<br /><br />It takes a bit of getting used to, but attach has caused me serious pain in the pastDisgruntled PhDhttps://www.blogger.com/profile/00926204336056169207noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-88602776573318753742011-09-30T16:55:48.847+05:302011-09-30T16:55:48.847+05:30I have checked again and it seems to be working, T...I have checked again and it seems to be working, The bug was in my data set generating code. Apologies for not being clear. I am generating the data set in VBA that's why long and integer type came up.<br />Here is the VBA code -<br /><br />Option Base 1<br />Option Explicit<br /><br /><br />Sub generate()<br />Dim total(1000000) As Long<br />Dim i As Long<br />Dim k As Long<br /><br />Randomize<br />For i = 1 To 1000000<br /> total(i) = 0<br /> Randomize<br /> For k = 1 To 5<br /> If Rnd > (5 / 26) Then<br /> If Rnd <= (8 / 26) Then total(i) = total(i) + 5<br /> End If<br /> <br /> If Rnd > (7 / 26) Then<br /> If Rnd <= (8 / 26) Then total(i) = total(i) + 5<br /> End If<br /> <br /> <br /> If Rnd <= (8 / 26) Then total(i) = total(i) + 10 <br /> <br /> <br /> Next k<br /> <br /> Call Print_Test(total(i)) //write the data in the file<br />Next i<br /><br />End Sub<br /><br />Function Print_Test(output As Long)<br />Dim record As String<br />Open "D:\data.txt" For Append As #1<br />record = "" & output & vbCrLf<br />Print #1, record<br />Close #1<br />End Function<br /><br />I am storing it in a text file and loading the data using the Import Dataset option in RStudio. Tt's working now. Thanks for your time!Debajyoti Dattahttps://www.blogger.com/profile/11033195106473324049noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-57373949179728813782011-09-30T15:44:17.473+05:302011-09-30T15:44:17.473+05:30Hi Debajyoti
So first, I don't think there ar...Hi Debajyoti<br /><br />So first, I don't think there are "long" type variables in R. For simple numeric variables, there are two types, integer and real (also known as numeric).<br /><br />Additionally, I don't think there should be a problem while trying to import a million observations of a single variable.<br /><br />How is the data stored on disk, i.e, in which format? And how are you trying to import it? Can you please share the code?MKhttps://www.blogger.com/profile/03144859563025317904noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-79359755323270712602011-09-30T12:47:26.545+05:302011-09-30T12:47:26.545+05:30R newbie here, thanks for the post.
While loading...R newbie here, thanks for the post.<br /><br />While loading a data set some time back, I ran into a problem. I had two data sets, first one contained 1000000 observations of a single variable of integer type. The second data set also contained 1000000 observations of a single variable but of long type. While the first data set loaded correctly, only about 650000 observations of the second data set were loaded. Any idea why it happens? I think this is because R allocates the memory at the beginning of loading and I don't think I have enough memory for 1000000 long type variables.Debajyoti Dattahttps://www.blogger.com/profile/11033195106473324049noreply@blogger.comtag:blogger.com,1999:blog-5049613389055921243.post-26750380638919307962011-09-30T12:04:48.014+05:302011-09-30T12:04:48.014+05:30Waiting for the next Post !! Good job.Waiting for the next Post !! Good job.Anonymoushttps://www.blogger.com/profile/04403952227020477147noreply@blogger.com