tag:blogger.com,1999:blog-2956099714546919205.post7124913797628286335..comments2024-03-25T00:59:47.919-07:00Comments on Musings of a forgetful functor: The R apply function – a tutorial with examplesaxiomOfChoicehttp://www.blogger.com/profile/10274657326813344423noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-2956099714546919205.post-76196020164254758522019-04-18T05:41:58.084-07:002019-04-18T05:41:58.084-07:00Excellent.....!!
If you are looking for Microsoft ...Excellent.....!!<br />If you are looking for Microsoft assistance for www office com/setup or Install and enter product key with Genuine Product Serial Key then you can visit our website or click on given link. Thanks<br /><a href="%E2%80%9D" rel="nofollow">office.com/setup</a><br /><a href="%E2%80%9Dwwwofficesetupcom.com%E2%80%9D" rel="nofollow">office com setup</a><br /><a href="%E2%80%9Dwwwofficesetupcom.com/setup.html%E2%80%9D" rel="nofollow"> www office com/setup</a><br /><a href="%E2%80%9Dwwwofficesetupcom.com/setup.html%E2%80%9D" rel="nofollow">www.office.com/setup</a><br />Office Setuphttps://www.blogger.com/profile/11165542967928755585noreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-49620334009011982702019-04-18T05:37:03.366-07:002019-04-18T05:37:03.366-07:00This comment has been removed by the author.ASK SEO Ninjahttps://www.blogger.com/profile/03796620264093567660noreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-2918837827423941882018-07-14T15:34:36.203-07:002018-07-14T15:34:36.203-07:00I agree that the speed problem is greatly overstat...I agree that the speed problem is greatly overstated. But it doesn't even take VBA to do this in Excel.<br />Column A: the number(s) to rotate digits, formatted as text<br />Column B: =RANDBETWEEN(1, LEN(A1))<br />Column C: =CONCATENATE(RIGHT(A1,B1),LEFT(A1,LEN(A1)-B1))<br />Seems to satisfy the specification and runs PDQ<br />Anonymoushttps://www.blogger.com/profile/04915462009597872570noreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-50936347262825181782015-11-14T16:38:36.890-08:002015-11-14T16:38:36.890-08:00I have to question your statements about the speed...I have to question your statements about the speed of excel to do this problem. I wrote the following function and ran it over 100 thousand times in less than a second.<br /><br />Public Function Rearrange(X)<br />Dim pos As Integer<br /><br />If Len(X) <= 1 Then<br /> Rearrange = X<br />Else<br /> pos = Int(Rnd() * Len(X)) + 1<br /> <br /> Rearrange = Mid(X, pos, 1) & Rearrange(Mid(X, 1, pos - 1) & Mid(X, pos + 1))<br />End If<br /><br />End Function<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-46335534315321674872013-05-08T18:50:17.312-07:002013-05-08T18:50:17.312-07:00Instead of your translate function, why not just
s...Instead of your translate function, why not just<br />sample(x, length(x)) ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-45065251793608624992011-07-02T17:07:31.990-07:002011-07-02T17:07:31.990-07:00Thanks for your comments. You are dead right, Andr...Thanks for your comments. You are dead right, Andrej, the mod call can be done directly on the matrix. However, for the purposes of illustration I have used the apply function to demonstrate its application. <br /><br />EDI, thanks for picking up that typo.axiomOfChoicehttps://www.blogger.com/profile/10274657326813344423noreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-51424949976918696862011-07-02T12:42:19.585-07:002011-07-02T12:42:19.585-07:00# Return the mean of each of the columns
apply(m,2...# Return the mean of each of the columns<br />apply(m,2,sum)<br /><br />Isn´t here a typo?EDIhttps://www.blogger.com/profile/05324724692911849295noreply@blogger.comtag:blogger.com,1999:blog-2956099714546919205.post-53161451448752176712011-07-02T11:59:31.233-07:002011-07-02T11:59:31.233-07:00You can do the mod call directly on the matrix
m%...You can do the mod call directly on the matrix<br /><br />m%%10<br /><br />This is also much faster than margin = c(1, 2):<br /><br />system.time(for (i in 1:10000) apply(m,c(1,2),function(x) x%%10))<br /><br />system.time(for (i in 1:10000) m%%10)<br /><br />Cheers, AndrejAndrej-Nikolai Spiessnoreply@blogger.com